RobWorkProject
Classes | Public Types | Public Member Functions | List of all members
SimulatorLogEntry Class Referenceabstract

A leaf log item with no children. More...

#include <SimulatorLogEntry.hpp>

Inherits SimulatorLog.

Inherited by LogCollisionResult, LogConstraints, LogContactSet, LogContactVelocities, LogEquationSystem, LogForceTorque, LogMessage, LogPositions, LogValues, LogVelocities, and RWPELogContactTracking.

Classes

class  Factory
 A factory for a SimulatorLogEntry. This factory also defines an extension point for SimulatorLogEntry. More...
 

Public Types

typedef rw::common::Ptr< SimulatorLogEntryPtr
 Smart pointer type of SimulatorLogEntry.
 
- Public Types inherited from SimulatorLog
typedef rw::common::Ptr< SimulatorLogPtr
 Smart pointer type of SimulatorLog.
 

Public Member Functions

 SimulatorLogEntry (SimulatorLogScope *parent)
 Constructor. More...
 
virtual ~SimulatorLogEntry ()
 Destructor.
 
virtual void read (class rw::common::InputArchive &iarchive, const std::string &id)
 
virtual void write (class rw::common::OutputArchive &oarchive, const std::string &id) const
 
virtual std::size_t children () const
 Get the number of children under this log item. More...
 
virtual bool operator== (const SimulatorLog &b) const
 Check if logs are identical. More...
 
virtual int line () const
 Get the line number in the file where this entry was added. More...
 
virtual void setLine (int line)
 Set the line number where this entry was added. More...
 
virtual std::string getType () const =0
 Get a textual representation of the type of the item. More...
 
virtual std::list< SimulatorLogEntry::PtrgetLinkedEntries () const =0
 Get a list of other entries that this entry is linked to. More...
 
virtual bool autoLink ()=0
 Do automatic linking to other entries. More...
 
virtual SimulatorLogEntry::Ptr createNew (SimulatorLogScope *parent) const =0
 Create a new entry of the same type (no data is copied). More...
 
- Public Member Functions inherited from SimulatorLog
 SimulatorLog (SimulatorLogScope *parent=NULL)
 Constructor. More...
 
virtual ~SimulatorLog ()
 Destructor.
 
virtual SimulatorLogScopegetParent () const
 Get the parent of this log item. More...
 
virtual bool operator!= (const SimulatorLog &b) const
 Check if logs are non-identical. More...
 
virtual std::string getFilename () const
 Get the full filename with path for where this log entry was created. More...
 
virtual void setFilename (const std::string &file)
 Set the name of the file where this log entry was created. More...
 
virtual void setFilename (const char *file)
 Set the name of the file where this log entry was created. More...
 
virtual std::string getDescription () const
 Get a string describing this entry. More...
 
virtual void setDescription (const std::string &description)
 Set a very short description of this entry. More...
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 destructor
 

Detailed Description

A leaf log item with no children.

Leaf items can use a linking feature, to avoid too much redundant information. Linking should always be done using the autoLink function, which will search backwards in the current scope for a correct entry type to link with. If none is found, parent scopes are searched in the same way until the base scope is reached.

If for instance a velocity is to be logged, there should be a relevant position log entry previous to this velocity entry. This is important for visualization purposes, to know where vectors act.

Constructor & Destructor Documentation

◆ SimulatorLogEntry()

Constructor.

Note
This item will not be added as a child to the parent scope using this constructor.
Parameters
parentthe parent of this log item.

Member Function Documentation

◆ autoLink()

virtual bool autoLink ( )
pure virtual

◆ children()

virtual std::size_t children ( ) const
virtual

Get the number of children under this log item.

Returns
the number of children.

Implements SimulatorLog.

◆ createNew()

virtual SimulatorLogEntry::Ptr createNew ( SimulatorLogScope parent) const
pure virtual

Create a new entry of the same type (no data is copied).

Parameters
parentthe parent of the new entry.
Returns
the new entry.

Implemented in LogCollisionResult, LogEquationSystem, LogVelocities, LogConstraints, LogContactVelocities, LogContactSet, LogPositions, RWPELogContactTracking, LogForceTorque, LogMessage, LogValues, LogConstraintForceTorque, and LogContactForceTorque.

◆ getLinkedEntries()

virtual std::list<SimulatorLogEntry::Ptr> getLinkedEntries ( ) const
pure virtual

Get a list of other entries that this entry is linked to.

Using linked entries makes it possible to avoid logging too much redundant information.

Returns
a list of linked entries.

Implemented in LogCollisionResult, LogEquationSystem, LogVelocities, LogConstraints, LogContactVelocities, LogContactSet, LogPositions, RWPELogContactTracking, LogForceTorque, LogMessage, LogValues, LogConstraintForceTorque, and LogContactForceTorque.

◆ getType()

virtual std::string getType ( ) const
pure virtual

Get a textual representation of the type of the item.

Returns
the type of item as a string.

Implements SimulatorLog.

Implemented in LogCollisionResult, LogEquationSystem, LogVelocities, RWPELogContactTracking, LogConstraints, LogContactVelocities, LogContactSet, LogPositions, LogForceTorque, LogMessage, LogValues, LogConstraintForceTorque, and LogContactForceTorque.

◆ line()

virtual int line ( ) const
virtual

Get the line number in the file where this entry was added.

Returns
the line number.

◆ operator==()

virtual bool operator== ( const SimulatorLog b) const
virtual

Check if logs are identical.

Parameters
b[in] other log to compare with.
Returns
true if identical, false otherwise.

Reimplemented from SimulatorLog.

Reimplemented in LogCollisionResult, LogEquationSystem, LogVelocities, LogConstraints, LogContactVelocities, LogContactSet, LogPositions, LogForceTorque, LogMessage, LogValues, LogConstraintForceTorque, and LogContactForceTorque.

◆ read()

virtual void read ( class rw::common::InputArchive iarchive,
const std::string &  id 
)
virtual

Enable read-serialization of inherited class by implementing this method. Data is read from iarchive and filled into this object.

Parameters
iarchive[in] the InputArchive from which to read data.
id[in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

Reimplemented from SimulatorLog.

Reimplemented in LogCollisionResult, LogEquationSystem, LogVelocities, RWPELogContactTracking, LogConstraints, LogContactVelocities, LogContactSet, LogPositions, LogForceTorque, LogMessage, and LogValues.

◆ setLine()

virtual void setLine ( int  line)
virtual

Set the line number where this entry was added.

Parameters
line[in] the line number.

◆ write()

virtual void write ( class rw::common::OutputArchive oarchive,
const std::string &  id 
) const
virtual

Enable write-serialization of inherited class by implementing this method. Data is written to oarchive from this object.

Parameters
oarchive[out] the OutputArchive in which data should be written.
id[in] The id of the serialized sobject.
Note
the id can be empty in which case the overloaded method should provide a default identifier. E.g. the Vector3D class defined "Vector3D" as its default id.

Reimplemented from SimulatorLog.

Reimplemented in LogCollisionResult, LogEquationSystem, LogVelocities, RWPELogContactTracking, LogConstraints, LogContactVelocities, LogContactSet, LogPositions, LogForceTorque, LogMessage, and LogValues.


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