Iterator Struct
Forward iterator for View traversal. More...
Declaration
Public Member Typedefs Index
| 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... | |
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 134 of file View.ixx.
Public Member Typedefs
LeadComponent
|
The first component type determines iteration order.
Definition at line 138 of file View.ixx.
LeadIterator
|
Iterator type from the lead component's SparseSet.
Definition at line 143 of file View.ixx.
Public Constructors
Iterator()
| default |
Default constructor creating an invalid iterator.
Definition at line 152 of file View.ixx.
Referenced by helios::engine::ecs::View< Components >::Iterator::operator!= and helios::engine::ecs::View< 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 161 of file View.ixx.
References helios::engine::ecs::View< Components >::Iterator::current_, helios::engine::ecs::View< Components >::end, helios::engine::ecs::View< Components >::Iterator::end_, helios::engine::ecs::View< Components >::View and helios::engine::ecs::View< 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 264 of file View.ixx.
References helios::engine::ecs::View< Components >::Iterator::current_ and helios::engine::ecs::View< 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 275 of file View.ixx.
References helios::engine::ecs::View< Components >::Iterator::current_ and helios::engine::ecs::View< Components >::Iterator::view_.
operator++()
| inline noexcept |
Pre-increment operator.
- Returns
Reference to this iterator after advancing.
Definition at line 252 of file View.ixx.
References helios::engine::ecs::View< Components >::Iterator::advance and helios::engine::ecs::View< 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 241 of file View.ixx.
References helios::engine::ecs::View< Components >::Iterator::current_, helios::engine::ecs::View< Components >::Iterator::end_ and helios::engine::ecs::View< Components >::Iterator::isValid.
Referenced by helios::engine::ecs::View< Components >::begin and helios::engine::ecs::View< 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 175 of file View.ixx.
References helios::engine::ecs::View< Components >::Iterator::current_, helios::engine::ecs::View< Components >::Iterator::end_ and helios::engine::ecs::View< Components >::Iterator::view_.
Referenced by helios::engine::ecs::View< Components >::Iterator::advance and helios::engine::ecs::View< Components >::begin.
Public Member Attributes
current_
|
Definition at line 145 of file View.ixx.
Referenced by helios::engine::ecs::View< Components >::Iterator::advance, helios::engine::ecs::View< Components >::Iterator::isValid, helios::engine::ecs::View< Components >::Iterator::Iterator, helios::engine::ecs::View< Components >::Iterator::operator!= and helios::engine::ecs::View< Components >::Iterator::operator*.
end_
|
Definition at line 146 of file View.ixx.
Referenced by helios::engine::ecs::View< Components >::Iterator::advance, helios::engine::ecs::View< Components >::Iterator::isValid and helios::engine::ecs::View< Components >::Iterator::Iterator.
view_
|
Definition at line 147 of file View.ixx.
Referenced by helios::engine::ecs::View< Components >::Iterator::isValid, helios::engine::ecs::View< Components >::Iterator::Iterator and helios::engine::ecs::View< Components >::Iterator::operator*.
The documentation for this struct was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.