Flecs v3.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:
flecs::world

Public Member Functions

 scoped_world (flecs::world_t *w, flecs::entity_t s)
 
 scoped_world (const scoped_world &obj)
 
- Public Member Functions inherited from flecs::world
 world ()
 Create world. More...
 
 world (int argc, char *argv[])
 Create world with command line arguments. More...
 
 world (world_t *w)
 Create world from C world. More...
 
 world (const world &obj)=delete
 Not allowed to copy a world. More...
 
 world (world &&obj)
 
 operator world_t * () const
 
worldoperator= (const world &obj)=delete
 Not allowed to copy a world. More...
 
worldoperator= (world &&obj)
 
world_t * c_ptr () const
 Obtain pointer to C world object. More...
 
ecs_ftime_t delta_time () const
 Get last delta_time. More...
 
int64_t tick () const
 Get current tick. More...
 
ecs_ftime_t time () const
 Get current simulation time. More...
 
void quit () const
 Signal application should quit. More...
 
void atfini (ecs_fini_action_t action, void *ctx) const
 Register action to be executed when world is destroyed. More...
 
bool should_quit () const
 Test if quit() has been called. More...
 
ecs_ftime_t frame_begin (float delta_time=0) const
 Begin frame. More...
 
void frame_end () const
 End frame. More...
 
bool readonly_begin () const
 Begin staging. More...
 
void readonly_end () const
 End staging. More...
 
bool defer_begin () const
 Defer operations until end of frame. More...
 
bool defer_end () const
 End block of operations to defer. More...
 
bool is_deferred () const
 Test whether deferring is enabled. More...
 
void set_stage_count (int32_t stages) const
 Configure world to have N stages. More...
 
int32_t get_stage_count () const
 Get number of configured stages. More...
 
int32_t get_stage_id () const
 Get current stage id. More...
 
bool is_stage () const
 Test if is a stage. More...
 
void set_automerge (bool automerge) const
 Enable/disable automerging for world or stage. More...
 
void merge () const
 Merge world or stage. More...
 
flecs::world get_stage (int32_t stage_id) const
 Get stage-specific world pointer. More...
 
flecs::world async_stage () const
 Create asynchronous stage. More...
 
flecs::world get_world () const
 Get actual world. More...
 
bool is_readonly () const
 Test whether the current world object is readonly. More...
 
void set_context (void *ctx) const
 Set world context. More...
 
void * get_context () const
 Get world context. More...
 
void dim (int32_t entity_count) const
 Preallocate memory for number of entities. More...
 
void set_entity_range (entity_t min, entity_t max) const
 Set entity range. More...
 
void enable_range_check (bool enabled) const
 Enforce that operations cannot modify entities outside of range. More...
 
flecs::entity set_scope (const flecs::entity_t scope) const
 Set current scope. More...
 
flecs::entity get_scope () const
 Get current scope. More...
 
template<typename T >
flecs::entity set_scope () const
 Same as set_scope but with type. More...
 
flecs::entity_t * set_lookup_path (const flecs::entity_t *search_path) const
 Set search path. More...
 
flecs::entity lookup (const char *name) const
 Lookup entity by name. More...
 
template<typename T , if_t< !is_callable< T >::value > = 0>
void set (const T &value) const
 Set singleton component. More...
 
template<typename T , if_t< !is_callable< T >::value > = 0>
void set (T &&value) const
 
template<typename Func , if_t< is_callable< Func >::value > = 0>
void set (const Func &func) const
 Set singleton component inside a callback. More...
 
template<typename T , typename ... Args>
void emplace (Args &&... args) const
 
template<typename T >
T * get_mut () const
 Get mut singleton component. More...
 
template<typename T >
void modified () const
 Mark singleton component as modified. More...
 
template<typename T >
ref< T > get_ref () const
 Get ref singleton component. More...
 
template<typename T >
const T * get () const
 Get singleton component. More...
 
template<typename Func , if_t< is_callable< Func >::value > = 0>
void get (const Func &func) const
 Get singleton component inside a callback. More...
 
template<typename T >
bool has () const
 Test if world has singleton component. More...
 
template<typename T >
void add () const
 Add singleton component. More...
 
template<typename T >
void remove () const
 Remove singleton component. More...
 
template<typename T >
flecs::entity singleton () const
 Get singleton entity for type. More...
 
template<typename T >
flecs::entity use (const char *alias=nullptr) const
 Create alias for component. More...
 
flecs::entity use (const char *name, const char *alias=nullptr) const
 Create alias for entity. More...
 
void use (flecs::entity entity, const char *alias=nullptr) const
 Create alias for entity. More...
 
int count (flecs::id_t component_id) const
 Count entities matching a component. More...
 
int count (flecs::entity_t first, flecs::entity_t second) const
 Count entities matching a pair. More...
 
template<typename T >
int count () const
 Count entities matching a component. More...
 
template<typename First >
int count (flecs::entity_t second) const
 Count entities matching a pair. More...
 
template<typename First , typename Second >
int count () const
 Count entities matching a pair. More...
 
template<typename Func >
void with (id_t with_id, const Func &func) const
 All entities created in function are created with id. More...
 
template<typename T , typename Func >
void with (const Func &func) const
 All entities created in function are created with type. More...
 
template<typename First , typename Second , typename Func >
void with (const Func &func) const
 All entities created in function are created with pair. More...
 
template<typename First , typename Func >
void with (id_t second, const Func &func) const
 All entities created in function are created with pair. More...
 
