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

Stable query-slot identifier combining a slot index and generation. More...

#include <query_common.h>

Public Member Functions

 QueryHandle (QueryId id, uint32_t gen)
 Constructs a handle from query slot metadata.
 
 QueryHandle (QueryHandle &&) noexcept=default
 
 QueryHandle (const QueryHandle &)=default
 
QueryHandleoperator= (QueryHandle &&) noexcept=default
 
QueryHandleoperator= (const QueryHandle &)=default
 
GAIA_NODISCARD constexpr bool operator== (const QueryHandle &other) const noexcept
 Compares packed query handles.
 
GAIA_NODISCARD constexpr bool operator!= (const QueryHandle &other) const noexcept
 Compares packed query handles for inequality.
 
GAIA_NODISCARD auto id () const
 Returns the query slot identifier.
 
GAIA_NODISCARD auto gen () const
 Returns the query slot generation.
 
GAIA_NODISCARD auto value () const
 Returns the packed handle representation.
 

Static Public Attributes

static constexpr uint32_t IdMask = QueryIdBad
 Bit mask spanning the query-id portion of a packed handle.
 

Detailed Description

Stable query-slot identifier combining a slot index and generation.

Constructor & Destructor Documentation

◆ QueryHandle()

gaia::ecs::QueryHandle::QueryHandle ( QueryId  id,
uint32_t  gen 
)
inline

Constructs a handle from query slot metadata.

Parameters
idQuery slot identifier.
genQuery slot generation.

Member Function Documentation

◆ gen()

GAIA_NODISCARD auto gaia::ecs::QueryHandle::gen ( ) const
inline

Returns the query slot generation.

Returns
Generation stored in the handle.

◆ id()

GAIA_NODISCARD auto gaia::ecs::QueryHandle::id ( ) const
inline

Returns the query slot identifier.

Returns
Query slot identifier stored in the handle.

◆ operator!=()

GAIA_NODISCARD constexpr bool gaia::ecs::QueryHandle::operator!= ( const QueryHandle other) const
inlineconstexprnoexcept

Compares packed query handles for inequality.

Parameters
otherHandle to compare.
Returns
True when slot identifier or generation differs.

◆ operator==()

GAIA_NODISCARD constexpr bool gaia::ecs::QueryHandle::operator== ( const QueryHandle other) const
inlineconstexprnoexcept

Compares packed query handles.

Parameters
otherHandle to compare.
Returns
True when slot identifier and generation match.

◆ value()

GAIA_NODISCARD auto gaia::ecs::QueryHandle::value ( ) const
inline

Returns the packed handle representation.

Returns
Combined query identifier and generation bits.

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