MIRA
Public Types | Public Member Functions | Public Attributes | List of all members
Stamped< T * > Class Template Reference

Stamped class specialization for polymorphic pointers. More...

#include <utils/Stamped.h>

Inheritance diagram for Stamped< T * >:
Inheritance graph
[legend]

Public Types

typedef T * value_type
 

Public Member Functions

 Stamped ()
 Default constructor, no time is set and data pointer is null. More...
 
 Stamped (T *iData, const Time &iTimestamp, uint32 iSequenceID=0)
 Constructs the Stamped data from its time stamp and the actual data. More...
 
 Stamped (T *iData, const Time &iTimestamp, const std::string &iFrameID, uint32 iSequenceID=0)
 Constructs the Stamped data from its time stamp, the frame id and the actual data. More...
 
template<typename Reflector >
void reflect (Reflector &r)
 
T * value ()
 Returns the underlying pointer. More...
 
const T * value () const
 Returns the underlying pointer as constant pointer. More...
 
 operator const T * () const
 Cast operator that casts this into T. More...
 
 operator T* ()
 Cast operator that casts this into T. More...
 
T * operator= (T *iValue)
 Assignment operator that can assign T to this. More...
 
boost::shared_ptr< Object > & internalValueRep ()
 Returns a read-write reference to the underlying data representation. More...
 
const boost::shared_ptr< Object > & internalValueRep () const
 Returns a read-only reference to the underlying data representation. More...
 
template<typename U >
 operator const Stamped< U * > & () const
 Cast operator that can cast any Stamped<T*> into another Stamped<U*> More...
 
template<typename U >
 operator Stamped< U * > & ()
 Cast operator that can cast any Stamped<T*> into another Stamped<U*> More...
 

Public Attributes

Time timestamp
 The time stamp when the data was obtained. More...
 
std::string frameID
 The unique id of the transform frame that this data is assigned to (if any, otherwise empty) More...
 
uint32 sequenceID
 A user defined sequence ID. More...
 

Detailed Description

template<typename T>
class mira::Stamped< T * >

Stamped class specialization for polymorphic pointers.

This specialization can only be used for pointers of polymorphic classes that are derived from mira::Object. The reason is, that this class internally stores a pointer to mira::Object only and performs a dynamic_cast when the concrete pointer T* is requested. This is necessary to be able to cast a Stamped<Object*> class to any other Stamped<T*> class.

Internally, this class uses a boost::shared_ptr to store the pointer, hence after assigning a pointer to Stamped<T*> it will take ownership of it and handles its destruction.

Member Typedef Documentation

◆ value_type

typedef T* value_type

Constructor & Destructor Documentation

◆ Stamped() [1/3]

Stamped ( )
inline

Default constructor, no time is set and data pointer is null.

◆ Stamped() [2/3]

Stamped ( T *  iData,
const Time iTimestamp,
uint32  iSequenceID = 0 
)
inline

Constructs the Stamped data from its time stamp and the actual data.

◆ Stamped() [3/3]

Stamped ( T *  iData,
const Time iTimestamp,
const std::string &  iFrameID,
uint32  iSequenceID = 0 
)
inline

Constructs the Stamped data from its time stamp, the frame id and the actual data.

Member Function Documentation

◆ reflect()

void reflect ( Reflector &  r)
inline

◆ value() [1/2]

T* value ( )
inline

Returns the underlying pointer.

◆ value() [2/2]

const T* value ( ) const
inline

Returns the underlying pointer as constant pointer.

◆ operator const T *()

operator const T * ( ) const
inline

Cast operator that casts this into T.

◆ operator T*()

operator T* ( )
inline

Cast operator that casts this into T.

◆ operator=()

T* operator= ( T *  iValue)
inline

Assignment operator that can assign T to this.

◆ internalValueRep() [1/2]

boost::shared_ptr<Object>& internalValueRep ( )
inline

Returns a read-write reference to the underlying data representation.

◆ internalValueRep() [2/2]

const boost::shared_ptr<Object>& internalValueRep ( ) const
inline

Returns a read-only reference to the underlying data representation.

◆ operator const Stamped< U * > &()

operator const Stamped< U *> & ( ) const
inline

Cast operator that can cast any Stamped<T*> into another Stamped<U*>

◆ operator Stamped< U * > &()

operator Stamped< U *> & ( )
inline

Cast operator that can cast any Stamped<T*> into another Stamped<U*>

Member Data Documentation

◆ timestamp

Time timestamp
inherited

The time stamp when the data was obtained.

◆ frameID

std::string frameID
inherited

The unique id of the transform frame that this data is assigned to (if any, otherwise empty)

◆ sequenceID

uint32 sequenceID
inherited

A user defined sequence ID.


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