RobWorkProject  21.8.23-
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Stateless Class Reference

interface for a stateless or typically a part stateless class. More...

#include <Stateless.hpp>

Inherited by ControllerModel, Device, Object, SensorModel, SimulatedController, SimulatedSensor, Body, and DynamicDevice.

Public Types

typedef rw::core::Ptr< StatelessPtr
 Smart pointer type for Stateless.
 

Public Member Functions

virtual ~Stateless ()
 destructor
 
virtual void registerIn (State &state)
 initialize this stateless data to a specific state More...
 
virtual void registerIn (StateStructure::Ptr state)
 register this stateless object in a statestructure.
 
virtual void unregister ()
 unregisters all state data of this stateless object
 
StateStructure::Ptr getStateStructure ()
 Get the state structure. More...
 
const StateStructure::Ptr getStateStructure () const
 Get the state structure. More...
 
bool isRegistered ()
 Check if object has registered its state. More...
 

Protected Member Functions

 Stateless ()
 constructor
 
template<class T >
void add (StatelessData< T > &data)
 implementations of sensor should add all their stateless data on initialization
 
void add (StateData *data)
 Add data. More...
 
void add (rw::core::Ptr< StateData > data)
 implementations of sensor should add all their state data on initialization
 

Protected Attributes

bool _registered
 True if object has registered its state.
 
std::vector< rw::core::Ptr< StateData > > _datas
 Data.
 
StateStructure::Ptr _stateStruct
 The state structure.
 

Detailed Description

interface for a stateless or typically a part stateless class.

Member Function Documentation

◆ add()

void add ( StateData data)
inlineprotected

Add data.

Parameters
data[in] data to add.

◆ getStateStructure() [1/2]

StateStructure::Ptr getStateStructure ( )
inline

Get the state structure.

Returns
the state structure.

◆ getStateStructure() [2/2]

const StateStructure::Ptr getStateStructure ( ) const
inline

Get the state structure.

Returns
the state structure.

◆ isRegistered()

bool isRegistered ( )
inline

Check if object has registered its state.

Returns
true if registered, false otherwise.

◆ registerIn()

virtual void registerIn ( State state)
virtual

initialize this stateless data to a specific state

Parameters
state[in] the state in which to register the data.
Note
the data will be registered in the state structure of the state and any copies or other instances of the state will therefore also contain the added states.

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