Iterator Struct
Forward iterator for View traversal. More...
Declaration
Public Member Typedefs Index
| using | Entity_type = Entity< TEntityManager > |
| using | LeadComponent = std::tuple_element_t< 0, std::tuple< Components... > > |
|
The first component type determines iteration order. More... | |
| using | LeadIterator = typename SparseSet< LeadComponent >::Iterator |
Public Constructors Index
| Iterator ()=default | |
|
Default constructor creating an invalid iterator. More... | |
| Iterator (LeadIterator current, LeadIterator end, const View *view) | |
|
Constructs an iterator with the given range and view. More... | |
Public Operators Index
| Iterator & | operator++ () noexcept |
|
Pre-increment operator. More... | |
| bool | operator!= (const Iterator &other) const noexcept |
|
Inequality comparison. More... | |
| auto | operator* () const |
|
Dereference operator. More... | |
| bool | operator== (const Iterator &other) const noexcept |
Public Member Functions Index
| bool | isValid () const |
|
Validates if the current entity matches all filter criteria. More... | |
| void | advance () |
|
Advances to the next valid entity. More... | |
Public Member Attributes Index
| LeadIterator | current_ |
| LeadIterator | end_ |
| const View * | view_ |
Description
Forward iterator for View traversal.
Uses the first component type as the "lead" iterator and validates each entity against all include/exclude/enabled criteria before yielding.
Definition at line 146 of file View.ixx.
Public Member Typedefs
Entity_type
|
Definition at line 148 of file View.ixx.
LeadComponent
|
The first component type determines iteration order.
Definition at line 153 of file View.ixx.
LeadIterator
|
Iterator type from the lead component's SparseSet.
Definition at line 158 of file View.ixx.
Public Constructors
Iterator()
| default |
Default constructor creating an invalid iterator.
Definition at line 167 of file View.ixx.
Referenced by helios::ecs::View< TEntityManager, Components >::Iterator::operator!=, helios::ecs::View< TEntityManager, Components >::Iterator::operator++ and helios::ecs::View< TEntityManager, Components >::Iterator::operator==.
Iterator()
| inline |
Constructs an iterator with the given range and view.
- Parameters
-
current Iterator to the current position.
end Iterator to the end position.
view Pointer to the owning View for filter access.
Definition at line 176 of file View.ixx.
References helios::ecs::View< TEntityManager, Components >::Iterator::current_, helios::ecs::View< TEntityManager, Components >::end, helios::ecs::View< TEntityManager, Components >::Iterator::end_, helios::ecs::View< TEntityManager, Components >::View and helios::ecs::View< TEntityManager, Components >::Iterator::view_.
Public Operators
operator!=()
| inline noexcept |
Inequality comparison.
- Parameters
-
other The iterator to compare against.
- Returns
True if iterators point to different positions.
Definition at line 279 of file View.ixx.
References helios::ecs::View< TEntityManager, Components >::Iterator::current_ and helios::ecs::View< TEntityManager, Components >::Iterator::Iterator.
operator*()
| inline nodiscard |
Dereference operator.
- Returns
A tuple containing {GameObject, Component*...}.
Returns by value to support C++17 Structured Binding (auto [go, comp] : view).
Definition at line 290 of file View.ixx.
References helios::ecs::View< TEntityManager, Components >::Iterator::current_ and helios::ecs::View< TEntityManager, Components >::Iterator::view_.
operator++()
| inline noexcept |
Pre-increment operator.
- Returns
Reference to this iterator after advancing.
Definition at line 267 of file View.ixx.
References helios::ecs::View< TEntityManager, Components >::Iterator::advance and helios::ecs::View< TEntityManager, Components >::Iterator::Iterator.
operator==()
| inline nodiscard noexcept |
Definition at line 304 of file View.ixx.
References helios::ecs::View< TEntityManager, Components >::Iterator::current_ and helios::ecs::View< TEntityManager, Components >::Iterator::Iterator.
Public Member Functions
advance()
| inline |
Advances to the next valid entity.
Increments the underlying iterator and skips invalid entities until a valid one is found or end is reached.
Definition at line 256 of file View.ixx.
References helios::ecs::View< TEntityManager, Components >::Iterator::current_, helios::ecs::View< TEntityManager, Components >::Iterator::end_ and helios::ecs::View< TEntityManager, Components >::Iterator::isValid.
Referenced by helios::ecs::View< TEntityManager, Components >::begin and helios::ecs::View< TEntityManager, Components >::Iterator::operator++.
isValid()
| inline nodiscard |
Validates if the current entity matches all filter criteria.
Performs the following checks in order: 1. Entity validity in the registry 2. Include check - entity has all required components 3. Exclude check - entity has none of the excluded components 4. Enabled check - all components pass isEnabled() (if filtered)
- Returns
True if the entity passes all checks, false otherwise.
Definition at line 190 of file View.ixx.
References helios::ecs::View< TEntityManager, Components >::Iterator::current_, helios::ecs::View< TEntityManager, Components >::Iterator::end_ and helios::ecs::View< TEntityManager, Components >::Iterator::view_.
Referenced by helios::ecs::View< TEntityManager, Components >::Iterator::advance and helios::ecs::View< TEntityManager, Components >::begin.
Public Member Attributes
current_
|
Definition at line 160 of file View.ixx.
Referenced by helios::ecs::View< TEntityManager, Components >::Iterator::advance, helios::ecs::View< TEntityManager, Components >::Iterator::isValid, helios::ecs::View< TEntityManager, Components >::Iterator::Iterator, helios::ecs::View< TEntityManager, Components >::Iterator::operator!=, helios::ecs::View< TEntityManager, Components >::Iterator::operator* and helios::ecs::View< TEntityManager, Components >::Iterator::operator==.
end_
|
view_
|
The documentation for this struct was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.