Cogs.Foundation
|
Iterator type for iterating over typed component collections. More...
#include <ComponentCollection.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 | |
ComponentCollectionIterator (ComponentCollection &collection, size_t index) | |
Creates a new iterator over the given collection with the given index. | |
ComponentCollectionIterator (const ComponentCollectionIterator &other) | |
Creates a new iterator copying the state of other. | |
constexpr bool | operator== (const ComponentCollectionIterator &other) const |
Comparison operator. If the current index of both iterators are equal the iterators are considered equal. | |
ComponentCollectionIterator | operator++ () |
Post increment operator. Moves the iterator to the next component indexed in the collection. | |
ComponentCollectionIterator & | operator++ (int) |
Pre increment operator. Moves the iterator to the next component indexed in the collection. | |
ComponentType & | operator* () |
Dereference operator. Returns a reference to the component at the iterators current iterator index. | |
const ComponentType & | operator* () const |
Const dereference operator. Returns a const reference to the component at the current iterator index. | |
const ComponentType * | operator-> () const |
Pointer operator. Returns a pointer to the component at the current iterator index. | |
Iterator type for iterating over typed component collections.
typedef size_t Cogs::ComponentModel::ComponentCollection< ComponentType >::ComponentCollectionIterator::difference_type |
Difference type to calculate iterator distance.
typedef std::forward_iterator_tag Cogs::ComponentModel::ComponentCollection< ComponentType >::ComponentCollectionIterator::iterator_category |
Type of iterator. Can only be used to iterate forward over components in a pool.
typedef ComponentType* Cogs::ComponentModel::ComponentCollection< ComponentType >::ComponentCollectionIterator::pointer |
Pointer type to the templated ComponentType.
typedef ComponentType& Cogs::ComponentModel::ComponentCollection< ComponentType >::ComponentCollectionIterator::reference |
Reference type to the templated ComponentType.
typedef ComponentType Cogs::ComponentModel::ComponentCollection< ComponentType >::ComponentCollectionIterator::value_type |
Value type for dereferencing the iterator is the templated ComponentType.
|
inline |
Creates a new iterator over the given collection with the given index.
|
inline |
Creates a new iterator copying the state of other.
|
inline |
Dereference operator. Returns a reference to the component at the iterators current iterator index.
|
inline |
Const dereference operator. Returns a const reference to the component at the current iterator index.
|
inline |
Post increment operator. Moves the iterator to the next component indexed in the collection.
|
inline |
Pre increment operator. Moves the iterator to the next component indexed in the collection.
|
inline |
Pointer operator. Returns a pointer to the component at the current iterator index.
|
inlineconstexpr |
Comparison operator. If the current index of both iterators are equal the iterators are considered equal.