RobWorkProject  23.9.11-
Public Member Functions | Protected Attributes | List of all members
SimulatorLogUtil Class Reference

Utility to make it more convenient to write to a SimulatorLogScope. More...

#include <SimulatorLogUtil.hpp>

Inherited by ODELogUtil.

Public Member Functions

 SimulatorLogUtil ()
 Constructor.
 
virtual ~SimulatorLogUtil ()
 Destructor.
 
virtual void setSimulatorLog (rw::core::Ptr< rwsim::log::SimulatorLogScope > log)
 Set the simulator log to write to. More...
 
virtual bool doLog () const
 Check if there is a log to write to. More...
 
virtual void beginStep (double time, const char *file="", int line=-1)
 Begin a new discrete simulation step. More...
 
virtual void endStep (double time, int line=-1)
 End a discrete simulation step. More...
 
virtual void beginSection (const std::string &name, const char *file="", int line=-1)
 Add a grouping section. More...
 
virtual void endSection (int line=-1)
 End current grouping section. More...
 
virtual rwsim::log::SimulatorLogScopemakeScope (const std::string &name, const char *file="", int line=-1)
 Make a subscope. More...
 
virtual void addValues (const std::string &description, const std::vector< double > &values, const std::vector< std::string > &labels, const char *file="", int line=-1)
 Add numeric values. More...
 
virtual std::ostream & log (const std::string &description, const char *file="", int line=-1)
 Log a message. More...
 
virtual std::ostream & log (const char *file="", int line=-1)
 Log a message. More...
 
virtual void addPositions (const std::string &description, const std::map< std::string, rw::math::Transform3D<>> &positions, const char *file="", int line=-1)
 Add positions for bodies to log. More...
 
virtual void addVelocities (const std::string &description, const std::map< std::string, rw::math::VelocityScrew6D<>> &velocities, const char *file="", int line=-1)
 Add velocities for bodies to log. More...
 
virtual void addCollisionResults (const std::string &description, const std::vector< rw::proximity::CollisionStrategy::Result > &results, const char *file="", int line=-1)
 Add results from a collision strategy. More...
 
virtual void addDistanceResults (const std::string &description, const std::vector< rw::proximity::DistanceStrategy::Result > &results, const char *file="", int line=-1)
 Add results from a distance strategy. More...
 
virtual void addDistanceMultiResults (const std::string &description, const std::vector< rw::proximity::DistanceMultiStrategy::Result > &results, const char *file="", int line=-1)
 Add results from a multi-distance strategy. More...
 

Protected Attributes

rwsim::log::SimulatorLogScope_scope
 Current log scope.
 

Detailed Description

Utility to make it more convenient to write to a SimulatorLogScope.

Member Function Documentation

◆ addCollisionResults()

virtual void addCollisionResults ( const std::string &  description,
const std::vector< rw::proximity::CollisionStrategy::Result > &  results,
const char *  file = "",
int  line = -1 
)
virtual

Add results from a collision strategy.

Parameters
description[in] description of log entry.
results[in] the results of a collision detection.
file[in] filename where logging is happening.
line[in] the line number of the file where logging is happening.

◆ addDistanceMultiResults()

virtual void addDistanceMultiResults ( const std::string &  description,
const std::vector< rw::proximity::DistanceMultiStrategy::Result > &  results,
const char *  file = "",
int  line = -1 
)
virtual

Add results from a multi-distance strategy.

Parameters
description[in] description of log entry.
results[in] the results of a multi-distance detection.
file[in] filename where logging is happening.
line[in] the line number of the file where logging is happening.

◆ addDistanceResults()

virtual void addDistanceResults ( const std::string &  description,
const std::vector< rw::proximity::DistanceStrategy::Result > &  results,
const char *  file = "",
int  line = -1 
)
virtual

Add results from a distance strategy.

Parameters
description[in] description of log entry.
results[in] the results of a distance detection.
file[in] filename where logging is happening.
line[in] the line number of the file where logging is happening.

◆ addPositions()

virtual void addPositions ( const std::string &  description,
const std::map< std::string, rw::math::Transform3D<>> &  positions,
const char *  file = "",
int  line = -1 
)
virtual

Add positions for bodies to log.

Parameters
description[in] description of log entry.
positions[in] map of body name to its transform.
file[in] filename where logging is happening.
line[in] the line number of the file where logging is happening.

Reimplemented in ODELogUtil.

◆ addValues()

virtual void addValues ( const std::string &  description,
const std::vector< double > &  values,
const std::vector< std::string > &  labels,
const char *  file = "",
int  line = -1 
)
virtual

Add numeric values.

Parameters
description[in] description of log entry.
values[in] list of values.
labels[in] list of labels with same length as values.
file[in] filename where logging is happening.
line[in] the line number of the file where logging is happening.

◆ addVelocities()

virtual void addVelocities ( const std::string &  description,
const std::map< std::string, rw::math::VelocityScrew6D<>> &  velocities,
const char *  file = "",
int  line = -1 
)
virtual

Add velocities for bodies to log.

Parameters
description[in] description of log entry.
velocities[in] map of body name to its velocity.
file[in] filename where logging is happening.
line[in] the line number of the file where logging is happening.

Reimplemented in ODELogUtil.

◆ beginSection()

virtual void beginSection ( const std::string &  name,
const char *  file = "",
int  line = -1 
)
virtual

Add a grouping section.

Parameters
name[in] name of the section.
file[in] filename where logging is happening.
line[in] the line number of the file where logging is happening.

◆ beginStep()

virtual void beginStep ( double  time,
const char *  file = "",
int  line = -1 
)
virtual

Begin a new discrete simulation step.

Parameters
time[in] initial simulation time.
file[in] filename where logging is happening.
line[in] the line number of the file where logging is happening.

◆ doLog()

virtual bool doLog ( ) const
virtual

Check if there is a log to write to.

Returns
true if logging is enabled.

◆ endSection()

virtual void endSection ( int  line = -1)
virtual

End current grouping section.

Parameters
line[in] the line number of the file where logging is happening.

◆ endStep()

virtual void endStep ( double  time,
int  line = -1 
)
virtual

End a discrete simulation step.

Parameters
time[in] simulation time at end of step.
line[in] the line number of the file where logging is happening.

◆ log() [1/2]

virtual std::ostream& log ( const char *  file = "",
int  line = -1 
)
virtual

Log a message.

Parameters
file[in] filename where logging is happening.
line[in] the line number of the file where logging is happening.
Returns
a stream to write longer message to.

◆ log() [2/2]

virtual std::ostream& log ( const std::string &  description,
const char *  file = "",
int  line = -1 
)
virtual

Log a message.

Parameters
description[in] description of log entry.
file[in] filename where logging is happening.
line[in] the line number of the file where logging is happening.
Returns
a stream to write longer message to.

◆ makeScope()

virtual rwsim::log::SimulatorLogScope* makeScope ( const std::string &  name,
const char *  file = "",
int  line = -1 
)
virtual

Make a subscope.

Parameters
name[in] name of scope.
file[in] filename where logging is happening.
line[in] the line number of the file where logging is happening.
Returns
a new log scope.

◆ setSimulatorLog()

virtual void setSimulatorLog ( rw::core::Ptr< rwsim::log::SimulatorLogScope log)
virtual

Set the simulator log to write to.

Parameters
log[in] the base log scope.

The documentation for this class was generated from the following file: