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
 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() [1/2]

State ( )

Default constructor.

§ State() [2/2]

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.

§ ~State()

virtual ~State ( )
virtual

Destructor.

Member Function Documentation

§ GetIterations()

uint64_t GetIterations ( ) const

Get the iterations when this state was generated.

Returns
Iterations when the data was recorded

§ GetName()

std::string GetName ( ) const

Get the name associated with this State.

Returns
Name associated with this state information. Typically a name of an Entity.

§ GetRealTime()

common::Time GetRealTime ( ) const

Get the real time when this state was generated.

Returns
Clock time since simulation was stated.

§ GetSimTime()

common::Time GetSimTime ( ) const

Get the sim time when this state was generated.

Returns
Simulation time when the data was recorded.

§ GetWallTime()

common::Time GetWallTime ( ) const

Get the wall time when this state was generated.

Returns
The absolute clock time when the State data was recorded.

§ Load()

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 LinkState, ModelState, JointState, WorldState, CollisionState, and LightState.

§ operator-()

State operator- ( const State _state) const

Subtraction operator.

Parameters
[in]_ptA state to substract.
Returns
The resulting state.

§ operator=()

State& operator= ( const State _state)

Assignment operator.

Parameters
[in]_stateState value
Returns
this

§ SetIterations()

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, WorldState, and LinkState.

§ SetName()

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.

§ SetRealTime()

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, WorldState, and LinkState.

§ SetSimTime()

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, WorldState, and LinkState.

§ SetWallTime()

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, WorldState, and LinkState.

Member Data Documentation

§ iterations

uint64_t iterations
protected

The number of simulation iterations when this state was generated.

§ name

std::string name
protected

Name associated with this State.

§ realTime

common::Time realTime
protected

§ simTime

common::Time simTime
protected

§ wallTime

common::Time wallTime
protected

Times for the state data.


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