Cogs.Core
|
Custom iterator providing iteration support for component pools. More...
#include <ComponentPool.h>
Public Types | |
typedef std::forward_iterator_tag | iterator_category |
Type of iterator. Can only be used to iterate forward over components in a pool. | |
typedef ComponentType | value_type |
Value type for dereferencing the iterator is the templated ComponentType. | |
typedef size_t | difference_type |
Difference type to calculate iterator distance. | |
typedef ComponentType * | pointer |
Pointer type to the templated ComponentType. | |
typedef ComponentType & | reference |
Reference type to the templated ComponentType. | |
Public Member Functions | |
ComponentIterator (ComponentPool &pool, SizeType index) | |
Construct a new component iterator on the given pool, starting at the given roster index. | |
ComponentIterator (const ComponentIterator &other) | |
Copy construct a new iterator instance from the given iterator. | |
constexpr bool | operator== (const ComponentIterator &other) const |
Comparison operator. If the current index of both iterators are equal the iterators are considered equal. | |
ComponentIterator | operator++ () |
Post increment operator. Moves the iterator to the next component indexed in the roster of the pool. | |
ComponentIterator & | operator++ (int) |
Pre increment operator. Moves the iterator to the next component indexed in the roster of the pool. | |
ComponentType & | operator* () |
Dereference operator. Returns a reference to the component at the iterators current roster index. | |
const ComponentType & | operator* () const |
Const dereference operator. Returns a const reference to the component at the current roster index. | |
const ComponentType * | operator-> () const |
Pointer operator. Returns a pointer to the component at the current roster index. | |
Custom iterator providing iteration support for component pools.
Definition at line 130 of file ComponentPool.h.
typedef size_t Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::difference_type |
Difference type to calculate iterator distance.
Definition at line 140 of file ComponentPool.h.
typedef std::forward_iterator_tag Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::iterator_category |
Type of iterator. Can only be used to iterate forward over components in a pool.
Definition at line 134 of file ComponentPool.h.
typedef ComponentType* Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::pointer |
Pointer type to the templated ComponentType.
Definition at line 143 of file ComponentPool.h.
typedef ComponentType& Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::reference |
Reference type to the templated ComponentType.
Definition at line 146 of file ComponentPool.h.
typedef ComponentType Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::value_type |
Value type for dereferencing the iterator is the templated ComponentType.
Definition at line 137 of file ComponentPool.h.
|
inline |
Construct a new component iterator on the given pool, starting at the given roster index.
Definition at line 149 of file ComponentPool.h.
|
inline |
Copy construct a new iterator instance from the given iterator.
Definition at line 152 of file ComponentPool.h.
|
inline |
Dereference operator. Returns a reference to the component at the iterators current roster index.
Definition at line 164 of file ComponentPool.h.
|
inline |
Const dereference operator. Returns a const reference to the component at the current roster index.
Definition at line 167 of file ComponentPool.h.
|
inline |
Post increment operator. Moves the iterator to the next component indexed in the roster of the pool.
Definition at line 158 of file ComponentPool.h.
|
inline |
Pre increment operator. Moves the iterator to the next component indexed in the roster of the pool.
Definition at line 161 of file ComponentPool.h.
|
inline |
Pointer operator. Returns a pointer to the component at the current roster index.
Definition at line 170 of file ComponentPool.h.
|
inlineconstexpr |
Comparison operator. If the current index of both iterators are equal the iterators are considered equal.
Definition at line 155 of file ComponentPool.h.