Flecs v4.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
flecs::scoped_world Struct Reference

Scoped world. More...

#include <world.hpp>

Inheritance diagram for flecs::scoped_world:
[legend]

Public Member Functions

 scoped_world (flecs::world_t *w, flecs::entity_t s)
 Create a scoped world.
 ~scoped_world ()
 Destructor.
 scoped_world (const scoped_world &obj)
 Copy constructor.
Public Member Functions inherited from flecs::world
 world ()
 Create a world.
 world (int argc, char *argv[])
 Create a world with command-line arguments.
 world (world_t *w)
 Create a world from a C world.
 world (const world &obj)
 Copy constructor.
worldoperator= (const world &obj) noexcept
 Copy assignment operator.
 world (world &&obj) noexcept
 Move constructor.
worldoperator= (world &&obj) noexcept
 Move assignment operator.
void release ()
 Release the underlying world object.
 ~world ()
 Destructor.
 operator world_t * () const
 Implicit conversion to world_t*.
void make_owner ()
 Make the current world object the owner of the world.
void reset ()
 Delete and recreate the world.
world_tc_ptr () const
 Obtain a pointer to the C world object.
void quit () const
 Signal application should quit.
void atfini (ecs_fini_action_t action, void *ctx=nullptr) const
 Register action to be executed when world is destroyed.
bool should_quit () const
 Test if quit() has been called.
ecs_ftime_t frame_begin (float delta_time=0) const
 Begin frame.
void frame_end () const
 End frame.
bool readonly_begin (bool multi_threaded=false) const
 Begin readonly mode.
void readonly_end () const
 End readonly mode.
bool defer_begin () const
 Defer operations until end of frame.
bool defer_end () const
 End block of operations to defer.
bool is_deferred () const
 Test whether deferring is enabled.
bool is_defer_suspended () const
 Test whether deferring is suspended.
void set_stage_count (int32_t stages) const
 Configure world to have N stages.
int32_t get_stage_count () const
 Get the number of configured stages.
int32_t get_stage_id () const
 Get current stage ID.
bool is_stage () const
 Test if this is a stage.
void merge () const
 Merge world or stage.
flecs::world get_stage (int32_t stage_id) const
 Get stage-specific world pointer.
flecs::world async_stage () const
 Create an asynchronous stage.
flecs::world get_world () const
 Get actual world.
bool is_readonly () const
 Test whether the current world object is readonly.
void set_ctx (void *ctx, ecs_ctx_free_t ctx_free=nullptr) const
 Set world context.
void * get_ctx () const
 Get world context.
void set_binding_ctx (void *ctx, ecs_ctx_free_t ctx_free=nullptr) const
 Set world binding context.
void * get_binding_ctx () const
 Get world binding context.
void dim (int32_t entity_count) const
 Preallocate memory for a number of entities.
void set_entity_range (entity_t min, entity_t max) const
 Set entity range.
void enable_range_check (bool enabled=true) const
 Enforce that operations cannot modify entities outside of range.
flecs::entity set_scope (const flecs::entity_t scope) const
 Set current scope.
flecs::entity get_scope () const
 Get current scope.
template<typename T>
flecs::entity set_scope () const
 Same as set_scope(), but with type.
flecs::entity_tset_lookup_path (const flecs::entity_t *search_path) const
 Set search path.
flecs::entity lookup (const char *name, const char *sep="::", const char *root_sep="::", bool recursive=true) const
 Lookup entity by name.
template<typename T, if_t< !is_callable< T >::value > = 0>
void set (const T &value) const
 Set singleton component.
template<typename T, if_t< !is_callable< T >::value > = 0>
void set (T &&value) const
 Set singleton component.
template<typename First, typename Second, typename P = flecs::pair<First, Second>, typename A = actual_type_t<P>, if_not_t< flecs::is_pair< First >::value > = 0>
void set (const A &value) const
 Set singleton pair.
