#include <BaseStorage.hh>
Public Member Functions | |
BaseStore () | |
virtual | ~BaseStore () |
virtual bool | Add (TPtr _object) |
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 | AddDerived (UPtr _object) |
virtual UIter | Begin () |
Return an iterator to the beginning. | |
virtual bool | Contains (ConstTPtr _object) const |
Determine if store contains the given element. | |
virtual bool | ContainsId (unsigned int _id) const |
Determine if store contains the element with the given ID. | |
virtual bool | ContainsName (const std::string &_name) const |
Determine if store contains the element with the given name. | |
virtual UPtr | DerivedById (unsigned int _id) const |
virtual UPtr | DerivedByIndex (unsigned int _index) const |
virtual UPtr | DerivedByName (const std::string &_name) const |
virtual void | Destroy (TPtr _object) |
Remove and destroy given element. If the given element does not exists, in this store, then no work will be done. | |
virtual void | DestroyAll () |
Remove and destroy all elements in store. | |
virtual void | DestroyById (unsigned int _id) |
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) |
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) |
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 UIter | End () |
Return an iterator to the end. | |
virtual TPtr | GetById (unsigned int _id) const |
Get element with the given ID. | |
virtual TPtr | GetByIndex (unsigned int _index) const |
Get element at the given index. | |
virtual TPtr | GetByName (const std::string &_name) const |
Get element with the given name. | |
virtual TPtr | Remove (TPtr _object) |
Remove given element. If the given element does not exists in this store, then no work will be done. | |
virtual void | RemoveAll () |
Remove all elements from store. | |
virtual TPtr | RemoveById (unsigned int _id) |
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) |
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) |
Remove element with the given name. If the specified element does not exists in this store, then no work will be done. | |
virtual UPtr | RemoveDerived (UPtr _object) |
virtual UPtr | RemoveDerivedById (unsigned int _id) |
virtual UPtr | RemoveDerivedByIndex (unsigned int _index) |
virtual UPtr | RemoveDerivedByName (const std::string &_name) |
virtual unsigned int | Size () const |
Get number of elements in this store. | |
![]() | |
virtual | ~Store ()=default |
Destructor. | |
Protected Member Functions | |
virtual bool | AddImpl (UPtr _object) |
virtual ConstUIter | ConstIter (ConstTPtr _object) const |
Get a const iterator to the object by pointer. Note that the iterator may change or become invalid when objects are added to / removed from the store. | |
virtual ConstUIter | ConstIterById (unsigned int _id) const |
Get a const iterator to the object by id. Note that the iterator may change or become invalid when objects are added to / removed from the store. | |
virtual ConstUIter | ConstIterByIndex (unsigned int _index) const |
Get a const iterator to the object by index. Note that the iterator may change or become invalid when objects are added to / removed from the store. | |
virtual ConstUIter | ConstIterByName (const std::string &_name) const |
Get a const iterator to the object by name. Note that the iterator may change or become invalid when objects are added to / removed from the store. | |
virtual void | DestroyImpl (UIter _iter) |
virtual bool | IsValidIter (ConstUIter _iter) const |
virtual UIter | Iter (ConstTPtr _object) |
Get an iterator to the object by pointer. Note that the iterator may change or become invalid when objects are added to / removed from the store. | |
virtual UIter | IterById (unsigned int _id) |
Get an iterator to the object by id. Note that the iterator may change or become invalid when objects are added to / removed from the store. | |
virtual UIter | IterByIndex (unsigned int _index) |
Get an iterator to the object by index. Note that the iterator may change or become invalid when objects are added to / removed from the store. | |
virtual UIter | IterByName (const std::string &_name) |
Get an iterator to the object by name. Note that the iterator may change or become invalid when objects are added to / removed from the store. | |
virtual UIter | RemoveConstness (ConstUIter _iter) |
virtual UPtr | RemoveImpl (UIter _iter) |
Protected Attributes | |
UStore | store |
UStoreMap | storeMap |
Constructor & Destructor Documentation
🔗BaseStore()
BaseStore | ( | ) |
🔗~BaseStore()
|
virtual |
Member Function Documentation
🔗Add()
|
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
Implements Store< T >.
References std::dynamic_pointer_cast(), std::endl(), and gzerr.
🔗AddDerived()
|
virtual |
References std::endl(), and gzerr.
🔗AddImpl()
|
protectedvirtual |
References std::endl(), gzerr, and string::size().
🔗Begin()
|
virtual |
Return an iterator to the beginning.
- Returns
- Iterator to beginning
🔗ConstIter()
|
protectedvirtual |
Get a const iterator to the object by pointer. Note that the iterator may change or become invalid when objects are added to / removed from the store.
- Parameters
-
[in] _object Object pointer
- Returns
- Const iterator to the object
🔗ConstIterById()
|
protectedvirtual |
Get a const iterator to the object by id. Note that the iterator may change or become invalid when objects are added to / removed from the store.
- Parameters
-
[in] _id Object id
- Returns
- Const iterator to the object
🔗ConstIterByIndex()
|
protectedvirtual |
Get a const iterator to the object by index. Note that the iterator may change or become invalid when objects are added to / removed from the store.
- Parameters
-
[in] _index Object index
- Returns
- Const iterator to the object
References std::advance(), std::endl(), and gzerr.
🔗ConstIterByName()
|
protectedvirtual |
Get a const iterator to the object by name. Note that the iterator may change or become invalid when objects are added to / removed from the store.
- Parameters
-
[in] _name Object name
- Returns
- Const iterator to the object
🔗Contains()
|
virtual |
Determine if store contains the given element.
- Parameters
-
[in] _object The element in question
- Returns
- True if this store contains the given element
Implements Store< T >.
🔗ContainsId()
|
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
Implements Store< T >.
🔗ContainsName()
|
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
Implements Store< T >.
🔗DerivedById()
|
virtual |
🔗DerivedByIndex()
|
virtual |
🔗DerivedByName()
|
virtual |
🔗Destroy()
|
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
Implements Store< T >.
🔗DestroyAll()
|
virtual |
Remove and destroy all elements in store.
Implements Store< T >.
🔗DestroyById()
|
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
Implements Store< T >.
🔗DestroyByIndex()
|
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
Implements Store< T >.
🔗DestroyByName()
|
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
Implements Store< T >.
🔗DestroyImpl()
|
protectedvirtual |
🔗End()
|
virtual |
Return an iterator to the end.
- Returns
- Iterator to end
🔗GetById()
|
virtual |
Get element with the given ID.
- Parameters
-
[in] _id ID of the desired element
- Returns
- The specified element
Implements Store< T >.
🔗GetByIndex()
|
virtual |
Get element at the given index.
- Parameters
-
[in] _index Index of the desired element
- Returns
- The specified element
Implements Store< T >.
🔗GetByName()
|
virtual |
Get element with the given name.
- Parameters
-
[in] _name Name of the desired element
- Returns
- The specified element
Implements Store< T >.
🔗IsValidIter()
|
protectedvirtual |
🔗Iter()
Get an iterator to the object by pointer. Note that the iterator may change or become invalid when objects are added to / removed from the store.
- Parameters
-
[in] _object Object pointer
- Returns
- Iterator to the object
🔗IterById()
|
protectedvirtual |
Get an iterator to the object by id. Note that the iterator may change or become invalid when objects are added to / removed from the store.
- Parameters
-
[in] _id Object id
- Returns
- Iterator to the object
🔗IterByIndex()
|
protectedvirtual |
Get an iterator to the object by index. Note that the iterator may change or become invalid when objects are added to / removed from the store.
- Parameters
-
[in] _index Object index
- Returns
- Iterator to the object
🔗IterByName()
|
protectedvirtual |
Get an iterator to the object by name. Note that the iterator may change or become invalid when objects are added to / removed from the store.
- Parameters
-
[in] _name Object name
- Returns
- Iterator to the object
🔗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
Implements Store< T >.
🔗RemoveAll()
|
virtual |
Remove all elements from store.
Implements Store< T >.
🔗RemoveById()
|
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
Implements Store< T >.
🔗RemoveByIndex()
|
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
Implements Store< T >.
🔗RemoveByName()
|
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
Implements Store< T >.
🔗RemoveConstness()
|
protectedvirtual |
🔗RemoveDerived()
🔗RemoveDerivedById()
|
virtual |
🔗RemoveDerivedByIndex()
|
virtual |
🔗RemoveDerivedByName()
|
virtual |
🔗RemoveImpl()
|
protectedvirtual |
References std::distance(), and string::erase().
🔗Size()
|
virtual |
Get number of elements in this store.
- Returns
- The number of elements in this store
Implements Store< T >.
Member Data Documentation
🔗store
|
protected |
🔗storeMap
|
protected |
The documentation for this class was generated from the following file: