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

Mix in for adding a time stamp, an optional frame id and an optional sequence id to data types like Pose, RangeScan, etc. 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, that does not initialize time or frame id. More...
 
 Stamped (const 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, uint32 iSequenceID=0)
 Same as above, for rvalue reference (move semantics) More...
 
 Stamped (const T &iData, const Time &iTimestamp, const std::string &iFrameID, uint32 iSequenceID=0)
 Constructs the Stamped data from its time stamp, the frame id it belongs to and the actual data. More...
 
 Stamped (T &&iData, const Time &iTimestamp, const std::string &iFrameID, uint32 iSequenceID=0)
 Same as above, for rvalue reference (move semantics) More...
 
template<typename Reflector >
void reflect (Reflector &r)
 
T & value ()
 Returns a read-write reference to the underlying data. More...
 
const T & value () const
 Returns a read-only reference to the underlying data. More...
 
T & internalValueRep ()
 Returns a read-write reference to the underlying data representation. More...
 
const T & internalValueRep () const
 Returns a read-only reference to the underlying data representation. 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 >

Mix in for adding a time stamp, an optional frame id and an optional sequence id to data types like Pose, RangeScan, etc.

The data is stamped in a temporal and spatial way. The time stamp indicates the moment in time the data was created, measured or computed. The frame id specifies the transformation frame, the data belongs to. The sequence id can be used to track the origin or creator of the data.

class MyClass
{
public:
void foo();
}
Stamped<MyClass> myStampedObject;
myStampedObject.foo();

This class also is specialized for primitive data types. If Stamped is used on primitive types like int, float, etc. it behaves like the StampedPrimitive class.

Stamped<int> myStampedInt;
myStampedInt = 123;
cout << myStampedInt.value;
cout << (int)myStampedInt;

Member Typedef Documentation

◆ value_type

typedef T value_type

Constructor & Destructor Documentation

◆ Stamped() [1/5]

Stamped ( )
inline

Default constructor, that does not initialize time or frame id.

Sets sequence id to 0.

◆ Stamped() [2/5]

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

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

The frame id will be empty, hence the data is not assigned to any transformation frame.

◆ Stamped() [3/5]

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

Same as above, for rvalue reference (move semantics)

◆ Stamped() [4/5]

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

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

◆ Stamped() [5/5]

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

Same as above, for rvalue reference (move semantics)

Member Function Documentation

◆ reflect()

void reflect ( Reflector &  r)
inline

◆ value() [1/2]

T& value ( )
inline

Returns a read-write reference to the underlying data.

◆ value() [2/2]

const T& value ( ) const
inline

Returns a read-only reference to the underlying data.

◆ internalValueRep() [1/2]

T& internalValueRep ( )
inline

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

◆ internalValueRep() [2/2]

const T& internalValueRep ( ) const
inline

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

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: