![]() |
Flecs v4.1
A fast entity component system (ECS) for C & C++
|
Base class for queries. More...
#include <impl.hpp>
Public Member Functions | |
| query_base () | |
| Default constructor. | |
| query_base (query_t *q) | |
| Construct from a mutable query pointer. | |
| query_base (const query_t *q) | |
| Construct from a const query pointer. | |
| query_base (world_t *world, ecs_query_desc_t *desc) | |
| Construct from a world and a query descriptor. | |
| query_base (const query_base &obj) | |
| Copy constructor. | |
| query_base & | operator= (const query_base &obj) |
| Copy assignment operator. | |
| query_base (query_base &&obj) noexcept | |
| Move constructor. | |
| query_base & | operator= (query_base &&obj) noexcept |
| Move assignment operator. | |
| flecs::entity | entity () const |
| Get the entity associated with the query. | |
| const flecs::query_t * | c_ptr () const |
| Get a pointer to the underlying C query. | |
| operator const flecs::query_t * () const | |
| Convert to a const query pointer. | |
| operator bool () const | |
| Check if the query is valid. | |
| void | destruct () |
| Free a persistent query. | |
| ~query_base () | |
| Destructor. | |
| bool | changed () const |
| Return whether the query data changed since the last iteration. | |
| const flecs::query_group_info_t * | group_info (uint64_t group_id) const |
| Get info for a group. | |
| void * | group_ctx (uint64_t group_id) const |
| Get context for a group. | |
| template<typename Func> | |
| void | each_term (const Func &func) |
| Iterate each term in the query, invoking a callback for each. | |
| flecs::term | term (int32_t index) const |
| Get term at the specified index. | |
| int32_t | term_count () const |
| Get the number of terms in the query. | |
| int32_t | field_count () const |
| Get the number of fields in the query. | |
| int32_t | find_var (const char *name) const |
| Find a variable by name. | |
| flecs::string | str () const |
| Convert the query to a string expression. | |
| flecs::string | plan () const |
| Return a string representing the query plan. | |
| operator query<> () const | |
| Convert to a typed query. | |
| flecs::string | to_json (flecs::iter_to_json_desc_t *desc=nullptr) |
| Serialize a query to JSON. | |
| flecs::string | to_json (flecs::iter_to_json_desc_t *desc=nullptr) |
| Serialize a query to JSON. | |
Protected Attributes | |
| query_t * | query_ = nullptr |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
Return 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:
|
inline |
Free a 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.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
Return a string representing the query plan.
This can be used to analyze the behavior and performance of the query.
|
inline |
|
inline |
|
inline |
| flecs::string to_json | ( | flecs::iter_to_json_desc_t * | desc = nullptr | ) |