Flecs v3.2
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
flecs::query_base Struct Reference
Inheritance diagram for flecs::query_base:
[legend]

Public Member Functions

 query_base (world_t *world, query_t *query=nullptr)
 
 query_base (world_t *world, ecs_query_desc_t *desc)
 
 operator query_t * () const
 
bool changed () const
 Returns whether the query data changed since the last iteration.
 
bool orphaned () const
 Returns whether query is orphaned.
 
const flecs::query_group_info_tgroup_info (uint64_t group_id) const
 Get info for group.
 
void * group_ctx (uint64_t group_id) const
 Get context for group.
 
void destruct ()
 Free the query.
 
template<typename Func >
void each_term (const Func &func) const
 
filter_base filter () const
 
flecs::term term (int32_t index) const
 
int32_t field_count () const
 
flecs::string str () const
 
flecs::entity entity () const
 
 operator query<> () const
 

Protected Attributes

world_t * m_world
 
query_t * m_query
 

Detailed Description

Definition at line 16 of file impl.hpp.

Constructor & Destructor Documentation

◆ query_base() [1/3]

flecs::query_base::query_base ( )
inline

Definition at line 17 of file impl.hpp.

◆ query_base() [2/3]

flecs::query_base::query_base ( world_t * world,
query_t * query = nullptr )
inline

Definition at line 21 of file impl.hpp.

◆ query_base() [3/3]

flecs::query_base::query_base ( world_t * world,
ecs_query_desc_t * desc )
inline

Definition at line 25 of file impl.hpp.

Member Function Documentation

◆ changed()

bool flecs::query_base::changed ( ) const
inline

Returns whether the query data changed since the last iteration.

This operation must be invoked before obtaining the iterator, as this will reset the changed state. The operation will return true after:

  • new entities have been matched with
  • matched entities were deleted
  • matched components were changed
Returns
true if entities changed, otherwise false.

Definition at line 52 of file impl.hpp.

◆ destruct()

void flecs::query_base::destruct ( )
inline

Free the query.

Definition at line 92 of file impl.hpp.

◆ each_term()

template<typename Func >
void flecs::query_base::each_term ( const Func & func) const
inline

Definition at line 99 of file impl.hpp.

◆ entity()

flecs::entity flecs::query_base::entity ( ) const
inline

Definition at line 124 of file impl.hpp.

◆ field_count()

int32_t flecs::query_base::field_count ( ) const
inline

Definition at line 113 of file impl.hpp.

◆ filter()

filter_base flecs::query_base::filter ( ) const
inline

Definition at line 103 of file impl.hpp.

◆ group_ctx()

void * flecs::query_base::group_ctx ( uint64_t group_id) const
inline

Get context for group.

Parameters
group_idThe group id for which to retrieve the context.
Returns
The group context.

Definition at line 81 of file impl.hpp.

◆ group_info()

const flecs::query_group_info_t * flecs::query_base::group_info ( uint64_t group_id) const
inline

Get info for group.

Parameters
group_idThe group id for which to retrieve the info.
Returns
The group info.

Definition at line 72 of file impl.hpp.

◆ operator query<>()

flecs::query_base::operator query<> ( ) const
inline

Definition at line 184 of file impl.hpp.

◆ operator query_t *()

flecs::query_base::operator query_t * ( ) const
inline

Definition at line 39 of file impl.hpp.

◆ orphaned()

bool flecs::query_base::orphaned ( ) const
inline

Returns whether query is orphaned.

When the parent query of a subquery is deleted, it is left in an orphaned state. The only valid operation on an orphaned query is deleting it. Only subqueries can be orphaned.

Returns
true if query is orphaned, otherwise false.

Definition at line 63 of file impl.hpp.

◆ str()

flecs::string flecs::query_base::str ( ) const
inline

Definition at line 118 of file impl.hpp.

◆ term()

flecs::term flecs::query_base::term ( int32_t index) const
inline

Definition at line 107 of file impl.hpp.

Member Data Documentation

◆ m_query

query_t* flecs::query_base::m_query
protected

Definition at line 132 of file impl.hpp.

◆ m_world

world_t* flecs::query_base::m_world
protected

Definition at line 131 of file impl.hpp.


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