Cogs.Foundation
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator Struct Reference

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.
 
ComponentIteratoroperator++ (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.
 

Detailed Description

template<typename ComponentType>
struct Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator

Custom iterator providing iteration support for component pools.

Member Typedef Documentation

◆ difference_type

template<typename ComponentType >
typedef size_t Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::difference_type

Difference type to calculate iterator distance.

◆ iterator_category

template<typename ComponentType >
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.

◆ pointer

template<typename ComponentType >
typedef ComponentType* Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::pointer

Pointer type to the templated ComponentType.

◆ reference

template<typename ComponentType >
typedef ComponentType& Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::reference

Reference type to the templated ComponentType.

◆ value_type

template<typename ComponentType >
typedef ComponentType Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::value_type

Value type for dereferencing the iterator is the templated ComponentType.

Constructor & Destructor Documentation

◆ ComponentIterator() [1/2]

template<typename ComponentType >
Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::ComponentIterator ( ComponentPool pool,
SizeType  index 
)
inline

Construct a new component iterator on the given pool, starting at the given roster index.

◆ ComponentIterator() [2/2]

template<typename ComponentType >
Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::ComponentIterator ( const ComponentIterator other)
inline

Copy construct a new iterator instance from the given iterator.

Member Function Documentation

◆ operator*() [1/2]

template<typename ComponentType >
ComponentType & Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::operator* ( )
inline

Dereference operator. Returns a reference to the component at the iterators current roster index.

◆ operator*() [2/2]

template<typename ComponentType >
const ComponentType & Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::operator* ( ) const
inline

Const dereference operator. Returns a const reference to the component at the current roster index.

◆ operator++() [1/2]

template<typename ComponentType >
ComponentIterator Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::operator++ ( )
inline

Post increment operator. Moves the iterator to the next component indexed in the roster of the pool.

◆ operator++() [2/2]

template<typename ComponentType >
ComponentIterator & Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::operator++ ( int  )
inline

Pre increment operator. Moves the iterator to the next component indexed in the roster of the pool.

◆ operator->()

template<typename ComponentType >
const ComponentType * Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::operator-> ( ) const
inline

Pointer operator. Returns a pointer to the component at the current roster index.

◆ operator==()

template<typename ComponentType >
constexpr bool Cogs::ComponentModel::ComponentPool< ComponentType >::ComponentIterator::operator== ( const ComponentIterator other) const
inlineconstexpr

Comparison operator. If the current index of both iterators are equal the iterators are considered equal.


The documentation for this struct was generated from the following file: