Gazebo Rendering

API Reference

9.0.0~pre2
Store< T > Class Template Referenceabstract

Multi-access storage structure of template class T. Template class T is expected to have functions GetId, GetName(), Destroy() which return unsigned int, std::string, and void respectively. This store will ensure that each element's name and ID are unique. More...

#include <gz/rendering/Storage.hh>

Public Member Functions

virtual ~Store ()=default
 Destructor.
 
virtual bool Add (TPtr _object)=0
 Add given element. If the element has already been added or its name or ID conflict with other existing elements, then no work will be done.
 
virtual bool Contains (ConstTPtr _object) const =0
 Determine if store contains the given element.
 
virtual bool ContainsId (unsigned int _id) const =0
 Determine if store contains the element with the given ID.
 
virtual bool ContainsName (const std::string &_name) const =0
 Determine if store contains the element with the given name.
 
virtual void Destroy (TPtr _object)=0
 Remove and destroy given element. If the given element does not exists, in this store, then no work will be done.
 
virtual void DestroyAll ()=0
 Remove and destroy all elements in store.
 
virtual void DestroyById (unsigned int _id)=0
 Remove and destroy element with the given ID. If the specified element does not exists in this store, then no work will be done.
 
virtual void DestroyByIndex (unsigned int _index)=0
 Remove and destroy element at the given index. If the specified element does not exists in this store, then no work will be done.
 
virtual void DestroyByName (const std::string &_name)=0
 Remove and destroy element with the given name. If the specified element does not exists in this store, then no work will be done.
 
virtual TPtr GetById (unsigned int _id) const =0
 Get element with the given ID.
 
virtual TPtr GetByIndex (unsigned int _index) const =0
 Get element at the given index.
 
virtual TPtr GetByName (const std::string &_name) const =0
 Get element with the given name.
 
virtual TPtr Remove (TPtr _object)=0
 Remove given element. If the given element does not exists in this store, then no work will be done.
 
virtual void RemoveAll ()=0
 Remove all elements from store.
 
virtual TPtr RemoveById (unsigned int _id)=0
 Remove element with the given ID. If the specified element does not exists in this store, then no work will be done.
 
virtual TPtr RemoveByIndex (unsigned int _index)=0
 Remove element at the given index. If the specified element does not exists in this store, then no work will be done.
 
virtual TPtr RemoveByName (const std::string &_name)=0
 Remove element with the given name. If the specified element does not exists in this store, then no work will be done.
 
virtual unsigned int Size () const =0
 Get number of elements in this store.
 

Detailed Description

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

Multi-access storage structure of template class T. Template class T is expected to have functions GetId, GetName(), Destroy() which return unsigned int, std::string, and void respectively. This store will ensure that each element's name and ID are unique.

Template Parameters
TThe storage element type

Constructor & Destructor Documentation

◆ ~Store()

template<class T >
virtual ~Store ( )
virtualdefault

Destructor.

Member Function Documentation

◆ Add()

template<class T >
virtual bool Add ( TPtr  _object)
pure virtual

Add given element. If the element has already been added or its name or ID conflict with other existing elements, then no work will be done.

Parameters
[in]_objectElement to be added
Returns
True if successful

Implemented in BaseStore< T, U >, BaseStore< Geometry, T >, BaseStore< Light, T >, BaseStore< Node, T >, BaseStore< Scene, T >, BaseStore< Sensor, T >, BaseStore< SubMesh, T >, BaseStore< Visual, T >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStoreWrapper< T, U >.

◆ Contains()

template<class T >
virtual bool Contains ( ConstTPtr  _object) const
pure virtual

Determine if store contains the given element.

Parameters
[in]_objectThe element in question
Returns
True if this store contains the given element

Implemented in BaseStore< T, U >, BaseStore< Geometry, T >, BaseStore< Light, T >, BaseStore< Node, T >, BaseStore< Scene, T >, BaseStore< Sensor, T >, BaseStore< SubMesh, T >, BaseStore< Visual, T >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStoreWrapper< T, U >.

◆ ContainsId()

template<class T >
virtual bool ContainsId ( unsigned int  _id) const
pure virtual

Determine if store contains the element with the given ID.

Parameters
[in]_idID of the element in question
Returns
True if this store contains the specified element

Implemented in BaseStore< T, U >, BaseStore< Geometry, T >, BaseStore< Light, T >, BaseStore< Node, T >, BaseStore< Scene, T >, BaseStore< Sensor, T >, BaseStore< SubMesh, T >, BaseStore< Visual, T >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStoreWrapper< T, U >.

◆ ContainsName()

template<class T >
virtual bool ContainsName ( const std::string _name) const
pure virtual

Determine if store contains the element with the given name.

Parameters
[in]_nameName of the element in question
Returns
True if this store contains the specified element

Implemented in BaseStore< T, U >, BaseStore< Geometry, T >, BaseStore< Light, T >, BaseStore< Node, T >, BaseStore< Scene, T >, BaseStore< Sensor, T >, BaseStore< SubMesh, T >, BaseStore< Visual, T >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStoreWrapper< T, U >.

