|
| virtual const char * | TypeName () const noexcept=0 |
| virtual bool | IsValid () const noexcept=0 |
| | Checks whether the elements in this collection are valid.
|
| virtual IDType | Add (std::shared_ptr< Value_Type > pValue_Type)=0 |
| | Adds an element to the container and returns its index in the container.
|
| virtual IDType | AddRelaxed (std::shared_ptr< Value_Type > pTraxType)=0 |
| | Adds an element to the container and returns its index in the container. Does not throw.
|
| virtual bool | Remove (Value_Type *pValue_Type, bool zeroIDs=false)=0 |
| | Removes an element from this container.
|
| virtual int | Take (Collection_Type &collection_Type)=0 |
| | Moves all the items from another container to this container.
|
|
virtual void | Clear ()=0 |
| | Removes all the elements from this container.
|
| virtual int | Count () const =0 |
| virtual iterator | begin ()=0 |
| virtual const_iterator | begin () const =0 |
|
virtual const_iterator | cbegin () const =0 |
| virtual iterator | end ()=0 |
| virtual const_iterator | end () const =0 |
|
virtual const_iterator | cend () const =0 |
| virtual std::shared_ptr< Value_Type > | GetFirst () const =0 |
| virtual std::shared_ptr< Value_Type > | GetNext (const std::shared_ptr< Value_Type > &pValue_Type) const =0 |
| virtual std::shared_ptr< Value_Type > | GetLast () const =0 |
| virtual std::shared_ptr< Value_Type > | GetPrevious (const std::shared_ptr< Value_Type > &pValue_Type) const =0 |
| virtual void | PushActive (IDType id)=0 |
| | Pushes an element on the activety stack.
|
| virtual void | PopActive ()=0 |
| | Pops an element from the activity stack.
|
| virtual std::shared_ptr< Value_Type > | GetActive () const =0 |
| virtual void | ShiftIDs (int offset)=0 |
| | Adds an offset to all ids.
|
| virtual IDType | MaxID () const =0 |
| virtual IDType | MinID () const =0 |
|
| Collection (const Collection &)=delete |
|
| Collection (Collection &&)=delete |
|
Collection & | operator= (const Collection &)=delete |
|
Collection & | operator= (Collection &&)=delete |
Gets an element from the container.
- Parameters
-
| id | Identifier for the object to retreive. |
| name | Name to get the object for. |
- Returns
- A pointer to the requested element.
|
|
virtual std::shared_ptr< Value_Type > | Get (IDType id) const =0 |
|
virtual std::shared_ptr< Value_Type > | Get (const std::string &name) const =0 |
- Returns
- true if the element is a member of the collection; false otherwise.
- Parameters
-
| item | reference to element to test for membership. |
| id | Unique id to test wether it is already in use. |
|
|
virtual bool | IsMember (const value_type &item) const =0 |
|
virtual bool | IsMember (IDType id) const =0 |
template<class Collection_Type, class Value_Type>
| virtual IDType trax::Collection< Collection_Type, Value_Type >::Add |
( |
std::shared_ptr< Value_Type > | pValue_Type | ) |
|
|
pure virtual |
Adds an element to the container and returns its index in the container.
If the element carries an id, it is used as long as it is unique. If the id is 0 the object is assigned one valid id. If it is not zero but already occupied, an exception is thrown.
- Parameters
-
| pValue_Type | Object to get added to the fleet. |
- Exceptions
-
| std::invalid_argument | if the object is invalid or the objects id is already occupied. |
template<class Collection_Type, class Value_Type>
| virtual IDType trax::Collection< Collection_Type, Value_Type >::AddRelaxed |
( |
std::shared_ptr< Value_Type > | pTraxType | ) |
|
|
pure virtual |
Adds an element to the container and returns its index in the container. Does not throw.
While the Collection::Add will throw an exception if an element carries an id wich is already occupied, this method will supply the element with a free one. This might lead to other ids becoming occupied without explicitely requested.