template<typename T>
cubos::core::ecs::QueryFetcher class

Type meant to be specialized which implements for each argument type the necessary logic to extract it from the tables.

Template parameters
T Argument type.

Public static functions

static auto term(World& world) -> QueryTerm
Creates a query term with unspecified targets for the argument type.

Constructors, destructors, conversion operators

QueryFetcher(World& world, const QueryTerm& term)
Called when a query is constructed for the first time.

Public functions

void prepare(const ArchetypeId* targetArchetypes, int depth)
Called when iteration starts for the given archetypes. Always called before fetch(), which may be called multiple times after this.
auto fetch(std::size_t row) -> T
Called to get the actual desired data for a specific match. Always called after prepare() has been called at least once.

Function documentation

template<typename T>
static QueryTerm cubos::core::ecs::QueryFetcher<T>::term(World& world)

Creates a query term with unspecified targets for the argument type.

Parameters
world World being queried.
Returns Term information.

template<typename T>
cubos::core::ecs::QueryFetcher<T>::QueryFetcher(World& world, const QueryTerm& term)

Called when a query is constructed for the first time.

Parameters
world World being queried.
term Term corresponding to the argument being fetched, with specified targets.

template<typename T>
void cubos::core::ecs::QueryFetcher<T>::prepare(const ArchetypeId* targetArchetypes, int depth)

Called when iteration starts for the given archetypes. Always called before fetch(), which may be called multiple times after this.

Parameters
targetArchetypes Pointer to array with the archetype identifiers for the targets.
depth Depth of the sparse relation table, if applicable.

template<typename T>
T cubos::core::ecs::QueryFetcher<T>::fetch(std::size_t row)

Called to get the actual desired data for a specific match. Always called after prepare() has been called at least once.

Parameters
row Row to fetch.