Skip to main content

Iterator Struct

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

Declaration

struct helios::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
Iteratoroperator++ (int)
Iterator &operator++ ()

Public Member Functions Index

EntityIdentityId () const

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

Public Member Attributes Index

DataItdataIt_

Iterator into the dense data storage. More...

IdItidIt_

Iterator into the dense-to-sparse ID mapping. More...

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 343 of file SparseSet.ixx.

Public Member Typedefs

DataIt

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

Definition at line 344 of file SparseSet.ixx.

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

difference_type

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

Definition at line 359 of file SparseSet.ixx.

359 using difference_type = std::ptrdiff_t;

IdIt

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

Definition at line 345 of file SparseSet.ixx.

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

iterator_category

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

Definition at line 357 of file SparseSet.ixx.

357 using iterator_category = std::forward_iterator_tag;

pointer

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

Definition at line 360 of file SparseSet.ixx.

360 using pointer = T*;

reference

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

Definition at line 361 of file SparseSet.ixx.

361 using reference = T&;

value_type

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

Definition at line 358 of file SparseSet.ixx.

358 using value_type = T;

Public Constructors

Iterator()

Iterator()

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

Public Operators

operator->()

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

Definition at line 368 of file SparseSet.ixx.

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

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

operator!=()

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

Definition at line 378 of file SparseSet.ixx.

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

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

operator*()

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

Definition at line 367 of file SparseSet.ixx.

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

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

operator++()

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

Definition at line 380 of file SparseSet.ixx.

381 Iterator tmp = *this;
382 ++(*this);
383 return tmp;
384 }

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

operator++()

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

operator==()

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

Definition at line 377 of file SparseSet.ixx.

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

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

Public Member Functions

entityId()

EntityId helios::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 375 of file SparseSet.ixx.

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

Reference helios::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.