RobWorkProject  23.9.11-
Public Member Functions | List of all members
FrameMap< T > Class Template Reference

a specialized mapping implementation for frames. It uses the internal structure of Frames to provide fast O(1) lookup for mappings from Frame to anything. More...

#include <FrameMap.hpp>

Public Member Functions

 FrameMap (int s=20)
 creates a framemap More...
 
 FrameMap (const T &defaultVal, int s=20)
 creates a framemap with an initial size of s More...
 
void insert (const rw::kinematics::Frame &frame, const T &value)
 inserts a value into the frame map More...
 
bool has (const rw::kinematics::Frame &frame)
 True iff a value for frame has been inserted in the map (or accessed using non-const operator[]).
 
const T & operator[] (const rw::kinematics::Frame &frame) const
 return a reference to the value that is associated with the frame frame. More...
 
T & operator[] (const rw::kinematics::Frame &frame)
 return a reference to the value that is associated with the frame frame More...
 
void erase (const rw::kinematics::Frame &frame)
 Erase an element from the map.
 
void clear ()
 Clear the frame map.
 

Detailed Description

template<class T>
class rw::kinematics::FrameMap< T >

a specialized mapping implementation for frames. It uses the internal structure of Frames to provide fast O(1) lookup for mappings from Frame to anything.

Note
A requirement is that all frames must be registered in the same StateStructure.

Constructor & Destructor Documentation

◆ FrameMap() [1/2]

FrameMap ( int  s = 20)
inline

creates a framemap

Parameters
s[in] the default value of new instances of T

◆ FrameMap() [2/2]

FrameMap ( const T &  defaultVal,
int  s = 20 
)
inline

creates a framemap with an initial size of s

Parameters
s[in] nr of elements of the types T with default value "defaultVal"
defaultVal[in] the default value of new instances of T

Member Function Documentation

◆ insert()

void insert ( const rw::kinematics::Frame frame,
const T &  value 
)
inline

inserts a value into the frame map

Parameters
frame[in] the frame for which the value is to be associated
value[in] the value that is to be associated to the frame

◆ operator[]() [1/2]

T& operator[] ( const rw::kinematics::Frame frame)
inline

return a reference to the value that is associated with the frame frame

If no value has been inserted for frame, then the default value of T is inserted in the map and returned.

Parameters
frame[in] the frame for which to find its associated values.
Returns
reference to the value associated to frame.

◆ operator[]() [2/2]

const T& operator[] ( const rw::kinematics::Frame frame) const
inline

return a reference to the value that is associated with the frame frame.

If no value has been inserted for frame, then the default value of T is returned. Use has() to see if a value has been stored for frame.

Parameters
frame[in] the frame for which to find its associated values.
Returns
reference to the value associated to frame.

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