Skip to content
Flecs v4.1
flecs::term_builder_i< Base > Struct Template Referenceabstract

Term builder interface. More...

#include <builder_i.hpp>

Public Member Functions

 term_builder_i ()
 Default constructor.
 term_builder_i (ecs_term_t *term_ptr)
 Construct from a term pointer.
Base & term (id_t id)
 Set the term ID.
template<typename T = void, typename... Args>
Base & src (Args... args)
template<typename T = void, typename... Args>
Base & first (Args... args)
template<typename T = void, typename... Args>
Base & second (Args... args)
Base & up (flecs::entity_t trav=0)
 The up flag indicates that the term identifier may be substituted by traversing a relationship upwards.
template<typename Trav>
Base & up ()
 Traverse upwards using the specified relationship type.
Base & cascade (flecs::entity_t trav=0)
 The cascade flag is like up(), but returns results in breadth-first order.
template<typename Trav>
Base & cascade ()
 Cascade using the specified relationship type.
Base & desc ()
 Use with cascade() to iterate results in descending (bottom-to-top) order.
Base & parent ()
 Same as up().
Base & trav (flecs::entity_t trav, flecs::flags32_t flags=0)
 Specify the relationship to traverse, and flags to indicate direction.
Base & id_flags (id_t flags)
 Set ID flags for the term.
Base & inout (flecs::inout_kind_t inout)
 Set read/write access of the term.
Base & inout_stage (flecs::inout_kind_t inout)
 Set read/write access for a stage.
Base & write ()
 Short for inout_stage(flecs::Out).
Base & read ()
 Short for inout_stage(flecs::In).
Base & read_write ()
 Short for inout_stage(flecs::InOut).
Base & in ()
 Short for inout(flecs::In).
Base & out ()
 Short for inout(flecs::Out).
Base & inout ()
 Short for inout(flecs::InOut).
Base & inout_none ()
 Short for inout(flecs::InOutNone).
Base & oper (flecs::oper_kind_t oper)
 Set the operator of the term.
Base & and_ ()
 Short for oper(flecs::And).
Base & or_ ()
 Short for oper(flecs::Or).
Base & not_ ()
 Short for oper(flecs::Not).
Base & optional ()
 Short for oper(flecs::Optional).
Base & and_from ()
 Short for oper(flecs::AndFrom).
Base & or_from ()
 Short for oper(flecs::OrFrom).
Base & not_from ()
 Short for oper(flecs::NotFrom).
Base & filter ()
 Mark the term as a filter.
Public Member Functions inherited from flecs::term_ref_builder_i< Base >
 term_ref_builder_i ()
 Default constructor.
virtual ~term_ref_builder_i ()
 Destructor.
Base & self ()
 The self flag indicates that the term identifier itself is used.
Base & id (flecs::entity_t id)
 Specify the value of the identifier by ID.
Base & entity (flecs::entity_t entity)
 Specify the value of the identifier by ID.
Base & name (const char *name)
 Specify the value of the identifier by name.
Base & var (const char *var_name)
 Specify that the identifier is a variable (resolved at query evaluation time).
Base & flags (flecs::flags64_t flags)
 Override the term ID flags.

Public Attributes

ecs_term_tterm_
 Pointer to the current term.
Public Attributes inherited from flecs::term_ref_builder_i< Base >
ecs_term_ref_tterm_ref_
 Pointer to the current term reference.

Protected Member Functions

virtual flecs::world_tworld_v () override=0
void set_term (ecs_term_t *term)
 Set the current term pointer.
Protected Member Functions inherited from flecs::term_ref_builder_i< Base >
void assert_term_ref ()

Detailed Description

template<typename Base>
struct flecs::term_builder_i< Base >

Term builder interface.

A term is a single element of a query expression.

Definition at line 103 of file builder_i.hpp.

Constructor & Destructor Documentation

◆ term_builder_i() [1/2]

