20 , m_world(
nullptr) { value.
move =
true; }
22 term(flecs::world_t *world_ptr)
25 , m_world(world_ptr) { value.
move =
true; }
30 , m_world(world_ptr) {
33 this->set_term(&value);
36 term(flecs::world_t *world_ptr, id_t
id)
39 , m_world(world_ptr) {
40 if (
id & ECS_ID_FLAGS_MASK) {
46 this->set_term(&value);
49 term(flecs::world_t *world_ptr, entity_t r, entity_t o)
52 , m_world(world_ptr) {
53 value.
id = ecs_pair(r, o);
55 this->set_term(&value);
62 if (
id & ECS_ID_FLAGS_MASK) {
74 value.
id = ecs_pair(r, o);
81 this->set_term(&value);
88 this->set_term(&value);
92 ecs_assert(m_world == t.m_world, ECS_INVALID_PARAMETER, NULL);
95 this->set_term(&value);
100 ecs_assert(m_world == t.m_world, ECS_INVALID_PARAMETER, NULL);
103 this->set_term(&value);
114 this->set_term(
nullptr);
129 flecs::inout_kind_t inout() {
130 return static_cast<flecs::inout_kind_t
>(value.
inout);
133 flecs::oper_kind_t oper() {
134 return static_cast<flecs::oper_kind_t
>(value.
oper);
156 flecs::world_t* world_v()
override {
return m_world; }
159 flecs::world_t *m_world;
163template <
typename... Args>
170 return flecs::term(m_world, _::cpp_type<T>::id(m_world));
173template <
typename First,
typename Second>
176 _::cpp_type<First>::id(m_world),
177 _::cpp_type<Second>::id(m_world)));
#define ecs_assert(condition, error_code,...)
Assert.
flecs::term term(Args &&... args) const
Create a term.
ecs_term_t ecs_term_copy(const ecs_term_t *src)
Copy resources of a term to another term.
void ecs_term_fini(ecs_term_t *term)
Free resources of term.
int ecs_term_finalize(const ecs_world_t *world, ecs_term_t *term)
Finalize term.
bool ecs_term_is_initialized(const ecs_term_t *term)
Test whether a term is set.
ecs_term_t ecs_term_move(ecs_term_t *src)
Move resources of a term to another term.
ecs_entity_t id
Entity id.
Type that describes a term (single element in a query)
ecs_term_id_t second
Second element of pair.
ecs_id_t id
Component id to be matched by term.
ecs_term_id_t src
Source of term.
ecs_term_id_t first
Component or first element of pair.
bool move
Used by internals.
ecs_inout_kind_t inout
Access to contents matched by term.
ecs_oper_kind_t oper
Operator of term.
Class that wraps around a flecs::id_t.
Class that describes a term.