Skip to main content

ConstIterator Struct

Const forward iterator for traversing the sparse set. More...

Declaration

struct helios::ecs::SparseSet::ConstIterator { ... }

Public Member Typedefs Index

usingDataIt = typename std::vector< T >::const_iterator
usingIdIt = typename std::vector< EntityId >::const_iterator
usingiterator_category = std::forward_iterator_tag
usingvalue_type = T
usingdifference_type = std::ptrdiff_t
usingpointer = const T *
usingreference = const T &

Public Constructors Index

ConstIterator ()=default
ConstIterator (DataIt dataIt, IdIt idIt)

Public Operators Index

referenceoperator* () const
pointeroperator-> () const
booloperator== (const ConstIterator &other) const
booloperator!= (const ConstIterator &other) const
ConstIteratoroperator++ (int)
ConstIterator &operator++ ()

Public Member Functions Index

EntityIdentityId () const

Returns the EntityId for the current element. More...

Public Member Attributes Index

DataItdataIt_

Const iterator into the dense data storage. More...

IdItidIt_

Const iterator into the dense-to-sparse ID mapping. More...

Description

Const forward iterator for traversing the sparse set.

Provides read-only access to elements and their EntityIds.

Definition at line 396 of file SparseSet.ixx.

Public Member Typedefs

DataIt

using helios::ecs::SparseSet< T >::ConstIterator::DataIt = typename std::vector<T>::const_iterator

Definition at line 397 of file SparseSet.ixx.

397 using DataIt = typename std::vector<T>::const_iterator;

difference_type

using helios::ecs::SparseSet< T >::ConstIterator::difference_type = std::ptrdiff_t

Definition at line 412 of file SparseSet.ixx.

412 using difference_type = std::ptrdiff_t;

IdIt

using helios::ecs::SparseSet< T >::ConstIterator::IdIt = typename std::vector<EntityId>::const_iterator

Definition at line 398 of file SparseSet.ixx.

398 using IdIt = typename std::vector<EntityId>::const_iterator;

iterator_category

using helios::ecs::SparseSet< T >::ConstIterator::iterator_category = std::forward_iterator_tag

Definition at line 410 of file SparseSet.ixx.

410 using iterator_category = std::forward_iterator_tag;

pointer

using helios::ecs::SparseSet< T >::ConstIterator::pointer = const T*

Definition at line 413 of file SparseSet.ixx.

413 using pointer = const T*;

reference

using helios::ecs::SparseSet< T >::ConstIterator::reference = const T&

Definition at line 414 of file SparseSet.ixx.

414 using reference = const T&;

value_type

using helios::ecs::SparseSet< T >::ConstIterator::value_type = T

Definition at line 411 of file SparseSet.ixx.

411 using value_type = T;

Public Constructors

ConstIterator()

ConstIterator()

helios::ecs::SparseSet< T >::ConstIterator::ConstIterator (DataIt dataIt, IdIt idIt)
inline

Public Operators

operator->()

pointer helios::ecs::SparseSet< T >::ConstIterator::operator-> ()
inline

Definition at line 421 of file SparseSet.ixx.

421 pointer operator->() const { return &*dataIt_; }

Reference helios::ecs::SparseSet< T >::ConstIterator::dataIt_.

operator!=()

bool helios::ecs::SparseSet< T >::ConstIterator::operator!= (const ConstIterator & other)
inline nodiscard

Definition at line 431 of file SparseSet.ixx.

431 [[nodiscard]] bool operator!=(const ConstIterator& other) const { return dataIt_ != other.dataIt_;}

References helios::ecs::SparseSet< T >::ConstIterator::ConstIterator and helios::ecs::SparseSet< T >::ConstIterator::dataIt_.

operator*()

reference helios::ecs::SparseSet< T >::ConstIterator::operator* ()
inline

Definition at line 420 of file SparseSet.ixx.

420 reference operator*() const { return *dataIt_; }

Reference helios::ecs::SparseSet< T >::ConstIterator::dataIt_.

operator++()

ConstIterator helios::ecs::SparseSet< T >::ConstIterator::operator++ (int)
inline

Definition at line 433 of file SparseSet.ixx.

434 ConstIterator tmp = *this;
435 ++(*this);
436 return tmp;
437 }

Reference helios::ecs::SparseSet< T >::ConstIterator::ConstIterator.

operator++()

ConstIterator & helios::ecs::SparseSet< T >::ConstIterator::operator++ ()
inline

operator==()

bool helios::ecs::SparseSet< T >::ConstIterator::operator== (const ConstIterator & other)
inline nodiscard

Definition at line 430 of file SparseSet.ixx.

430 [[nodiscard]] bool operator==(const ConstIterator& other) const { return dataIt_ == other.dataIt_;}

References helios::ecs::SparseSet< T >::ConstIterator::ConstIterator and helios::ecs::SparseSet< T >::ConstIterator::dataIt_.

Public Member Functions

entityId()

EntityId helios::ecs::SparseSet< T >::ConstIterator::entityId ()
inline nodiscard

Returns the EntityId for the current element.

Returns

The EntityId associated with the current element.

Definition at line 428 of file SparseSet.ixx.

428 [[nodiscard]] EntityId entityId() const { return *idIt_; }

Reference helios::ecs::SparseSet< T >::ConstIterator::idIt_.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.