Flecs: flecs::term Struct Reference
Description: A fast entity component system (ECS) for C & C++

| Flecs v4.1 A fast entity component system (ECS) for C & C++

Loading...
Searching...
No Matches
flecs::term Struct Referencefinal
C++ API » Core » Queries

Class that describes a term. More...

`#include <impl.hpp>`

Inheritance diagram for flecs::term:
[legend]

## Public Member Functions
| term ()
| Default constructor.
| term (flecs::world_t *world_ptr)
| Construct from a world.
| term (flecs::world_t *world_ptr, ecs_term_t t)
| Construct from a world and an existing term descriptor.
| term (flecs::world_t *world_ptr, id_t component_id)
| Construct from a world and a component ID.
| term (flecs::world_t *world_ptr, entity_t first, entity_t second)
| Construct from a world and a pair of entity IDs.
| term (id_t component_id)
| Construct from a component ID (no world).
| term (id_t first, id_t second)
| Construct from a pair of IDs (no world).
void | reset ()
| Reset the term to its default state.
bool | is_set ()
| Check if the term is initialized.
flecs::id | id ()
| Get the term ID.
flecs::inout_kind_t | inout ()
| Get the inout kind of the term.
flecs::oper_kind_t | oper ()
| Get the operator kind of the term.
flecs::entity | get_src ()
| Get the source entity of the term.
flecs::entity | get_first ()
| Get the first element of the term.
flecs::entity | get_second ()
| Get the second element of the term.
| operator flecs::term_t () const
| Convert to the underlying term_t.
Public Member Functions inherited from flecs::term_builder_i< term >
| term_builder_i ()
| Default constructor.
term & | term (id_t id)
| Set the term ID.
term & | src ()
| Call prior to setting values for the src identifier.
term & | first ()
| Call prior to setting values for the first identifier.
term & | second ()
| Call prior to setting values for the second identifier.
term & | up (flecs::entity_t trav=0)
| The up flag indicates that the term identifier may be substituted by traversing a relationship upwards.
term & | cascade (flecs::entity_t trav=0)
| The cascade flag is like up(), but returns results in breadth-first order.
term & | desc ()
| Use with cascade() to iterate results in descending (bottom-to-top) order.
term & | parent ()
| Same as up().
term & | trav (flecs::entity_t trav, flecs::flags32_t flags=0)
| Specify the relationship to traverse, and flags to indicate direction.
term & | id_flags (id_t flags)
| Set ID flags for the term.
term & | inout (flecs::inout_kind_t inout)
| Set read/write access of the term.
term & | inout_stage (flecs::inout_kind_t inout)
| Set read/write access for a stage.
term & | write ()
| Short for inout_stage(flecs::Out).
term & | read ()
| Short for inout_stage(flecs::In).
term & | read_write ()
| Short for inout_stage(flecs::InOut).
term & | in ()
| Short for inout(flecs::In).
term & | out ()
| Short for inout(flecs::Out).
term & | inout_none ()
| Short for inout(flecs::InOutNone).
term & | oper (flecs::oper_kind_t oper)
| Set the operator of the term.
term & | and_ ()
| Short for oper(flecs::And).
term & | or_ ()
| Short for oper(flecs::Or).
term & | not_ ()
| Short for oper(flecs::Not).
term & | optional ()
| Short for oper(flecs::Optional).
term & | and_from ()
| Short for oper(flecs::AndFrom).
term & | or_from ()
| Short for oper(flecs::OrFrom).
term & | not_from ()
| Short for oper(flecs::NotFrom).
term & | filter ()
| Mark the term as a filter.
Public Member Functions inherited from flecs::term_ref_builder_i< term >
| term_ref_builder_i ()
| Default constructor.
virtual | ~term_ref_builder_i ()
| Destructor.
term & | self ()
| The self flag indicates that the term identifier itself is used.
term & | id (flecs::entity_t id)
| Specify the value of the identifier by ID.
term & | entity (flecs::entity_t entity)
| Specify the value of the identifier by ID.
term & | name (const char *name)
| Specify the value of the identifier by name.
term & | var (const char *var_name)
| Specify that the identifier is a variable (resolved at query evaluation time).
term & | flags (flecs::flags64_t flags)
| Override the term ID flags.

