#include <core/ecs/query/fetcher.hpp>
template<typename T>
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
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>
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. |