template<typename Base>
flecs::term_builder_i< Base >::term_builder_i ( )
inline

Default constructor.

Definition at line 105 of file builder_i.hpp.

◆ term_builder_i() [2/2]

template<typename Base>
flecs::term_builder_i< Base >::term_builder_i ( ecs_term_t * term_ptr)
inline

Construct from a term pointer.

Definition at line 108 of file builder_i.hpp.

Member Function Documentation

◆ and_()

template<typename Base>
Base & flecs::term_builder_i< Base >::and_ ( )
inline

Short for oper(flecs::And).

Definition at line 273 of file builder_i.hpp.

◆ and_from()

template<typename Base>
Base & flecs::term_builder_i< Base >::and_from ( )
inline

Short for oper(flecs::AndFrom).

Definition at line 293 of file builder_i.hpp.

◆ cascade() [1/2]

template<typename Base>
template<typename Trav>
Base & flecs::term_builder_i< Base >::cascade ( )
inline

Cascade using the specified relationship type.

Definition at line 169 of file builder_i.hpp.

◆ cascade() [2/2]

template<typename Base>
Base & flecs::term_builder_i< Base >::cascade ( flecs::entity_t trav = 0)
inline

The cascade flag is like up(), but returns results in breadth-first order.

Only supported for flecs::query.

Definition at line 157 of file builder_i.hpp.

◆ desc()

template<typename Base>
Base & flecs::term_builder_i< Base >::desc ( )
inline

Use with cascade() to iterate results in descending (bottom-to-top) order.

Definition at line 174 of file builder_i.hpp.

◆ filter()

template<typename Base>
Base & flecs::term_builder_i< Base >::filter ( )
inline

Mark the term as a filter.

Query terms marked as a filter are not triggered by observers.

Definition at line 309 of file builder_i.hpp.

◆ first()

template<typename Base>
template<typename T = void, typename... Args>
Base & flecs::term_builder_i< Base >::first ( Args... args)
inline

Definition at line 123 of file builder_i.hpp.

◆ id_flags()

template<typename Base>
Base & flecs::term_builder_i< Base >::id_flags ( id_t flags)
inline

Set ID flags for the term.

Definition at line 194 of file builder_i.hpp.

◆ in()

template<typename Base>
Base & flecs::term_builder_i< Base >::in ( )
inline

Short for inout(flecs::In).

Definition at line 246 of file builder_i.hpp.

◆ inout() [1/2]

template<typename Base>
Base & flecs::term_builder_i< Base >::inout ( )
inline

Short for inout(flecs::InOut).

Definition at line 256 of file builder_i.hpp.

◆ inout() [2/2]

template<typename Base>
Base & flecs::term_builder_i< Base >::inout ( flecs::inout_kind_t inout)
inline

Set read/write access of the term.

Definition at line 201 of file builder_i.hpp.

◆ inout_none()

template<typename Base>
Base & flecs::term_builder_i< Base >::inout_none ( )
inline

Short for inout(flecs::InOutNone).

Definition at line 261 of file builder_i.hpp.

◆ inout_stage()

template<typename Base>
Base & flecs::term_builder_i< Base >::inout_stage ( flecs::inout_kind_t inout)
inline

Set read/write access for a stage.

Use this when a system reads or writes components other than the ones provided by the query. This information can be used by schedulers to insert sync/merge points between systems where deferred operations are flushed.

Setting this is optional. If not set, the value of the accessed component may be out of sync for at most one frame.

Definition at line 215 of file builder_i.hpp.

◆ not_()

template<typename Base>
Base & flecs::term_builder_i< Base >::not_ ( )
inline

Short for oper(flecs::Not).

Definition at line 283 of file builder_i.hpp.

◆ not_from()

template<typename Base>
Base & flecs::term_builder_i< Base >::not_from ( )
inline

Short for oper(flecs::NotFrom).

Definition at line 303 of file builder_i.hpp.