## Public Attributes
flecs::term_t | value
| The underlying term value.
Public Attributes inherited from flecs::term_builder_i< term >
ecs_term_t * | term_
| Pointer to the current term.
Public Attributes inherited from flecs::term_ref_builder_i< term >
ecs_term_ref_t * | term_ref_
| Pointer to the current term reference.

## Protected Member Functions
flecs::world_t * | world_v () override
Protected Member Functions inherited from flecs::term_builder_i< term >
void | set_term (ecs_term_t *term)
| Set the current term pointer.
Protected Member Functions inherited from flecs::term_ref_builder_i< term >
void | assert_term_ref ()

## Detailed Description

Class that describes a term.

Definition at line 16 of file impl.hpp.

## Constructor & Destructor Documentation

## ◆ term() [1/7]

flecs::term::term | ( |  | ) |
| inline

Default constructor.

Definition at line 18 of file impl.hpp.

## ◆ term() [2/7]

flecs::term::term | ( | flecs::world_t * | world_ptr | ) |
| inline

Construct from a world.

Definition at line 24 of file impl.hpp.

## ◆ term() [3/7]

flecs::term::term | ( | flecs::world_t * | world_ptr,
|  | ecs_term_t | t )
| inline

Construct from a world and an existing term descriptor.

Definition at line 30 of file impl.hpp.

## ◆ term() [4/7]

flecs::term::term | ( | flecs::world_t * | world_ptr,
|  | id_t | component_id )
| inline

Construct from a world and a component ID.

Definition at line 39 of file impl.hpp.

## ◆ term() [5/7]

flecs::term::term | ( | flecs::world_t * | world_ptr,
|  | entity_t | first,
|  | entity_t | second )
| inline

Construct from a world and a pair of entity IDs.

Definition at line 52 of file impl.hpp.

## ◆ term() [6/7]

flecs::term::term | ( | id_t | component_id | ) |
| inline

Construct from a component ID (no world).

Definition at line 61 of file impl.hpp.

## ◆ term() [7/7]

flecs::term::term | ( | id_t | first,
|  | id_t | second )
| inline

Construct from a pair of IDs (no world).

Definition at line 73 of file impl.hpp.

## Member Function Documentation

## ◆ get_first()

flecs::entity flecs::term::get_first | ( |  | ) |
| inline

Get the first element of the term.

Definition at line 113 of file impl.hpp.

## ◆ get_second()

flecs::entity flecs::term::get_second | ( |  | ) |
| inline

Get the second element of the term.

Definition at line 118 of file impl.hpp.

## ◆ get_src()

flecs::entity flecs::term::get_src | ( |  | ) |
| inline

Get the source entity of the term.

Definition at line 108 of file impl.hpp.

## ◆ id()

flecs::id flecs::term::id | ( |  | ) |
| inline

Get the term ID.

Definition at line 93 of file impl.hpp.

## ◆ inout()

flecs::inout_kind_t flecs::term::inout | ( |  | ) |
| inline

Get the inout kind of the term.

Definition at line 98 of file impl.hpp.

## ◆ is_set()

bool flecs::term::is_set | ( |  | ) |
| inline

Check if the term is initialized.

Definition at line 88 of file impl.hpp.

## ◆ oper()

flecs::oper_kind_t flecs::term::oper | ( |  | ) |
| inline

Get the operator kind of the term.

Definition at line 103 of file impl.hpp.

## ◆ operator flecs::term_t()

flecs::term::operator flecs::term_t | ( |  | ) | const
| inline

Convert to the underlying term_t.

Definition at line 123 of file impl.hpp.

## ◆ reset()

void flecs::term::reset | ( |  | ) |
| inline

Reset the term to its default state.

Definition at line 82 of file impl.hpp.

## ◆ world_v()

flecs::world_t * flecs::term::world_v | ( |  | ) |
| inlineoverrideprotectedvirtual

Implements flecs::term_builder_i< term >.

Definition at line 131 of file impl.hpp.

## Member Data Documentation

## ◆ value

flecs::term_t flecs::term::value

The underlying term value.

Definition at line 128 of file impl.hpp.

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

- include/flecs/addons/cpp/mixins/term/impl.hpp