◆ Destroy()

template<class T >
virtual void Destroy ( TPtr  _object)
pure virtual

Remove and destroy given element. If the given element does not exists, in this store, then no work will be done.

Parameters
[in]_objectElement to be removed

Implemented in BaseStore< T, U >, BaseStore< Geometry, T >, BaseStore< Light, T >, BaseStore< Node, T >, BaseStore< Scene, T >, BaseStore< Sensor, T >, BaseStore< SubMesh, T >, BaseStore< Visual, T >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStoreWrapper< T, U >.

◆ DestroyAll()

◆ DestroyById()

template<class T >
virtual void DestroyById ( unsigned int  _id)
pure virtual

Remove and destroy element with the given ID. If the specified element does not exists in this store, then no work will be done.

Parameters
[in]_idID of the element to be removed

Implemented in BaseStore< T, U >, BaseStore< Geometry, T >, BaseStore< Light, T >, BaseStore< Node, T >, BaseStore< Scene, T >, BaseStore< Sensor, T >, BaseStore< SubMesh, T >, BaseStore< Visual, T >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStoreWrapper< T, U >.

◆ DestroyByIndex()

template<class T >
virtual void DestroyByIndex ( unsigned int  _index)
pure virtual

Remove and destroy element at the given index. If the specified element does not exists in this store, then no work will be done.

Parameters
[in]_indexIndex of the element to be removed

Implemented in BaseStore< T, U >, BaseStore< Geometry, T >, BaseStore< Light, T >, BaseStore< Node, T >, BaseStore< Scene, T >, BaseStore< Sensor, T >, BaseStore< SubMesh, T >, BaseStore< Visual, T >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStoreWrapper< T, U >.

◆ DestroyByName()

template<class T >
virtual void DestroyByName ( const std::string _name)
pure virtual

Remove and destroy element with the given name. If the specified element does not exists in this store, then no work will be done.

Parameters
[in]_nameName of the element to be removed

Implemented in BaseStore< T, U >, BaseStore< Geometry, T >, BaseStore< Light, T >, BaseStore< Node, T >, BaseStore< Scene, T >, BaseStore< Sensor, T >, BaseStore< SubMesh, T >, BaseStore< Visual, T >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStoreWrapper< T, U >.

◆ GetById()

template<class T >
virtual TPtr GetById ( unsigned int  _id) const
pure virtual

◆ GetByIndex()

template<class T >
virtual TPtr GetByIndex ( unsigned int  _index) const
pure virtual

◆ GetByName()

template<class T >
virtual TPtr GetByName ( const std::string _name) const
pure virtual

◆ Remove()

template<class T >
virtual TPtr Remove ( TPtr  _object)
pure virtual

Remove given element. If the given element does not exists in this store, then no work will be done.

Parameters
[in]_objectElement to be removed
Returns
The removed element

Implemented in BaseStore< T, U >, BaseStore< Geometry, T >, BaseStore< Light, T >, BaseStore< Node, T >, BaseStore< Scene, T >, BaseStore< Sensor, T >, BaseStore< SubMesh, T >, BaseStore< Visual, T >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStoreWrapper< T, U >.

◆ RemoveAll()

◆ RemoveById()

template<class T >
virtual TPtr RemoveById ( unsigned int  _id)
pure virtual

Remove element with the given ID. If the specified element does not exists in this store, then no work will be done.

Parameters
[in]_idID of the element to be removed
Returns
The removed element

Implemented in BaseStore< T, U >, BaseStore< Geometry, T >, BaseStore< Light, T >, BaseStore< Node, T >, BaseStore< Scene, T >, BaseStore< Sensor, T >, BaseStore< SubMesh, T >, BaseStore< Visual, T >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStoreWrapper< T, U >.

◆ RemoveByIndex()

template<class T >
virtual TPtr RemoveByIndex ( unsigned int  _index)
pure virtual

Remove element at the given index. If the specified element does not exists in this store, then no work will be done.

Parameters
[in]_indexIndex of the element to be removed
Returns
The removed element

Implemented in BaseStore< T, U >, BaseStore< Geometry, T >, BaseStore< Light, T >, BaseStore< Node, T >, BaseStore< Scene, T >, BaseStore< Sensor, T >, BaseStore< SubMesh, T >, BaseStore< Visual, T >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStoreWrapper< T, U >.

◆ RemoveByName()

template<class T >
virtual TPtr RemoveByName ( const std::string _name)
pure virtual

Remove element with the given name. If the specified element does not exists in this store, then no work will be done.

Parameters
[in]_nameName of the element to be removed
Returns
The removed element

Implemented in BaseStore< T, U >, BaseStore< Geometry, T >, BaseStore< Light, T >, BaseStore< Node, T >, BaseStore< Scene, T >, BaseStore< Sensor, T >, BaseStore< SubMesh, T >, BaseStore< Visual, T >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStoreWrapper< T, U >.

◆ Size()

template<class T >
virtual unsigned int Size ( ) const
pure virtual

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