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. More... | |
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. More... | |
virtual bool | Contains (ConstTPtr _object) const =0 |
Determine if store contains the given element. More... | |
virtual bool | ContainsId (unsigned int _id) const =0 |
Determine if store contains the element with the given ID. More... | |
virtual bool | ContainsName (const std::string &_name) const =0 |
Determine if store contains the element with the given name. More... | |
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. More... | |
virtual void | DestroyAll ()=0 |
Remove and destroy all elements in store. More... | |
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. More... | |
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. More... | |
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. More... | |
virtual TPtr | GetById (unsigned int _id) const =0 |
Get element with the given ID. More... | |
virtual TPtr | GetByIndex (unsigned int _index) const =0 |
Get element at the given index. More... | |
virtual TPtr | GetByName (const std::string &_name) const =0 |
Get element with the given name. More... | |
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. More... | |
virtual void | RemoveAll ()=0 |
Remove all elements from store. More... | |
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. More... | |
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. More... | |
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. More... | |
virtual unsigned int | Size () const =0 |
Get number of elements in this store. More... | |
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
-
T The storage element type
Constructor & Destructor Documentation
◆ ~Store()
|
virtualdefault |
Destructor.
Member Function Documentation
◆ Add()
|
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] _object Element to be added
- Returns
- True if successful
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ Contains()
|
pure virtual |
Determine if store contains the given element.
- Parameters
-
[in] _object The element in question
- Returns
- True if this store contains the given element
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ ContainsId()
|
pure virtual |
Determine if store contains the element with the given ID.
- Parameters
-
[in] _id ID of the element in question
- Returns
- True if this store contains the specified element
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ ContainsName()
|
pure virtual |
Determine if store contains the element with the given name.
- Parameters
-
[in] _name Name of the element in question
- Returns
- True if this store contains the specified element
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ Destroy()
|
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] _object Element to be removed
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ DestroyAll()
|
pure virtual |
Remove and destroy all elements in store.
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ DestroyById()
|
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] _id ID of the element to be removed
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ DestroyByIndex()
|
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] _index Index of the element to be removed
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ DestroyByName()
|
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] _name Name of the element to be removed
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ GetById()
|
pure virtual |
Get element with the given ID.
- Parameters
-
[in] _id ID of the desired element
- Returns
- The specified element
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ GetByIndex()
|
pure virtual |
Get element at the given index.
- Parameters
-
[in] _index Index of the desired element
- Returns
- The specified element
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ GetByName()
|
pure virtual |
Get element with the given name.
- Parameters
-
[in] _name Name of the desired element
- Returns
- The specified element
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ Remove()
Remove given element. If the given element does not exists in this store, then no work will be done.
- Parameters
-
[in] _object Element to be removed
- Returns
- The removed element
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ RemoveAll()
|
pure virtual |
Remove all elements from store.
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ RemoveById()
|
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] _id ID of the element to be removed
- Returns
- The removed element
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ RemoveByIndex()
|
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] _index Index of the element to be removed
- Returns
- The removed element
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ RemoveByName()
|
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] _name Name of the element to be removed
- Returns
- The removed element
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
◆ Size()
|
pure virtual |
Get number of elements in this store.
- Returns
- The number of elements in this store
Implemented in BaseStoreWrapper< T, U >, BaseCompositeStore< T >, BaseCompositeStore< Node >, and BaseStore< T, U >.
The documentation for this class was generated from the following file: