Flecs v4.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
flecs::sparse_query< Components > Struct Template Reference

Query that iterates sparse component storages directly. More...

#include <sparse_query.hpp>

Public Member Functions

 sparse_query (flecs::world_t *world)
 
template<typename Func >
void each (Func &&func) const
 Iterate the query.
 
int32_t count () const
 Return the number of entities matched by the query.
 
 operator flecs::query< Components... > () const
 Convert to a regular flecs::query for the same components.
 

Detailed Description

template<typename ... Components>
struct flecs::sparse_query< Components >

Query that iterates sparse component storages directly.

Returned by world::query() when all components have the dont_fragment trait and don't declare the on_instantiate::inherit policy.

Definition at line 27 of file sparse_query.hpp.

Constructor & Destructor Documentation

◆ sparse_query()

template<typename ... Components>
flecs::sparse_query< Components >::sparse_query ( flecs::world_t * world)
inlineexplicit

Definition at line 32 of file sparse_query.hpp.

Member Function Documentation

◆ count()

template<typename ... Components>
int32_t flecs::sparse_query< Components >::count ( ) const
inline

Return the number of entities matched by the query.

Definition at line 48 of file sparse_query.hpp.

◆ each()

template<typename ... Components>
template<typename Func >
void flecs::sparse_query< Components >::each ( Func && func) const
inline

Iterate the query.

The function signature must match func(flecs::entity e, Components&...) or func(Components&...).

Definition at line 43 of file sparse_query.hpp.

◆ operator flecs::query< Components... >()

template<typename ... Components>
flecs::sparse_query< Components >::operator flecs::query< Components... > ( ) const
inline

Convert to a regular flecs::query for the same components.

Definition at line 336 of file impl.hpp.


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