State Class Reference

State of an entity. More...

#include <physics/physics.hh>

Inherited by CollisionState, JointState, LightState, LinkState, ModelState, and WorldState.

Public Member Functions

 State ()
 Default constructor. More...
 
 State (const std::string &_name, const common::Time &_realTime, const common::Time &_simTime, const uint64_t _iterations)
 Constructor. More...
 
virtual ~State ()
 Destructor. More...
 
uint64_t GetIterations () const
 Get the iterations when this state was generated. More...
 
std::string GetName () const
 Get the name associated with this State. More...
 
common::Time GetRealTime () const
 Get the real time when this state was generated. More...
 
common::Time GetSimTime () const
 Get the sim time when this state was generated. More...
 
common::Time GetWallTime () const
 Get the wall time when this state was generated. More...
 
virtual void Load (const sdf::ElementPtr _elem)
 Load state from SDF element. More...
 
State operator- (const State &_state) const
 Subtraction operator. More...
 
Stateoperator= (const State &_state)
 Assignment operator. More...
 
virtual void SetIterations (const uint64_t _iterations)
 Set the iterations when this state was generated. More...
 
void SetName (const std::string &_name)
 Set the name associated with this State. More...
 
virtual void SetRealTime (const common::Time &_time)
 Set the real time when this state was generated. More...
 
virtual void SetSimTime (const common::Time &_time)
 Set the sim time when this state was generated. More...
 
virtual void SetWallTime (const common::Time &_time)
 Set the wall time when this state was generated. More...
 

Protected Attributes

uint64_t iterations = 0
 The number of simulation iterations when this state was generated. More...
 
std::string name
 Name associated with this State. More...
 
common::Time realTime
 
common::Time simTime
 
common::Time wallTime
 Times for the state data. More...
 

Detailed Description

State of an entity.

This is the base class for all State information.

Constructor & Destructor Documentation

State ( )

Default constructor.

State ( const std::string &  _name,
const common::Time _realTime,
const common::Time _simTime,
const uint64_t  _iterations 
)

Constructor.

Construct a State object using some basic information.

Parameters
_nameName associated with the State information. This is typically the name of an Entity.
_realTimeClock time since simulation started.
_simTimeSimulation time associated with this State info.
_iterationsSimulation iterations since simulation started.
virtual ~State ( )
virtual

Destructor.

Member Function Documentation

uint64_t GetIterations ( ) const

Get the iterations when this state was generated.

Returns
Iterations when the data was recorded
std::string GetName ( ) const

Get the name associated with this State.

Returns
Name associated with this state information. Typically a name of an Entity.
common::Time GetRealTime ( ) const

Get the real time when this state was generated.

Returns
Clock time since simulation was stated.
common::Time GetSimTime ( ) const

Get the sim time when this state was generated.

Returns
Simulation time when the data was recorded.
common::Time GetWallTime ( ) const

Get the wall time when this state was generated.

Returns
The absolute clock time when the State data was recorded.
virtual void Load ( const sdf::ElementPtr  _elem)
virtual

Load state from SDF element.

Populates the State information from data stored in an SDF::Element

Parameters
_elemPointer to the SDF::Element

Reimplemented in ModelState, LinkState, JointState, WorldState, CollisionState, and LightState.

State operator- ( const State _state) const

Subtraction operator.

Parameters
[in]_ptA state to substract.
Returns
The resulting state.
State& operator= ( const State _state)

Assignment operator.

Parameters
[in]_stateState value
Returns
this
virtual void SetIterations ( const uint64_t  _iterations)
virtual

Set the iterations when this state was generated.

Parameters
[in]_iterationsIterations when the data was recorded.

Reimplemented in ModelState, LinkState, and WorldState.

void SetName ( const std::string &  _name)

Set the name associated with this State.

Parameters
[in]_nameName associated with this state information. Typically the name of an Entity.
virtual void SetRealTime ( const common::Time _time)
virtual

Set the real time when this state was generated.

Parameters
[in]_timeClock time since simulation was stated.

Reimplemented in ModelState, LinkState, and WorldState.

virtual void SetSimTime ( const common::Time _time)
virtual

Set the sim time when this state was generated.

Parameters
[in]_timeSimulation time when the data was recorded.

Reimplemented in ModelState, LinkState, and WorldState.

virtual void SetWallTime ( const common::Time _time)
virtual

Set the wall time when this state was generated.

Parameters
[in]_timeThe absolute clock time when the State data was recorded.

Reimplemented in ModelState, LinkState, and WorldState.

Member Data Documentation

uint64_t iterations = 0
protected

The number of simulation iterations when this state was generated.

std::string name
protected

Name associated with this State.

common::Time realTime
protected
common::Time simTime
protected
common::Time wallTime
protected

Times for the state data.


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