Base class for queries.
More...
#include <impl.hpp>
Base class for queries.
Definition at line 17 of file impl.hpp.
◆ query_base() [1/6]
| flecs::query_base::query_base |
( |
| ) |
|
|
inline |
Default constructor.
Definition at line 19 of file impl.hpp.
◆ query_base() [2/6]
| flecs::query_base::query_base |
( |
query_t * | q | ) |
|
|
inline |
Construct from a mutable query pointer.
Definition at line 22 of file impl.hpp.
◆ query_base() [3/6]
| flecs::query_base::query_base |
( |
const query_t * | q | ) |
|
|
inline |
Construct from a const query pointer.
Definition at line 28 of file impl.hpp.
◆ query_base() [4/6]
Construct from a world and a query descriptor.
Definition at line 34 of file impl.hpp.
◆ query_base() [5/6]
| flecs::query_base::query_base |
( |
const query_base & | obj | ) |
|
|
inline |
Copy constructor.
Definition at line 49 of file impl.hpp.
◆ query_base() [6/6]
| flecs::query_base::query_base |
( |
query_base && | obj | ) |
|
|
inlinenoexcept |
Move constructor.
Definition at line 69 of file impl.hpp.
◆ ~query_base()
| flecs::query_base::~query_base |
( |
| ) |
|
|
inline |
Destructor.
Only frees the query if it is not associated with an entity.
Definition at line 114 of file impl.hpp.
◆ c_ptr()
Get a pointer to the underlying C query.
Definition at line 87 of file impl.hpp.
◆ changed()
| bool flecs::query_base::changed |
( |
| ) |
const |
|
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:
- new entities have been matched with
- matched entities were deleted
- matched components were changed
- Returns
- true if entities changed, otherwise false.
Definition at line 132 of file impl.hpp.
◆ destruct()
| void flecs::query_base::destruct |
( |
| ) |
|
|
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.
Definition at line 106 of file impl.hpp.
◆ each_term()
template<typename Func >
| void flecs::query_base::each_term |
( |
const Func & | func | ) |
|
|
inline |
Iterate each term in the query, invoking a callback for each.
Definition at line 161 of file impl.hpp.
◆ entity()
Get the entity associated with the query.
Definition at line 82 of file impl.hpp.
◆ field_count()
| int32_t flecs::query_base::field_count |
( |
| ) |
const |
|
inline |
Get the number of fields in the query.
Definition at line 180 of file impl.hpp.
◆ find_var()
| int32_t flecs::query_base::find_var |
( |
const char * | name | ) |
const |
|
inline |
Find a variable by name.
Definition at line 185 of file impl.hpp.
◆ group_ctx()
| void * flecs::query_base::group_ctx |
( |
uint64_t | group_id | ) |
const |
|
inline |
Get context for a group.
- Parameters
-
| group_id | The group ID for which to retrieve the context. |
- Returns
- The group context.
Definition at line 150 of file impl.hpp.
◆ group_info()
Get info for a group.
- Parameters
-
| group_id | The group ID for which to retrieve the info. |
- Returns
- The group info.
Definition at line 141 of file impl.hpp.
◆ operator bool()
| flecs::query_base::operator bool |
( |
| ) |
const |
|
inline |
Check if the query is valid.
Definition at line 97 of file impl.hpp.
◆ operator const flecs::query_t *()
Convert to a const query pointer.
Definition at line 92 of file impl.hpp.
◆ operator=() [1/2]
Copy assignment operator.
Definition at line 58 of file impl.hpp.
◆ operator=() [2/2]
Move assignment operator.
Definition at line 75 of file impl.hpp.
◆ plan()
Return a string representing the query plan.
This can be used to analyze the behavior and performance of the query.
- See also
- ecs_query_plan()
Definition at line 199 of file impl.hpp.
◆ str()
Convert the query to a string expression.
Definition at line 190 of file impl.hpp.
◆ term()
| flecs::term flecs::query_base::term |
( |
int32_t | index | ) |
const |
|
inline |
Get term at the specified index.
Definition at line 170 of file impl.hpp.
◆ term_count()
| int32_t flecs::query_base::term_count |
( |
| ) |
const |
|
inline |
Get the number of terms in the query.
Definition at line 175 of file impl.hpp.
◆ query_
| query_t* flecs::query_base::query_ = nullptr |
|
protected |
The documentation for this struct was generated from the following files:
- include/flecs/addons/cpp/mixins/query/impl.hpp
- include/flecs/addons/cpp/mixins/json/query.inl