RobWorkProject  23.9.11-
Public Types | Public Member Functions | List of all members
SimulatorLogScope Class Reference

A scope can have children, and the type allows hierarchical logging. More...

#include <SimulatorLogScope.hpp>

Inherits SimulatorLog.

Inherited by LogStep.

Public Types

typedef rw::core::Ptr< SimulatorLogScopePtr
 Smart pointer type of SimulatorLogScope.
 
- Public Types inherited from SimulatorLog
typedef rw::core::Ptr< SimulatorLogPtr
 Smart pointer type of SimulatorLog.
 
typedef rw::core::Ptr< const SimulatorLogCPtr
 Smart pointer type of const SimulatorLog.
 

Public Member Functions

 SimulatorLogScope (SimulatorLogScope *parent=NULL)
 Constructor. More...
 
virtual ~SimulatorLogScope ()
 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 std::string getType () const
 Get a textual representation of the type of the item. More...
 
virtual bool operator== (const SimulatorLog &b) const
 Check if logs are identical. More...
 
std::vector< SimulatorLog::PtrgetChildren () const
 Get the children of this scope. More...
 
SimulatorLog::Ptr getChild (std::size_t id) const
 Get a specific child item. More...
 
std::size_t indexOf (const SimulatorLog *child) const
 Get the id of a specific log item that is known to be a child. More...
 
void appendChild (SimulatorLog::Ptr child)
 Add a child to this scope. More...
 
rw::core::Ptr< const SimulatorStatisticsgetStatistics ()
 Get statistics for this scope. More...
 
virtual int lineBegin () const
 Get the line in the file where this scope begins. More...
 
virtual int lineEnd () const
 Get the line in the file where this scope ends. More...
 
virtual void setLineBegin (int line)
 Set the line in the file where this scope begins. More...
 
virtual void setLineEnd (int line)
 Set the line in the file where this scope ends. 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 scope can have children, and the type allows hierarchical logging.

A scope can have one SimulatorStatistics object attached to it. SimulatorStatistics is a special method for doing statistics on a SimulatorLog. Please see this class for information about how this is done.

Constructor & Destructor Documentation

◆ SimulatorLogScope()

SimulatorLogScope ( SimulatorLogScope parent = NULL)

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

◆ appendChild()

void appendChild ( SimulatorLog::Ptr  child)

Add a child to this scope.

Parameters
childthe child to add.

◆ children()

virtual std::size_t children ( ) const
virtual

Get the number of children under this log item.

Returns
the number of children.

Implements SimulatorLog.

◆ getChild()

SimulatorLog::Ptr getChild ( std::size_t  id) const

Get a specific child item.

Parameters
id[in] the id of the child.
Returns
the child item (or NULL if not found).

◆ getChildren()

std::vector<SimulatorLog::Ptr> getChildren ( ) const

Get the children of this scope.

Returns
a vector of children log items.

◆ getStatistics()

rw::core::Ptr<const SimulatorStatistics> getStatistics ( )

Get statistics for this scope.

Returns
the statistics.

◆ getType()

virtual std::string getType ( ) const
virtual

Get a textual representation of the type of the item.

Returns
the type of item as a string.

Implements SimulatorLog.

Reimplemented in LogStep.

◆ indexOf()

std::size_t indexOf ( const SimulatorLog child) const

Get the id of a specific log item that is known to be a child.

Parameters
child[in] the child item to search for.
Returns
the index of the child (or the number of children if not found).

◆ lineBegin()

virtual int lineBegin ( ) const
virtual

Get the line in the file where this scope begins.

Returns
the first line.

◆ lineEnd()

virtual int lineEnd ( ) const
virtual

Get the line in the file where this scope ends.

Returns
the last line.

◆ 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 LogStep.

◆ 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 LogStep.

◆ setLineBegin()

virtual void setLineBegin ( int  line)
virtual

Set the line in the file where this scope begins.

Parameters
line[in] the first line.

◆ setLineEnd()

virtual void setLineEnd ( int  line)
virtual

Set the line in the file where this scope ends.

Parameters
line[in] the last line.

◆ 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 LogStep.


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