template<typename First, typename Second, typename P = flecs::pair<First, Second>, typename A = actual_type_t<P>, if_not_t< flecs::is_pair< First >::value > = 0>
void set (A &&value) const
 Set singleton pair.
template<typename First, typename Second>
void set (Second second, const First &value) const
 Set singleton pair.
template<typename First, typename Second>
void set (Second second, First &&value) const
 Set singleton pair.
template<typename Func, if_t< is_callable< Func >::value > = 0>
void set (const Func &func) const
 Set singleton component inside a callback.
template<typename T, typename ... Args>
void emplace (Args &&... args) const
template<typename T>
T & ensure () const
 Ensure singleton component.
template<typename T>
void modified () const
 Mark singleton component as modified.
template<typename T>
ref< T > get_ref () const
 Get ref singleton component.
const void * try_get (flecs::id_t id) const
 Get singleton component.
const void * try_get (flecs::entity_t r, flecs::entity_t t) const
 Get singleton pair.
template<typename T>
const T * try_get () const
 Get singleton component.
template<typename First, typename Second, typename P = flecs::pair<First, Second>, typename A = actual_type_t<P>>
const A * try_get () const
 Get singleton pair.
template<typename First, typename Second>
const First * try_get (Second second) const
 Get singleton pair.
const void * get (flecs::id_t id) const
 Get singleton component.
const void * get (flecs::entity_t r, flecs::entity_t t) const
 Get singleton component.
template<typename T>
const T & get () const
 Get a singleton component.
template<typename First, typename Second, typename P = flecs::pair<First, Second>, typename A = actual_type_t<P>>
const A & get () const
 Get singleton pair.
template<typename First, typename Second>
const First & get (Second second) const
 Get singleton pair.
template<typename Func, if_t< is_callable< Func >::value > = 0>
void get (const Func &func) const
 Get singleton component inside a callback.
void * try_get_mut (flecs::id_t id) const
 Get mutable singleton component.
void * try_get_mut (flecs::entity_t r, flecs::entity_t t) const
 Get mutable singleton pair.
template<typename T>
T * try_get_mut () const
 Try to get a mutable singleton component (returns nullptr if not found).
template<typename First, typename Second, typename P = flecs::pair<First, Second>, typename A = actual_type_t<P>>
A * try_get_mut () const
 Get mutable singleton pair.
template<typename First, typename Second>
First * try_get_mut (Second second) const
 Get mutable singleton pair.
void * get_mut (flecs::id_t id) const
 Get mutable singleton component.
void * get_mut (flecs::entity_t r, flecs::entity_t t) const
 Get mutable singleton pair.
template<typename T>
T & get_mut () const
 Get a mutable singleton component.
template<typename First, typename Second, typename P = flecs::pair<First, Second>, typename A = actual_type_t<P>>
A & get_mut () const
 Get mutable singleton pair.
template<typename First, typename Second>
First & get_mut (Second second) const
 Get mutable singleton pair.
template<typename T>
bool has () const
 Test if world has singleton component.
template<typename First, typename Second>
bool has () const
 Test if world has the provided pair.
template<typename First>
bool has (flecs::id_t second) const
 Test if world has the provided pair.
bool has (flecs::id_t first, flecs::id_t second) const
 Test if world has the provided pair.
template<typename E, if_t< is_enum< E >::value > = 0>
bool has (E value) const
 Check for enum singleton constant.
template<typename T>
void add () const
 Add singleton component.
template<typename First, typename Second>
void add () const
 Add a pair to the singleton component.
template<typename First>
void add (flecs::entity_t second) const
 Add a pair to the singleton component.
void add (flecs::entity_t first, flecs::entity_t second) const
 Add a pair to the singleton entity.
template<typename E, if_t< is_enum< E >::value > = 0>
void add (E value) const
 Add enum singleton constant.
template<typename T>
void remove () const
 Remove singleton component.
template<typename First, typename Second>
void remove () const
 Remove the pair singleton component.
template<typename First>
void remove (flecs::entity_t second) const
 Remove the pair singleton component.
void remove (flecs::entity_t first, flecs::entity_t second) const
 Remove the pair singleton component.
template<typename Func>
void children (Func &&f) const
 Iterate entities in root of world.
template<typename T>
flecs::entity singleton () const
 Get singleton entity for type.
template<typename First>
flecs::entity target (int32_t index=0) const
 Get target for a given pair from a singleton entity.
template<typename T>
flecs::entity target (flecs::entity_t first, int32_t index=0) const
 Get target for a given pair from a singleton entity.
flecs::entity target (flecs::entity_t first, int32_t index=0) const
 Get target for a given pair from a singleton entity.
template<typename T>
flecs::entity use (const char *alias=nullptr) const
 Create an alias for a component.
flecs::entity use (const char *name, const char *alias=nullptr) const
 Create an alias for an entity.
void use (flecs::entity entity, const char *alias=nullptr) const
 Create an alias for an entity.
int count (flecs::id_t component_id) const
 Count entities matching a component.
int count (flecs::entity_t first, flecs::entity_t second) const
 Count entities matching a pair.
template<typename T>
int count () const
 Count entities matching a component.
template<typename First>
int count (flecs::entity_t second) const
 Count entities matching a pair.
template<typename First, typename Second>
int count () const
 Count entities matching a pair.
template<typename Func>
void with (id_t with_id, const Func &func) const
 All entities created in the function are created with the ID.
template<typename T, typename Func>
void with (const Func &func) const
 All entities created in the function are created with the type.
template<typename First, typename Second, typename Func>
void with (const Func &func) const
 All entities created in the function are created with the pair.
template<typename First, typename Func>
void with (id_t second, const Func &func) const
 All entities created in the function are created with the pair.
template<typename Func>
void with (id_t first, id_t second, const Func &func) const
 All entities created in the function are created with the pair.
template<typename Func>
void scope (id_t parent, const Func &func) const
 All entities created in the function are created in the scope.
template<typename T, typename Func>
void scope (const Func &func) const
 Same as scope(parent, func), but with T as parent.
flecs::scoped_world scope (id_t parent) const
 Use the provided scope for operations run on the returned world.
template<typename T>
flecs::scoped_world scope () const
 Use the provided scope (by type) for operations run on the returned world.
flecs::scoped_world scope (const char *name) const
 Use the provided scope (by name) for operations run on the returned world.
void delete_with (id_t the_id) const
 Delete all entities with specified id.
void delete_with (entity_t first, entity_t second) const
 Delete all entities with specified pair.
template<typename T>
void delete_with () const
 Delete all entities with specified component.
template<typename First, typename Second>
void delete_with () const
 Delete all entities with specified pair.
template<typename First>
void delete_with (entity_t second) const
 Delete all entities with specified pair.
void remove_all (id_t the_id) const
 Remove all instances of specified id.
void remove_all (entity_t first, entity_t second) const
 Remove all instances of specified pair.
template<typename T>
void remove_all () const
 Remove all instances of specified component.
template<typename First, typename Second>
void remove_all () const
 Remove all instances of specified pair.
template<typename First>
void remove_all (entity_t second) const
 Remove all instances of specified pair.
template<typename Func>
void defer (const Func &func) const
 Defer all operations called in function.
void defer_suspend () const
 Suspend deferring operations.
void defer_resume () const
 Resume deferring operations.
bool exists (flecs::entity_t e) const
 Check if entity ID exists in the world.
bool is_alive (flecs::entity_t e) const
 Check if entity is alive.
bool is_valid (flecs::entity_t e) const
 Check if entity ID is valid.
flecs::entity get_alive (flecs::entity_t e) const
 Get alive entity for ID.
flecs::entity make_alive (flecs::entity_t e) const
 Ensure an entity ID is alive.
void set_version (flecs::entity_t e) const
 Set the version of an entity to the provided value.
uint32_t get_version (flecs::entity_t e) const
 Get the version of the provided entity.
void run_post_frame (ecs_fini_action_t action, void *ctx) const
 Run callback after completing the frame.
const flecs::world_info_tget_info () const
 Get the world info.
ecs_ftime_t delta_time () const
 Get delta_time.
void shrink () const
 Free unused memory.
void exclusive_access_begin (const char *thread_name=nullptr)
 Begin exclusive access.
void exclusive_access_end (bool lock_world=false)
 End exclusive access.
template<typename T>
flecs::id_t id_if_registered ()
 Return the component ID if it has been registered.
const flecs::type_info_ttype_info (flecs::id_t component)
 Return the type info.
const flecs::type_info_ttype_info (flecs::entity_t r, flecs::entity_t t)
 Return the type info.
template<typename T>
const flecs::type_info_ttype_info ()
 Return the type info.
template<typename R>
const flecs::type_info_ttype_info (flecs::entity_t t)
 Return the type info.
template<typename R, typename T>
const flecs::type_info_ttype_info ()
 Return the type info.
template<typename T>
flecs::id id () const
 Get ID from a type.
template<typename ... Args>
flecs::id id (Args &&... args) const
 ID factory.
template<typename First, typename Second>
flecs::id pair () const
 Get pair ID from relationship and object.
template<typename First>
flecs::id pair (entity_t o) const
 Get pair ID from relationship and object.
flecs::id pair (entity_t r, entity_t o) const
 Get pair ID from relationship and object.
template<typename T, typename... Args>
flecs::component< T > component (Args &&... args) const
 Find or register a component.
template<typename... Args>
flecs::untyped_component component (Args &&... args) const
 Find or register an untyped component.
template<typename... Args>
flecs::entity entity (Args &&... args) const
 Create an entity.
template<typename E, if_t< is_enum< E >::value > = 0>
flecs::id id (E value) const
 Convert an enum constant to an entity.
template<typename E, if_t< is_enum< E >::value > = 0>
flecs::entity entity (E value) const
 Convert an enum constant to an entity.
template<typename... Args>
flecs::entity prefab (Args &&... args) const
 Create a prefab.
template<typename T>
flecs::entity entity (const char *name=nullptr) const
 Create an entity that's associated with a type.
template<typename T>
flecs::entity prefab (const char *name=nullptr) const
 Create a prefab that's associated with a type.
flecs::event_builder event (flecs::entity_t evt) const
 Create a new event.
template<typename E>
flecs::event_builder_typed< E > event () const
 Create a new event.
template<typename E, if_t< is_enum< E >::value > = 0>
flecs::entity to_entity (E constant) const
 Convert an enum constant to an entity.
template<typename T>
flecs::timer timer () const
 Find or register a singleton timer.
template<typename... Args>
flecs::timer timer (Args &&... args) const
 Find or register a timer.
void randomize_timers () const
 Enable randomization of initial time values for timers.
int script_run (const char *name, const char *str) const
 Run a script.
int script_run_file (const char *filename) const
 Run a script from a file.
script_builder script (const char *name=nullptr) const
 Build a script.
flecs::string to_expr (flecs::entity_t tid, const void *value)
 Convert a value to a string.
template<typename T>
flecs::string to_expr (const T *value)
 Convert a value to a string.
template<typename T>
get_const_var (const char *name, const T &default_value={}) const
 Get the value of an exported script variable.
template<typename T>
void get_const_var (const char *name, T &out, const T &default_value={}) const
 Get the value of an exported script variable.
flecs::string to_json (flecs::entity_t tid, const void *value) const
 Serialize an untyped value to JSON.
template<typename T>
flecs::string to_json (const T *value) const
 Serialize a value to JSON.
flecs::string to_json () const
 Serialize the world to JSON.
const char * from_json (flecs::entity_t tid, void *value, const char *json, flecs::from_json_desc_t *desc=nullptr)
 Deserialize a value from JSON.
template<typename T>
const char * from_json (T *value, const char *json, flecs::from_json_desc_t *desc=nullptr)
 Deserialize a value from JSON.
const char * from_json (const char *json, flecs::from_json_desc_t *desc=nullptr)
 Deserialize JSON into the world.
const char * from_json_file (const char *json, flecs::from_json_desc_t *desc=nullptr)
 Deserialize a JSON file into the world.
template<typename... Args>
flecs::metric_builder metric (Args &&... args) const
 Create a metric.
template<typename... Comps, typename... Args>
flecs::alert_builder< Comps... > alert (Args &&... args) const
 Create an alert.
void init_builtin_components ()
 Initialize built-in components.
template<typename... Comps, typename... Args>
flecs::alert_builder< Comps... > alert (Args &&... args) const
 Create an alert.
template<typename T, typename... Args>
flecs::component< T > component (Args &&... args) const
 Find or register a component.
template<typename... Args>
flecs::untyped_component component (Args &&... args) const
 Find or register an untyped component.
template<typename... Args>
flecs::entity entity (Args &&... args) const
 Create an entity.
template<typename E, if_t< is_enum< E >::value > = 0>
flecs::id id (E value) const
 Convert an enum constant to an entity.
template<typename E, if_t< is_enum< E >::value > = 0>
flecs::entity entity (E value) const
 Convert an enum constant to an entity.
template<typename... Args>
flecs::entity prefab (Args &&... args) const
 Create a prefab.
template<typename T>
flecs::entity entity (const char *name=nullptr) const
 Create an entity that's associated with a type.
template<typename T>
flecs::entity prefab (const char *name=nullptr) const
 Create a prefab that's associated with a type.
template<typename E, if_t< is_enum< E >::value > = 0>
flecs::entity to_entity (E constant) const
 Convert an enum constant to an entity.
flecs::event_builder event (flecs::entity_t evt) const
 Create a new event.
template<typename E>
flecs::event_builder_typed< E > event () const
 Create a new event.
template<typename T>
flecs::id id () const
 Get ID from a type.
template<typename ... Args>
flecs::id id (Args &&... args) const
 ID factory.
template<typename First, typename Second>
flecs::id pair () const
 Get pair ID from relationship and object.
template<typename First>
flecs::id pair (entity_t o) const
 Get pair ID from relationship and object.
flecs::id pair (entity_t r, entity_t o) const
 Get pair ID from relationship and object.
flecs::string to_json (flecs::entity_t tid, const void *value) const
 Serialize an untyped value to JSON.
template<typename T>
flecs::string to_json (const T *value) const
 Serialize a value to JSON.
flecs::string to_json () const
 Serialize the world to JSON.
const char * from_json (flecs::entity_t tid, void *value, const char *json, flecs::from_json_desc_t *desc=nullptr)
 Deserialize a value from JSON.
template<typename T>
const char * from_json (T *value, const char *json, flecs::from_json_desc_t *desc=nullptr)
 Deserialize a value from JSON.
const char * from_json (const char *json, flecs::from_json_desc_t *desc=nullptr)
 Deserialize JSON into the world.
const char * from_json_file (const char *json, flecs::from_json_desc_t *desc=nullptr)
 Deserialize a JSON file into the world.
template<typename... Args>
flecs::metric_builder metric (Args &&... args) const
 Create a metric.
template<typename... Comps, typename... Args>
observer_builder< Comps... > observer (Args &&... args) const
template<typename... Comps, typename... Args>
system_builder< Comps... > system (Args &&... args) const
template<typename T>
flecs::timer timer () const
 Find or register a singleton timer.
flecs::app_builder app ()
 Return an app builder.
flecs::app_builder app ()
 Return an app builder.
template<typename... Args>
flecs::term term (Args &&... args) const
 Create a term.
flecs::observer observer (flecs::entity e) const
 Observer world mixin.
template<typename... Comps, typename... Args>
flecs::query< Comps... > query (Args &&... args) const
 Create a query.
template<typename Module>
flecs::entity module (const char *name=nullptr) const
 Define a module.
flecs::pipeline_builder pipeline () const
 Create a new pipeline.
flecs::system system (flecs::entity e) const
 Upcast an entity to a system.
flecs::cursor cursor (flecs::entity_t tid, void *ptr)
 Return a meta cursor to a value.
flecs::cursor cursor (flecs::entity_t tid, void *ptr)
 Return a meta cursor to a value.
template<typename Module>
flecs::entity module (const char *name=nullptr) const
 Define a module.
flecs::observer observer (flecs::entity e) const
 Observer world mixin.
flecs::pipeline_builder pipeline () const
 Create a new pipeline.
template<typename... Comps, typename... Args>
flecs::query< Comps... > query (Args &&... args) const
 Create a query.
flecs::system system (flecs::entity e) const
 Upcast an entity to a system.
template<typename... Args>
flecs::term term (Args &&... args) const
 Create a term.

Public Attributes

flecs::entity_t prev_scope_
 The previous scope entity.
Public Attributes inherited from flecs::world
world_tworld_
 Pointer to the underlying C world.

Additional Inherited Members

template<typename T>
flecs::term term () const
 Create a term for a (component) type.
template<typename First, typename Second>
flecs::term term () const
 Create a term for a pair.
template<typename... Components, typename... Args>
flecs::observer_builder< Components... > observer (Args &&... args) const
 Create a new observer.
flecs::query query (flecs::entity query_entity) const
 Create a query from an entity.
template<typename... Comps, typename... Args>
flecs::query_builder< Comps... > query_builder (Args &&... args) const
 Create a query builder.
template<typename Func>
void each (Func &&func) const
 Iterate over all entities with components in the argument list of the function.
template<typename T, typename Func>
void each (Func &&func) const
 Iterate over all entities with the provided component.
template<typename Func>
void each (flecs::id_t term_id, Func &&func) const
 Iterate over all entities with the provided (component) ID.
template<typename Module>
flecs::entity import ()
 Import a module.
template<typename Pipeline, if_not_t< is_enum< Pipeline >::value > = 0>
flecs::pipeline_builder pipeline () const
 Create a new pipeline.
void set_pipeline (const flecs::entity pip) const
 Set the pipeline.
template<typename Pipeline>
void set_pipeline () const
 Set the pipeline.
flecs::entity get_pipeline () const
 Get the pipeline.
bool progress (ecs_ftime_t delta_time=0.0) const
 Progress the world one tick.
void run_pipeline (const flecs::entity_t pip, ecs_ftime_t delta_time=0.0) const
 Run a pipeline.
template<typename Pipeline, if_not_t< is_enum< Pipeline >::value > = 0>
void run_pipeline (ecs_ftime_t delta_time=0.0) const
 Run a pipeline.
void set_time_scale (ecs_ftime_t mul) const
 Set the time scale.
void set_target_fps (ecs_ftime_t target_fps) const
 Set the target FPS.
void reset_clock () const
 Reset the simulation clock.
void set_threads (int32_t threads) const
 Set the number of threads.
int32_t get_threads () const
 Get the number of threads.
void set_task_threads (int32_t task_threads) const
 Set the number of task threads.
bool using_task_threads () const
 Return true if task thread use has been requested.
template<typename... Components, typename... Args>
flecs::system_builder< Components... > system (Args &&... args) const
 Create a new system.
template<typename T>
flecs::cursor cursor (void *ptr)
 Return a meta cursor to a value.
flecs::entity primitive (flecs::meta::primitive_kind_t kind)
 Create a primitive type.
flecs::entity array (flecs::entity_t elem_id, int32_t array_count)
 Create an array type.
template<typename T>
flecs::entity array (int32_t array_count)
 Create an array type.
flecs::entity vector (flecs::entity_t elem_id)
 Create a vector type.
template<typename T>
flecs::entity vector ()
 Create a vector type.
template<typename T>
flecs::cursor cursor (void *ptr)
 Return a meta cursor to a value.
flecs::entity primitive (flecs::meta::primitive_kind_t kind)
 Create a primitive type.
flecs::entity array (flecs::entity_t elem_id, int32_t array_count)
 Create an array type.
template<typename T>
flecs::entity array (int32_t array_count)
 Create an array type.
flecs::entity vector (flecs::entity_t elem_id)
 Create a vector type.
template<typename T>
flecs::entity vector ()
 Create a vector type.
template<typename Module>
flecs::entity import ()
 Import a module.
template<typename... Components, typename... Args>
flecs::observer_builder< Components... > observer (Args &&... args) const
 Create a new observer.
template<typename Pipeline, if_not_t< is_enum< Pipeline >::value > = 0>
flecs::pipeline_builder pipeline () const
 Create a new pipeline.
void set_pipeline (const flecs::entity pip) const
 Set the pipeline.
template<typename Pipeline>
void set_pipeline () const
 Set the pipeline.
flecs::entity get_pipeline () const
 Get the pipeline.
bool progress (ecs_ftime_t delta_time=0.0) const
 Progress the world one tick.
void run_pipeline (const flecs::entity_t pip, ecs_ftime_t delta_time=0.0) const
 Run a pipeline.
template<typename Pipeline, if_not_t< is_enum< Pipeline >::value > = 0>
void run_pipeline (ecs_ftime_t delta_time=0.0) const
 Run a pipeline.
void set_time_scale (ecs_ftime_t mul) const
 Set the time scale.
void set_target_fps (ecs_ftime_t target_fps) const
 Set the target FPS.
void reset_clock () const
 Reset the simulation clock.
void set_threads (int32_t threads) const
 Set the number of threads.
int32_t get_threads () const
 Get the number of threads.
void set_task_threads (int32_t task_threads) const
 Set the number of task threads.
bool using_task_threads () const
 Return true if task thread use has been requested.
flecs::query query (flecs::entity query_entity) const
 Create a query from an entity.
template<typename... Comps, typename... Args>
flecs::query_builder< Comps... > query_builder (Args &&... args) const
 Create a query builder.
template<typename Func>
void each (Func &&func) const
 Iterate over all entities with components in the argument list of the function.
template<typename T, typename Func>
void each (Func &&func) const
 Iterate over all entities with the provided component.
template<typename Func>
void each (flecs::id_t term_id, Func &&func) const
 Iterate over all entities with the provided (component) ID.
template<typename... Components, typename... Args>
flecs::system_builder< Components... > system (Args &&... args) const
 Create a new system.
template<typename T>
flecs::term term () const
 Create a term for a (component) type.
template<typename First, typename Second>
flecs::term term () const
 Create a term for a pair.

Detailed Description

Scoped world.

Utility class used by the world::scope() method to create entities in a scope.

Definition at line 1551 of file world.hpp.

Constructor & Destructor Documentation

◆ scoped_world() [1/2]

flecs::scoped_world::scoped_world ( flecs::world_t * w,
flecs::entity_t s )
inline

Create a scoped world.

Parameters
wThe world.
sThe scope entity.

Definition at line 1557 of file world.hpp.

◆ ~scoped_world()

flecs::scoped_world::~scoped_world ( )
inline

Destructor.

Restores the previous scope.

Definition at line 1565 of file world.hpp.

◆ scoped_world() [2/2]

flecs::scoped_world::scoped_world ( const scoped_world & obj)
inline

Copy constructor.

Definition at line 1570 of file world.hpp.

Member Data Documentation

◆ prev_scope_

flecs::entity_t flecs::scoped_world::prev_scope_

The previous scope entity.

Definition at line 1576 of file world.hpp.


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