Flecs v4.0
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 (query_t *q)
 
 query_base (const query_t *q)
 
 query_base (world_t *world, ecs_query_desc_t *desc)
 
 query_base (const query_base &obj)
 
query_baseoperator= (const query_base &obj)
 
 query_base (query_base &&obj) noexcept
 
query_baseoperator= (query_base &&obj) noexcept
 
flecs::entity entity ()
 
const flecs::query_tc_ptr () const
 
 operator const flecs::query_t * () const
 
 operator bool () const
 
void destruct ()
 Free persistent query.
 
bool changed () const
 Returns whether the query data changed since the last iteration.
 
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.
 
template<typename Func >
void each_term (const Func &func)
 
flecs::term term (int32_t index)
 
int32_t term_count ()
 
int32_t field_count ()
 
int32_t find_var (const char *name)
 
flecs::string str ()
 
flecs::string plan () const
 Returns a string representing the query plan.
 
 operator query<> () const
 
flecs::string to_json (flecs::iter_to_json_desc_t *desc=nullptr)
 Serialize query to JSON.
 

Protected Attributes

query_tquery_ = nullptr
 

Detailed Description

Definition at line 13 of file impl.hpp.

Constructor & Destructor Documentation

◆ query_base() [1/6]

flecs::query_base::query_base ( )
inline

Definition at line 14 of file impl.hpp.

◆ query_base() [2/6]

flecs::query_base::query_base ( query_t * q)
inline

Definition at line 16 of file impl.hpp.

◆ query_base() [3/6]

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

Definition at line 21 of file impl.hpp.

◆ query_base() [4/6]

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

Definition at line 26 of file impl.hpp.

◆ query_base() [5/6]

flecs::query_base::query_base ( const query_base & obj)
inline

Definition at line 40 of file impl.hpp.

◆ query_base() [6/6]

flecs::query_base::query_base ( query_base && obj)
inlinenoexcept

Definition at line 51 of file impl.hpp.

◆ ~query_base()

flecs::query_base::~query_base ( )
inline

Definition at line 90 of file impl.hpp.

Member Function Documentation

◆ c_ptr()

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

Definition at line 66 of file impl.hpp.

◆ 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 112 of file impl.hpp.

◆ destruct()

void flecs::query_base::destruct ( )
inline

Free persistent query.

A persistent query is a query that is associated with an entity, such as system queries and named queries. Persistent queries must be deleted with destruct(), or will be deleted automatically at world cleanup.

Definition at line 83 of file impl.hpp.

◆ each_term()

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

Definition at line 140 of file impl.hpp.

◆ entity()

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

Definition at line 62 of file impl.hpp.

◆ field_count()

int32_t flecs::query_base::field_count ( )
inline

Definition at line 156 of file impl.hpp.

◆ find_var()

int32_t flecs::query_base::find_var ( const char * name)
inline

Definition at line 160 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 130 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 121 of file impl.hpp.

◆ operator bool()

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

Definition at line 74 of file impl.hpp.

◆ operator const flecs::query_t *()

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

Definition at line 70 of file impl.hpp.

◆ operator=() [1/2]

query_base & flecs::query_base::operator= ( const query_base & obj)
inline

Definition at line 45 of file impl.hpp.

◆ operator=() [2/2]

query_base & flecs::query_base::operator= ( query_base && obj)
inlinenoexcept

Definition at line 56 of file impl.hpp.

◆ plan()

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

Returns a string representing the query plan.

This can be used to analyze the behavior & performance of the query.

See also
ecs_query_plan

Definition at line 173 of file impl.hpp.

◆ str()

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

Definition at line 164 of file impl.hpp.

◆ term()

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

Definition at line 148 of file impl.hpp.

◆ term_count()

int32_t flecs::query_base::term_count ( )
inline

Definition at line 152 of file impl.hpp.

Member Data Documentation

◆ query_

query_t* flecs::query_base::query_ = nullptr
protected

Definition at line 185 of file impl.hpp.


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