Skip to main content

Iterator Struct

Forward iterator for traversing the sparse set. More...

Declaration

struct helios::engine::ecs::SparseSet::Iterator { ... }

Public Member Typedefs Index

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

Public Constructors Index

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

Public Operators Index

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

Public Member Functions Index

EntityIdentityId () const

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

Public Member Attributes Index

DataItdataIt_
IdItidIt_

Description

Forward iterator for traversing the sparse set.

Iterates over the dense storage array, providing access to both the stored element and its associated EntityId.

Definition at line 383 of file SparseSet.ixx.

Public Member Typedefs

DataIt

using helios::engine::ecs::SparseSet< T >::Iterator::DataIt = typename std::vector<T>::iterator

Definition at line 384 of file SparseSet.ixx.

384 using DataIt = typename std::vector<T>::iterator;

difference_type

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

Definition at line 392 of file SparseSet.ixx.

392 using difference_type = std::ptrdiff_t;

IdIt

using helios::engine::ecs::SparseSet< T >::Iterator::IdIt = typename std::vector<EntityId>::iterator

Definition at line 385 of file SparseSet.ixx.

385 using IdIt = typename std::vector<EntityId>::iterator;

iterator_category

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

Definition at line 390 of file SparseSet.ixx.

390 using iterator_category = std::forward_iterator_tag;

pointer

using helios::engine::ecs::SparseSet< T >::Iterator::pointer = T*

Definition at line 393 of file SparseSet.ixx.

393 using pointer = T*;

reference

using helios::engine::ecs::SparseSet< T >::Iterator::reference = T&

Definition at line 394 of file SparseSet.ixx.

394 using reference = T&;

value_type

using helios::engine::ecs::SparseSet< T >::Iterator::value_type = T

Definition at line 391 of file SparseSet.ixx.

391 using value_type = T;

Public Constructors

Iterator()

Iterator()

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

Public Operators

operator->()

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

Definition at line 401 of file SparseSet.ixx.

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

Reference helios::engine::ecs::SparseSet< T >::Iterator::dataIt_.

operator!=()

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

Definition at line 411 of file SparseSet.ixx.

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

References helios::engine::ecs::SparseSet< T >::Iterator::dataIt_ and helios::engine::ecs::SparseSet< T >::Iterator::Iterator.

operator*()

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

Definition at line 400 of file SparseSet.ixx.

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

Reference helios::engine::ecs::SparseSet< T >::Iterator::dataIt_.

operator++()

Iterator & helios::engine::ecs::SparseSet< T >::Iterator::operator++ (int)
inline

Definition at line 413 of file SparseSet.ixx.

414 Iterator tmp = *this;
415 ++(*this);
416 return tmp;
417 }

Reference helios::engine::ecs::SparseSet< T >::Iterator::Iterator.

operator++()

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

operator==()

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

Definition at line 410 of file SparseSet.ixx.

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

References helios::engine::ecs::SparseSet< T >::Iterator::dataIt_ and helios::engine::ecs::SparseSet< T >::Iterator::Iterator.

Public Member Functions

entityId()

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

Returns the EntityId for the current element.

Returns

The EntityId associated with the current element.

Definition at line 408 of file SparseSet.ixx.

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

Reference helios::engine::ecs::SparseSet< T >::Iterator::idIt_.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.