Cogs.Foundation
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
Cogs::ComponentModel::ComponentCollectionBase::ComponentCollectionIterator Class Reference

Iterator type for iterating over ComponentCollectionBase. More...

#include <ComponentCollection.h>

Public Types

typedef std::forward_iterator_tag iterator_category
 Type of iterator. Can only be used to iterate forward over component handles in a collection.
 
typedef ComponentHandle value_type
 Value type.
 
typedef size_t difference_type
 Difference type to calculate iterator distance.
 
typedef ComponentHandlepointer
 Pointer type.
 
typedef ComponentHandlereference
 Reference type.
 

Public Member Functions

 ComponentCollectionIterator (const ComponentCollectionBase &collection, size_t index)
 Creates a new iterator over the given collection with the given index.
 
 ComponentCollectionIterator (const ComponentCollectionIterator &other)
 Create 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 handle in the collection.
 
ComponentCollectionIteratoroperator++ (int)
 Pre increment operator. Moves the iterator to the next component handle in the collection.
 
const ComponentHandleoperator* ()
 Dereference operator. Returns a reference to the component handle at the iterators current iterator index.
 
const ComponentHandleoperator* () const
 Const dereference operator. Returns a const reference to the component handle at the current iterator index.
 
const ComponentHandleoperator-> () const
 Pointer operator. Returns a pointer to the component handle at the current iterator index.
 

Detailed Description

Iterator type for iterating over ComponentCollectionBase.

Member Typedef Documentation

◆ difference_type

Difference type to calculate iterator distance.

◆ iterator_category

Type of iterator. Can only be used to iterate forward over component handles in a collection.

◆ pointer

Pointer type.

◆ reference

Reference type.

◆ value_type

Value type.

Constructor & Destructor Documentation

◆ ComponentCollectionIterator() [1/2]

Cogs::ComponentModel::ComponentCollectionBase::ComponentCollectionIterator::ComponentCollectionIterator ( const ComponentCollectionBase collection,
size_t  index 
)
inline

Creates a new iterator over the given collection with the given index.

◆ ComponentCollectionIterator() [2/2]

Cogs::ComponentModel::ComponentCollectionBase::ComponentCollectionIterator::ComponentCollectionIterator ( const ComponentCollectionIterator other)
inline

Create a new iterator, copying the state of other.

Member Function Documentation

◆ operator*() [1/2]

const ComponentHandle & Cogs::ComponentModel::ComponentCollectionBase::ComponentCollectionIterator::operator* ( )
inline

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

◆ operator*() [2/2]

const ComponentHandle & Cogs::ComponentModel::ComponentCollectionBase::ComponentCollectionIterator::operator* ( ) const
inline

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

◆ operator++() [1/2]

ComponentCollectionIterator Cogs::ComponentModel::ComponentCollectionBase::ComponentCollectionIterator::operator++ ( )
inline

Post increment operator. Moves the iterator to the next component handle in the collection.

◆ operator++() [2/2]

ComponentCollectionIterator & Cogs::ComponentModel::ComponentCollectionBase::ComponentCollectionIterator::operator++ ( int  )
inline

Pre increment operator. Moves the iterator to the next component handle in the collection.

◆ operator->()

const ComponentHandle * Cogs::ComponentModel::ComponentCollectionBase::ComponentCollectionIterator::operator-> ( ) const
inline

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

◆ operator==()

constexpr bool Cogs::ComponentModel::ComponentCollectionBase::ComponentCollectionIterator::operator== ( const ComponentCollectionIterator other) const
inlineconstexpr

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


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