Gaia-ECS v1.0.0
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::ecs::Iter Class Reference

Iterator for iterating entity subsets selected by Constraints. Disabled entities always precede enabled ones in AcceptAll mode. More...

#include <chunk_iterator.h>

+ Inheritance diagram for gaia::ecs::Iter:

Public Member Functions

GAIA_NODISCARD uint16_t size_enabled () const noexcept
 Returns the number of enabled entities accessible via the iterator.
 
GAIA_NODISCARD uint16_t size_disabled () const noexcept
 Returns the number of disabled entities accessible via the iterator. Can be read also as "the index of the first enabled entity".
 

Static Public Member Functions

static GAIA_NODISCARD uint16_t start_index (Chunk *pChunk) noexcept
 Returns the first enabled row in a chunk.
 
static GAIA_NODISCARD uint16_t end_index (Chunk *pChunk) noexcept
 Returns the end of the enabled row range in a chunk.
 
static GAIA_NODISCARD uint16_t size (Chunk *pChunk) noexcept
 Returns the number of enabled rows in a chunk.
 

Static Public Attributes

static constexpr Constraints ConstraintMode = Constraints::EnabledOnly
 Enablement constraint applied by this iterator type.
 

Detailed Description

Iterator for iterating entity subsets selected by Constraints. Disabled entities always precede enabled ones in AcceptAll mode.

Member Function Documentation

◆ end_index()

static GAIA_NODISCARD uint16_t gaia::ecs::Iter::end_index ( Chunk pChunk)
inlinestaticnoexcept

Returns the end of the enabled row range in a chunk.

Parameters
pChunkChunk whose enabled range is inspected.
Returns
One-past-the-last enabled row index.

◆ size()

static GAIA_NODISCARD uint16_t gaia::ecs::Iter::size ( Chunk pChunk)
inlinestaticnoexcept

Returns the number of enabled rows in a chunk.

Parameters
pChunkChunk whose enabled range is inspected.
Returns
Number of enabled rows.

◆ size_disabled()

GAIA_NODISCARD uint16_t gaia::ecs::Iter::size_disabled ( ) const
inlinenoexcept

Returns the number of disabled entities accessible via the iterator. Can be read also as "the index of the first enabled entity".

Returns
Number of disabled entities in the current chunk.

◆ size_enabled()

GAIA_NODISCARD uint16_t gaia::ecs::Iter::size_enabled ( ) const
inlinenoexcept

Returns the number of enabled entities accessible via the iterator.

Returns
Number of enabled entities in the current chunk.

◆ start_index()

static GAIA_NODISCARD uint16_t gaia::ecs::Iter::start_index ( Chunk pChunk)
inlinestaticnoexcept

Returns the first enabled row in a chunk.

Parameters
pChunkChunk whose enabled range is inspected.
Returns
Index of the first enabled row.

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