template<typename Func >
void with (id_t first, id_t second, const Func &func) const
 All entities created in function are created with pair. More...
 
template<typename Func >
void scope (id_t parent, const Func &func) const
 All entities created in function are created in scope. More...
 
template<typename T , typename Func >
void scope (const Func &func) const
 Same as scope(parent, func), but with T as parent. More...
 
flecs::scoped_world scope (id_t parent) const
 Use provided scope for operations ran on returned world. More...
 
template<typename T >
flecs::scoped_world scope () const
 
void delete_with (id_t the_id) const
 Delete all entities with specified id. More...
 
void delete_with (entity_t first, entity_t second) const
 Delete all entities with specified pair. More...
 
template<typename T >
void delete_with () const
 Delete all entities with specified component. More...
 
template<typename First , typename Second >
void delete_with () const
 Delete all entities with specified pair. More...
 
void remove_all (id_t the_id) const
 Remove all instances of specified id. More...
 
void remove_all (entity_t first, entity_t second) const
 Remove all instances of specified pair. More...
 
template<typename T >
void remove_all () const
 Remove all instances of specified component. More...
 
template<typename First , typename Second >
void remove_all () const
 Remove all instances of specified pair. More...
 
template<typename Func >
void defer (const Func &func) const
 Defer all operations called in function. More...
 
void defer_suspend () const
 Suspend deferring operations. More...
 
void defer_resume () const
 Resume deferring operations. More...
 
bool exists (flecs::entity_t e) const
 Check if entity id exists in the world. More...
 
bool is_alive (flecs::entity_t e) const
 Check if entity id exists in the world. More...
 
bool is_valid (flecs::entity_t e) const
 Check if entity id is valid. More...
 
flecs::entity get_alive (flecs::entity_t e) const
 Get alive entity for id. More...
 
flecs::entity ensure (flecs::entity_t e) const
 Ensures that entity with provided generation is alive. More...
 
void run_post_frame (ecs_fini_action_t action, void *ctx) const
 
void init_builtin_components ()
 
flecs::app_builder app ()
 Return app builder. More...
 
template<typename T , typename... Args>
flecs::component< T > component (Args &&... args) const
 Find or register component.
 
template<typename... Args>
flecs::untyped_component component (Args &&... args) const
 Find or register untyped component. More...
 
template<typename... Args>
flecs::entity entity (Args &&... args) const
 Create an entity.
 
template<typename E , if_t< is_enum< E >::value > = 0>
flecs::entity id (E value) const
 Convert enum constant to entity.
 
template<typename E , if_t< is_enum< E >::value > = 0>
flecs::entity entity (E value) const
 Convert enum constant to 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 enum constant to entity.
 
flecs::event_builder event (flecs::entity_t evt) const
 Create a new event. More...
 
template<typename E >
flecs::event_builder_typed< E > event () const
 Create a new event. More...
 
template<typename... Comps, typename... Args>
flecs::filter< Comps... > filter (Args &&... args) const
 Create a filter. More...
 
template<typename T >
flecs::id id () const
 
template<typename ... Args>
flecs::id id (Args &&... args) const
 
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, object.
 
template<typename First >
flecs::id pair (entity_t o) const
 Get pair id from relationship, object.
 
flecs::id pair (entity_t r, entity_t o) const
 Get pair id from relationship, object.
 
flecs::string to_json (flecs::entity_t tid, const void *value)
 Serialize untyped value to JSON. More...
 
template<typename T >
flecs::string to_json (const T *value)
 Serialize value to JSON. More...
 
flecs::string to_json ()
 Serialize world to JSON. More...
 
template<typename T >
const char * from_json (flecs::entity_t tid, void *value, const char *json)
 Deserialize value from JSON. More...
 
template<typename T >
const char * from_json (T *value, const char *json)
 Deserialize value from JSON. More...
 
flecs::observer observer (flecs::entity e) const
 Observer builder. More...
 
flecs::pipeline_builder pipeline () const
 Create a new pipeline. More...
 
template<typename... Comps, typename... Args>
flecs::query< Comps... > query (Args &&... args) const
 Create a query. More...
 
template<typename... Comps, typename... Args>
flecs::rule< Comps... > rule (Args &&... args) const
 Create a rule. More...
 
template<typename... Args>
flecs::snapshot snapshot (Args &&... args) const
 Create a snapshot.
 
flecs::system system (flecs::entity e) const
 Upcast entity to a system. More...
 
template<typename... Args>
flecs::term term (Args &&... args) const
 Create a term.
 
template<typename... Args>
flecs::timer timer (Args &&... args) const
 Find or register a timer.
 
flecs::string to_expr (flecs::entity_t tid, const void *value)
 Convert value to string. More...
 
template<typename Module >
flecs::entity module (const char *name=nullptr) const
 Define a module. More...
 

Public Attributes

flecs::entity_t m_prev_scope
 
- Public Attributes inherited from flecs::world
world_t * m_world
 
bool m_owned
 

Additional Inherited Members

Detailed Description

Scoped world.

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

Definition at line 907 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

Definition at line 908 of file world.hpp.

◆ ~scoped_world()

flecs::scoped_world::~scoped_world ( )
inline

Definition at line 917 of file world.hpp.

◆ scoped_world() [2/2]

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

Definition at line 921 of file world.hpp.

Member Data Documentation

◆ m_prev_scope

flecs::entity_t flecs::scoped_world::m_prev_scope

Definition at line 927 of file world.hpp.


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