Represents a collection of child objects owned by a parent object. Unlike ObjectList, this doesn't (re)initialize the container objects nor has ownership.
More...
#include <ChildObjectCollection.hpp>
|
| | ChildObjectCollection (IObject *owner) |
| void | Add (IObject *ptr) |
| | Adds an IObject pointer reference to this list.
|
| void | Remove (IObject *ptr) |
| | Removes the specified object.
|
| void | Remove (size_t index) |
| | Removes the ith object in this list.
|
| IObject * | operator[] (size_t index) const |
| | Returns the ith object in this list.
|
| IObject *& | operator[] (size_t index) |
| | Returns an reference to the ith's object pointer in this list.
|
| size_t | Count () const noexcept |
| | Returns how many objects are in this list.
|
| void | Clear () |
| | Empties this list.
|
| std::vector< IObject * > | Find (std::function< bool(IObject *)> predicate) const noexcept |
| | Finds objects that match the specified predicate.
|
| std::vector< IObject * >::iterator | begin () noexcept |
| | Begin iterator for range-based for loops.
|
| std::vector< IObject * >::const_iterator | begin () const noexcept |
| | Begin const iterator for range-based for loops.
|
| std::vector< IObject * >::iterator | end () noexcept |
| | End iterator for range-based for loops.
|
| std::vector< IObject * >::const_iterator | end () const noexcept |
| | End const iterator for range-based for loops.
|
Represents a collection of child objects owned by a parent object. Unlike ObjectList, this doesn't (re)initialize the container objects nor has ownership.
◆ ChildObjectCollection()
| ChildObjectCollection::ChildObjectCollection |
( |
IObject * | owner | ) |
|
|
explicit |
◆ Add()
| void ChildObjectCollection::Add |
( |
IObject * | ptr | ) |
|
Adds an IObject pointer reference to this list.
- Parameters
-
◆ begin() [1/2]
| std::vector< IObject * >::const_iterator ChildObjectCollection::begin |
( |
| ) |
const |
|
noexcept |
Begin const iterator for range-based for loops.
- Returns
- Const iterator to the beginning of the collection.
◆ begin() [2/2]
| std::vector< IObject * >::iterator ChildObjectCollection::begin |
( |
| ) |
|
|
noexcept |
Begin iterator for range-based for loops.
- Returns
- Iterator to the beginning of the collection.
◆ Clear()
| void ChildObjectCollection::Clear |
( |
| ) |
|
◆ Count()
| size_t ChildObjectCollection::Count |
( |
| ) |
const |
|
noexcept |
Returns how many objects are in this list.
- Returns
- Number of objects in the list.
◆ end() [1/2]
| std::vector< IObject * >::const_iterator ChildObjectCollection::end |
( |
| ) |
const |
|
noexcept |
End const iterator for range-based for loops.
- Returns
- Const iterator to the end of the collection.
◆ end() [2/2]
| std::vector< IObject * >::iterator ChildObjectCollection::end |
( |
| ) |
|
|
noexcept |
End iterator for range-based for loops.
- Returns
- Iterator to the end of the collection.
◆ Find()
| std::vector< IObject * > ChildObjectCollection::Find |
( |
std::function< bool(IObject *)> | predicate | ) |
const |
|
noexcept |
Finds objects that match the specified predicate.
- Parameters
-
| predicate | Predicate : (IObject*) -> bool |
- Returns
- A vector of IObject pointers that match the predicate.
◆ operator[]() [1/2]
| IObject *& ChildObjectCollection::operator[] |
( |
size_t | index | ) |
|
Returns an reference to the ith's object pointer in this list.
- Parameters
-
| index | Index. Must be smaller than Count |
- Returns
- Reference to the i-th object pointer.
◆ operator[]() [2/2]
| IObject * ChildObjectCollection::operator[] |
( |
size_t | index | ) |
const |
Returns the ith object in this list.
- Parameters
-
- Returns
- Object reference.
◆ Remove() [1/2]
| void ChildObjectCollection::Remove |
( |
IObject * | ptr | ) |
|
Removes the specified object.
- Parameters
-
◆ Remove() [2/2]
| void ChildObjectCollection::Remove |
( |
size_t | index | ) |
|
Removes the ith object in this list.
- Parameters
-
◆ IObject
The documentation for this class was generated from the following files: