Flecs v4.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
flecs::event_builder_base< Base, E > Struct Template Reference

Event builder interface. More...

#include <builder.hpp>

Public Member Functions

 event_builder_base (flecs::world_t *world, flecs::entity_t event)
 
template<typename T >
Base & id ()
 Add a component to emit for.
 
template<typename First , typename Second >
Base & id ()
 Add a pair to emit for.
 
template<typename First >
Base & id (entity_t second)
 Add a pair to emit for.
 
Base & id (entity_t first, entity_t second)
 Add a pair to emit for.
 
template<typename Enum , if_t< is_enum< Enum >::value > = 0>
Base & id (Enum value)
 Add an enum constant to emit for.
 
Base & id (flecs::id_t id)
 Add a (component) ID to emit for.
 
Base & entity (flecs::entity_t e)
 Set the entity for which to emit the event.
 
Base & table (flecs::table_t *t, int32_t offset=0, int32_t count=0)
 Set the table for which to emit the event.
 
Base & ctx (const E *ptr)
 Set event data (const).
 
Base & ctx (E *ptr)
 Set event data (mutable).
 
void emit ()
 Emit the event.
 
void enqueue ()
 Enqueue the event.
 

Protected Attributes

flecs::world_tworld_
 
ecs_event_desc_t desc_
 
flecs::type_t ids_
 
flecs::id_t ids_array_ [(8)]
 

Detailed Description

template<typename Base, typename E>
struct flecs::event_builder_base< Base, E >

Event builder interface.

Definition at line 19 of file builder.hpp.

Constructor & Destructor Documentation

◆ event_builder_base()

template<typename Base , typename E >
flecs::event_builder_base< Base, E >::event_builder_base ( flecs::world_t * world,
flecs::entity_t event )
inline

Definition at line 20 of file builder.hpp.

Member Function Documentation

◆ ctx() [1/2]

template<typename Base , typename E >
Base & flecs::event_builder_base< Base, E >::ctx ( const E * ptr)
inline

Set event data (const).

Definition at line 104 of file builder.hpp.

◆ ctx() [2/2]

template<typename Base , typename E >
Base & flecs::event_builder_base< Base, E >::ctx ( E * ptr)
inline

Set event data (mutable).

Definition at line 110 of file builder.hpp.

◆ emit()

template<typename Base , typename E >
void flecs::event_builder_base< Base, E >::emit ( )
inline

Emit the event.

Definition at line 116 of file builder.hpp.

◆ enqueue()

template<typename Base , typename E >
void flecs::event_builder_base< Base, E >::enqueue ( )
inline

Enqueue the event.

Definition at line 124 of file builder.hpp.

◆ entity()

template<typename Base , typename E >
Base & flecs::event_builder_base< Base, E >::entity ( flecs::entity_t e)
inline

Set the entity for which to emit the event.

Definition at line 90 of file builder.hpp.

◆ id() [1/6]

template<typename Base , typename E >
template<typename T >
Base & flecs::event_builder_base< Base, E >::id ( )
inline

Add a component to emit for.

Definition at line 31 of file builder.hpp.

◆ id() [2/6]

template<typename Base , typename E >
template<typename First , typename Second >
Base & flecs::event_builder_base< Base, E >::id ( )
inline

Add a pair to emit for.

Template Parameters
FirstThe first element of the pair.
SecondThe second element of the pair.

Definition at line 44 of file builder.hpp.

◆ id() [3/6]

template<typename Base , typename E >
Base & flecs::event_builder_base< Base, E >::id ( entity_t first,
entity_t second )
inline

Add a pair to emit for.

Parameters
firstThe first element of the pair.
secondThe second element of the pair.

Definition at line 65 of file builder.hpp.

◆ id() [4/6]

template<typename Base , typename E >
template<typename First >
Base & flecs::event_builder_base< Base, E >::id ( entity_t second)
inline

Add a pair to emit for.

Template Parameters
FirstThe first element of the pair.
Parameters
secondThe second element of the pair.

Definition at line 56 of file builder.hpp.

◆ id() [5/6]

template<typename Base , typename E >
template<typename Enum , if_t< is_enum< Enum >::value > = 0>
Base & flecs::event_builder_base< Base, E >::id ( Enum value)
inline

Add an enum constant to emit for.

Template Parameters
EnumThe enum type.
Parameters
valueThe enum constant value.

Definition at line 75 of file builder.hpp.

◆ id() [6/6]

template<typename Base , typename E >
Base & flecs::event_builder_base< Base, E >::id ( flecs::id_t id)
inline

Add a (component) ID to emit for.

Definition at line 82 of file builder.hpp.

◆ table()

template<typename Base , typename E >
Base & flecs::event_builder_base< Base, E >::table ( flecs::table_t * t,
int32_t offset = 0,
int32_t count = 0 )
inline

Set the table for which to emit the event.

Definition at line 96 of file builder.hpp.

Member Data Documentation

◆ desc_

template<typename Base , typename E >
ecs_event_desc_t flecs::event_builder_base< Base, E >::desc_
protected

Definition at line 133 of file builder.hpp.

◆ ids_

template<typename Base , typename E >
flecs::type_t flecs::event_builder_base< Base, E >::ids_
protected

Definition at line 134 of file builder.hpp.

◆ ids_array_

template<typename Base , typename E >
flecs::id_t flecs::event_builder_base< Base, E >::ids_array_[(8)]
protected

Definition at line 135 of file builder.hpp.

◆ world_

template<typename Base , typename E >
flecs::world_t* flecs::event_builder_base< Base, E >::world_
protected

Definition at line 132 of file builder.hpp.


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