Cogs.Core
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.

Definition at line 24 of file ComponentCollection.h.

Member Typedef Documentation

◆ difference_type

Difference type to calculate iterator distance.

Definition at line 34 of file ComponentCollection.h.

◆ iterator_category

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

Definition at line 28 of file ComponentCollection.h.

◆ pointer

Pointer type.

Definition at line 37 of file ComponentCollection.h.

◆ reference

Reference type.

Definition at line 40 of file ComponentCollection.h.

◆ value_type

Value type.

Definition at line 31 of file ComponentCollection.h.

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.

Definition at line 43 of file ComponentCollection.h.

◆ ComponentCollectionIterator() [2/2]

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

Create a new iterator, copying the state of other.

Definition at line 46 of file ComponentCollection.h.

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.

Definition at line 58 of file ComponentCollection.h.

◆ 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.

Definition at line 61 of file ComponentCollection.h.

◆ operator++() [1/2]

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

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

Definition at line 52 of file ComponentCollection.h.

◆ 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.

Definition at line 55 of file ComponentCollection.h.

◆ operator->()

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

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

Definition at line 64 of file ComponentCollection.h.

◆ 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.

Definition at line 49 of file ComponentCollection.h.


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