Gazebo Rendering

API Reference

7.4.2
Map< T > Class Template Referenceabstract

Storage map from std::string to template class T. More...

#include <gz/rendering/Storage.hh>

Public Member Functions

virtual ~Map ()=default
 Destructor. More...
 
virtual bool ContainsKey (const std::string &_key) const =0
 Determine if an elements is mapped to the given key. More...
 
virtual bool ContainsValue (ConstTPtr _value) const =0
 Determine if the given element exists in this map. More...
 
virtual TPtr Get (const std::string &_key) const =0
 Get the element mapped to the given key. More...
 
virtual TPtr GetByIndex (unsigned int _index) const =0
 Get the element at the given index. More...
 
virtual bool Put (const std::string &_key, TPtr _value)=0
 Map to given element to the given key. If the given key is already in use, no work will be done. More...
 
virtual void Remove (const std::string &_key)=0
 Remove the element mapped to the given key. If the specified element does not exists, no work will be done. More...
 
virtual void Remove (TPtr _value)=0
 Remove the given element. If the given element does not exist no work will be done. More...
 
virtual void RemoveAll ()=0
 Remove all elements from this map. More...
 
virtual unsigned int Size () const =0
 Get the number of elements in this map. More...
 

Detailed Description

template<class T>
class gz::rendering::Map< T >

Storage map from std::string to template class T.

Template Parameters
TThe storage element type

Constructor & Destructor Documentation

◆ ~Map()

virtual ~Map ( )
virtualdefault

Destructor.

Member Function Documentation

◆ ContainsKey()

virtual bool ContainsKey ( const std::string _key) const
pure virtual

Determine if an elements is mapped to the given key.

Parameters
[in]_keyKey of the element in question
Returns
True if an elements is mapped to the given key

Implemented in BaseMap< T, U >.

◆ ContainsValue()

virtual bool ContainsValue ( ConstTPtr  _value) const
pure virtual

Determine if the given element exists in this map.

Parameters
[in]_valueElement in question
Returns
True if the given element exists in this map

Implemented in BaseMap< T, U >.

◆ Get()

virtual TPtr Get ( const std::string _key) const
pure virtual

Get the element mapped to the given key.

Parameters
[in]_keyKey of the element in question
Returns
The element mapped to the given key

Implemented in BaseMap< T, U >.

◆ GetByIndex()

virtual TPtr GetByIndex ( unsigned int  _index) const
pure virtual

Get the element at the given index.

Parameters
[in]_indexIndex of the element in question
Returns
The element at the given index

Implemented in BaseMap< T, U >.

◆ Put()

virtual bool Put ( const std::string _key,
TPtr  _value 
)
pure virtual

Map to given element to the given key. If the given key is already in use, no work will be done.

Parameters
[in]_keyKey of the new element
[in]_valueElement to be mapped
Returns
True if successful

Implemented in BaseMap< T, U >.

◆ Remove() [1/2]

virtual void Remove ( const std::string _key)
pure virtual

Remove the element mapped to the given key. If the specified element does not exists, no work will be done.

Parameters
[in]_keyKey of the element in question

Implemented in BaseMap< T, U >.

◆ Remove() [2/2]

virtual void Remove ( TPtr  _value)
pure virtual

Remove the given element. If the given element does not exist no work will be done.

Parameters
[in]_valueKey of the element in question

Implemented in BaseMap< T, U >.

◆ RemoveAll()

virtual void RemoveAll ( )
pure virtual

Remove all elements from this map.

Implemented in BaseMap< T, U >.

◆ Size()

virtual unsigned int Size ( ) const
pure virtual

Get the number of elements in this map.

Returns
The number of elements in this map

Implemented in BaseMap< T, U >.


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