DART  6.7.3
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 >:
dart::common::detail::CompositeData< MapType, GetData >

Public Member Functions

 CloneableMap ()=default
 Default constructor. More...
 
 CloneableMap (const CloneableMap &otherStates)
 Copy constructor. More...
 
 CloneableMap (CloneableMap &&otherStates)
 Move constructor. More...
 
 CloneableMap (const MapType &otherMap)
 Map-based constructor. More...
 
 CloneableMap (MapType &&otherMap)
 Map-based move constructor. More...
 
CloneableMapoperator= (const CloneableMap &otherStates)
 Assignment operator. More...
 
CloneableMapoperator= (CloneableMap &&otherStates)
 Move assignment operator. More...
 
CloneableMapoperator= (const MapType &otherMap)
 Map-based assignment operator. More...
 
CloneableMapoperator= (MapType &&otherMap)
 Map-based move assignment operator. More...
 
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. More...
 
const MapType & getMap () const
 Get the map that is being held. More...
 

Protected Attributes

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

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.

Constructor & Destructor Documentation

◆ CloneableMap() [1/5]

template<typename MapType >
dart::common::CloneableMap< MapType >::CloneableMap ( )
default

Default constructor.

◆ CloneableMap() [2/5]

template<typename MapType >
dart::common::CloneableMap< MapType >::CloneableMap ( const CloneableMap< MapType > &  otherStates)

Copy constructor.

◆ CloneableMap() [3/5]

template<typename MapType >
dart::common::CloneableMap< MapType >::CloneableMap ( CloneableMap< MapType > &&  otherStates)

Move constructor.

◆ CloneableMap() [4/5]

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

Map-based constructor.

◆ CloneableMap() [5/5]

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

Map-based move constructor.

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.

◆ getMap() [1/2]

template<typename MapType >
MapType & dart::common::CloneableMap< MapType >::getMap

Get the map that is being held.

◆ getMap() [2/2]

template<typename MapType >
const MapType & dart::common::CloneableMap< MapType >::getMap

Get the map that is being held.

◆ 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).

◆ operator=() [1/4]

template<typename MapType >
CloneableMap< MapType > & dart::common::CloneableMap< MapType >::operator= ( CloneableMap< MapType > &&  otherStates)

Move assignment operator.

◆ operator=() [2/4]

template<typename MapType >
CloneableMap< MapType > & dart::common::CloneableMap< MapType >::operator= ( const CloneableMap< MapType > &  otherStates)

Assignment operator.

◆ operator=() [3/4]

template<typename MapType >
CloneableMap< MapType > & dart::common::CloneableMap< MapType >::operator= ( const MapType &  otherMap)

Map-based assignment operator.

◆ operator=() [4/4]

template<typename MapType >
CloneableMap< MapType > & dart::common::CloneableMap< MapType >::operator= ( MapType &&  otherMap)

Map-based move assignment operator.

Member Data Documentation

◆ mMap

template<typename MapType >
MapType dart::common::CloneableMap< MapType >::mMap
protected

A map containing the collection of States for the Aspect.