◆ oper()

template<typename Base>
Base & flecs::term_builder_i< Base >::oper ( flecs::oper_kind_t oper)
inline

Set the operator of the term.

Definition at line 266 of file builder_i.hpp.

◆ optional()

template<typename Base>
Base & flecs::term_builder_i< Base >::optional ( )
inline

Short for oper(flecs::Optional).

Definition at line 288 of file builder_i.hpp.

◆ or_()

template<typename Base>
Base & flecs::term_builder_i< Base >::or_ ( )
inline

Short for oper(flecs::Or).

Definition at line 278 of file builder_i.hpp.

◆ or_from()

template<typename Base>
Base & flecs::term_builder_i< Base >::or_from ( )
inline

Short for oper(flecs::OrFrom).

Definition at line 298 of file builder_i.hpp.

◆ out()

template<typename Base>
Base & flecs::term_builder_i< Base >::out ( )
inline

Short for inout(flecs::Out).

Definition at line 251 of file builder_i.hpp.

◆ parent()

template<typename Base>
Base & flecs::term_builder_i< Base >::parent ( )
inline

Same as up().

Exists for backwards compatibility.

Definition at line 181 of file builder_i.hpp.

◆ read()

template<typename Base>
Base & flecs::term_builder_i< Base >::read ( )
inline

Short for inout_stage(flecs::In).

Use when the system uses get().

Definition at line 234 of file builder_i.hpp.

◆ read_write()

template<typename Base>
Base & flecs::term_builder_i< Base >::read_write ( )
inline

Short for inout_stage(flecs::InOut).

Use when the system uses ensure().

Definition at line 241 of file builder_i.hpp.

◆ second()

template<typename Base>
template<typename T = void, typename... Args>
Base & flecs::term_builder_i< Base >::second ( Args... args)
inline

Definition at line 128 of file builder_i.hpp.

◆ set_term()

template<typename Base>
void flecs::term_builder_i< Base >::set_term ( ecs_term_t * term)
inlineprotected

Set the current term pointer.

Definition at line 321 of file builder_i.hpp.

◆ src()

template<typename Base>
template<typename T = void, typename... Args>
Base & flecs::term_builder_i< Base >::src ( Args... args)
inline

Definition at line 118 of file builder_i.hpp.

◆ term()

template<typename Base>
Base & flecs::term_builder_i< Base >::term ( id_t id)
inline

Set the term ID.

Definition at line 113 of file builder_i.hpp.

◆ trav()

template<typename Base>
Base & flecs::term_builder_i< Base >::trav ( flecs::entity_t trav,
flecs::flags32_t flags = 0 )
inline

Specify the relationship to traverse, and flags to indicate direction.

Definition at line 186 of file builder_i.hpp.

◆ up() [1/2]

template<typename Base>
template<typename Trav>
Base & flecs::term_builder_i< Base >::up ( )
inline

Traverse upwards using the specified relationship type.

Definition at line 151 of file builder_i.hpp.

◆ up() [2/2]

template<typename Base>
Base & flecs::term_builder_i< Base >::up ( flecs::entity_t trav = 0)
inline

The up flag indicates that the term identifier may be substituted by traversing a relationship upwards.

For example, substitute the identifier with its parent by traversing the ChildOf relationship.

Definition at line 135 of file builder_i.hpp.

◆ world_v()

template<typename Base>
virtual flecs::world_t * flecs::term_builder_i< Base >::world_v ( )
overrideprotectedpure virtual

◆ write()

template<typename Base>
Base & flecs::term_builder_i< Base >::write ( )
inline

Short for inout_stage(flecs::Out).

Use when the system uses add(), remove(), or set().

Definition at line 227 of file builder_i.hpp.

Member Data Documentation

◆ term_

template<typename Base>
ecs_term_t* flecs::term_builder_i< Base >::term_

Pointer to the current term.

Definition at line 315 of file builder_i.hpp.


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