![]() |
Flecs v4.1
A fast entity component system (ECS) for C & C++
|
Used with ecs_observer_init(). More...
#include <flecs.h>
Public Attributes | |
| int32_t | _canary |
| Used for validity testing. | |
| ecs_entity_t | entity |
| Existing entity to associate with an observer (optional). | |
| ecs_query_desc_t | query |
| Query for observer. | |
| ecs_entity_t | events [8] |
| Events to observe (OnAdd, OnRemove, OnSet). | |
| bool | yield_existing |
| When an observer is created, generate events from existing data. | |
| bool | global_observer |
| Global observers are tied to the lifespan of the world. | |
| ecs_iter_action_t | callback |
| Callback to invoke on an event, invoked when the observer matches. | |
| ecs_run_action_t | run |
| Callback invoked on an event. | |
| void * | ctx |
| User context to pass to callback. | |
| ecs_ctx_free_t | ctx_free |
| Callback to free ctx. | |
| void * | callback_ctx |
| Context associated with callback (for language bindings). | |
| ecs_ctx_free_t | callback_ctx_free |
| Callback to free callback ctx. | |
| void * | run_ctx |
| Context associated with run (for language bindings). | |
| ecs_ctx_free_t | run_ctx_free |
| Callback to free run ctx. | |
| int32_t * | last_event_id |
| Used for internal purposes. | |
| int8_t | term_index_ |
| Used for internal purposes. | |
| ecs_flags32_t | flags_ |
| Used for internal purposes. | |
Used with ecs_observer_init().
| int32_t ecs_observer_desc_t::_canary |
| ecs_iter_action_t ecs_observer_desc_t::callback |
| void* ecs_observer_desc_t::callback_ctx |
| ecs_ctx_free_t ecs_observer_desc_t::callback_ctx_free |
| void* ecs_observer_desc_t::ctx |
| ecs_ctx_free_t ecs_observer_desc_t::ctx_free |
| ecs_entity_t ecs_observer_desc_t::entity |
| ecs_entity_t ecs_observer_desc_t::events[8] |
| ecs_flags32_t ecs_observer_desc_t::flags_ |
| bool ecs_observer_desc_t::global_observer |
Global observers are tied to the lifespan of the world.
Creating a global observer does not create an entity, and therefore ecs_observer_init() will not return an entity handle.
| int32_t* ecs_observer_desc_t::last_event_id |
| ecs_query_desc_t ecs_observer_desc_t::query |
| ecs_run_action_t ecs_observer_desc_t::run |
Callback invoked on an event.
When left to NULL, the default runner is used, which matches the event with the observer's query, and calls 'callback' when it matches. A reason to override the run function is to improve performance, if there are more efficient ways to test whether an event matches the observer than the general-purpose query matcher.
| void* ecs_observer_desc_t::run_ctx |
| ecs_ctx_free_t ecs_observer_desc_t::run_ctx_free |
| int8_t ecs_observer_desc_t::term_index_ |
| bool ecs_observer_desc_t::yield_existing |