Gazebo Rendering

API Reference

9.0.0
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.
 
virtual bool ContainsKey (const std::string &_key) const =0
 Determine if an elements is mapped to the given key.
 
virtual bool ContainsValue (ConstTPtr _value) const =0
 Determine if the given element exists in this map.
 
virtual TPtr Get (const std::string &_key) const =0
 Get the element mapped to the given key.
 
virtual TPtr GetByIndex (unsigned int _index) const =0
 Get the element at the given index.
 
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.
 
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.
 
virtual void Remove (TPtr _value)=0
 Remove the given element. If the given element does not exist no work will be done.
 
virtual void RemoveAll ()=0
 Remove all elements from this map.
 
virtual unsigned int Size () const =0
 Get the number of elements in this map.
 

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()

template<class T >
virtual ~Map ( )
virtualdefault

Destructor.

Member Function Documentation

◆ ContainsKey()

template<class T >
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 >, and BaseMap< Material, T >.

◆ ContainsValue()

template<class T >
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 >, and BaseMap< Material, T >.

◆ Get()

template<class T >
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 >, and BaseMap< Material, T >.

◆ GetByIndex()

template<class T >
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 >, and BaseMap< Material, T >.

◆ Put()

template<class T >
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 >, and BaseMap< Material, T >.

◆ Remove() [1/2]

template<class T >
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 >, and BaseMap< Material, T >.

◆ Remove() [2/2]

template<class T >
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 >, and BaseMap< Material, T >.

◆ RemoveAll()

template<class T >
virtual void RemoveAll ( )
pure virtual

Remove all elements from this map.

Implemented in BaseMap< T, U >, and BaseMap< Material, T >.

◆ Size()

template<class T >
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 >, and BaseMap< Material, T >.


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