dart
Public Member Functions | Protected Attributes | List of all members
dart::common::CloneableMap< MapType > Class Template Reference

MapHolder is a templated wrapper class that is used to allow maps of Aspect::State and Aspect::Properties to be handled in a semantically palatable way. More...

#include <Cloneable.hpp>

Inheritance diagram for dart::common::CloneableMap< MapType >:
Inheritance graph
[legend]

Public Member Functions

 CloneableMap ()=default
 Default constructor.
 
 CloneableMap (const CloneableMap &otherStates)
 Copy constructor.
 
 CloneableMap (CloneableMap &&otherStates)
 Move constructor.
 
 CloneableMap (const MapType &otherMap)
 Map-based constructor.
 
 CloneableMap (MapType &&otherMap)
 Map-based move constructor.
 
CloneableMapoperator= (const CloneableMap &otherStates)
 Assignment operator.
 
CloneableMapoperator= (CloneableMap &&otherStates)
 Move assignment operator.
 
CloneableMapoperator= (const MapType &otherMap)
 Map-based assignment operator.
 
CloneableMapoperator= (MapType &&otherMap)
 Map-based move assignment operator.
 
void copy (const CloneableMap &otherMap, bool merge=false)
 Copy the contents of another cloneable map into this one. More...
 
void copy (const MapType &otherMap, bool merge=false)
 Copy the contents of a map into this one. More...
 
void merge (const CloneableMap &otherMap)
 Merge the contents of another cloneable map into this one. More...
 
void merge (const MapType &otherMap)
 Merge the contents of another map into this one. More...
 
MapType & getMap ()
 Get the map that is being held.
 
const MapType & getMap () const
 Get the map that is being held.
 

Protected Attributes

MapType mMap
 A map containing the collection of States for the Aspect.
 

Detailed Description

template<typename MapType>
class dart::common::CloneableMap< MapType >

MapHolder is a templated wrapper class that is used to allow maps of Aspect::State and Aspect::Properties to be handled in a semantically palatable way.

Member Function Documentation

◆ copy() [1/2]

template<typename MapType >
void dart::common::CloneableMap< MapType >::copy ( const CloneableMap< MapType > &  otherMap,
bool  merge = false 
)

Copy the contents of another cloneable map into this one.

If merge is set to false, then any fields in this map which are not present in the other map will be erased; otherwise they will be kept. Setting merge to false will make the contents of this map an exact duplicate of the other map.

◆ copy() [2/2]

template<typename MapType >
void dart::common::CloneableMap< MapType >::copy ( const MapType &  otherMap,
bool  merge = false 
)

Copy the contents of a map into this one.

If merge is set to false, then any fields in this map which are not present in the other map will be erased; otherwise they will be kept. Setting merge to false will make the contents of this map an exact duplicate of the other map.

◆ merge() [1/2]

template<typename MapType >
void dart::common::CloneableMap< MapType >::merge ( const CloneableMap< MapType > &  otherMap)

Merge the contents of another cloneable map into this one.

If there are any entries which both maps have, then the contents of otherMap will take precedence. This is the same as calling copy(otherMap, true).

◆ merge() [2/2]

template<typename MapType >
void dart::common::CloneableMap< MapType >::merge ( const MapType &  otherMap)

Merge the contents of another map into this one.

If there are any entries which both maps have, then the contents of otherMap will take precedence. This is the same as calling copy(otherMap, true).


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