![]() |
Gaia-ECS v1.0.0
A simple and powerful entity component system
|
Owns entities, components, archetypes, queries, observers, and systems. More...
#include <world.h>
Classes | |
| struct | EntityBuilder |
| Applies structural and value changes to one entity. More... | |
Public Member Functions | |
| World (World &&)=delete | |
| World (const World &)=delete | |
| World & | operator= (World &&)=delete |
| World & | operator= (const World &)=delete |
| Query | query () |
| Provides a cached query set up to work with the parent world. Cached queries use local scope by default. | |
| Query | uquery () |
| Provides an uncached query set up to work with the parent world. Uncached queries keep only a local immutable plan and rebuild transient matches on demand. | |
| void | set_sched (const Sched &sched) |
| Installs a custom scheduler used by ECS parallel execution paths. | |
| void | reset_sched () |
| Resets the world back to the default Gaia scheduler. | |
| GAIA_NODISCARD const Sched & | sched () const |
| Returns the resolved scheduler used by this world. | |
| GAIA_NODISCARD EntityContainer & | fetch (Entity entity) |
| Returns the internal record for entity. | |
| GAIA_NODISCARD const EntityContainer & | fetch (Entity entity) const |
| Returns the internal record for entity. | |
| GAIA_NODISCARD bool | is_dont_fragment (Entity entity) const |
| Returns whether entity is marked DontFragment. | |
| GAIA_NODISCARD bool | relation_is_non_fragmenting (Entity relation) const |
| Returns whether relation is non-fragmenting. | |
| GAIA_NODISCARD bool | relation_uses_non_fragmenting_storage (Entity relation) const |
| Returns whether relation uses non-fragmenting relation storage. Only exclusive non-fragmenting relations use this storage path. | |
| GAIA_NODISCARD bool | relation_is_hierarchy (Entity relation) const |
| Returns true for hierarchy-like relations whose targets form an exclusive traversable parent chain. ChildOf and Parent satisfy this today. DependsOn intentionally does not. | |
| GAIA_NODISCARD bool | relation_is_fragmenting (Entity relation) const |
| Returns true when the relation still participates in archetype identity. Non-fragmenting relations such as Parent are excluded. | |
| GAIA_NODISCARD bool | relation_is_fragmenting_hierarchy (Entity relation) const |
| Returns true for hierarchy relations that still fragment archetypes. ChildOf satisfies this today, while Parent intentionally does not. | |
| GAIA_NODISCARD bool | relation_supports_depth_order (Entity relation) const |
| Returns true when the relation can drive cached depth-ordered iteration. This requires a fragmenting relation whose target participates in archetype identity, such as ChildOf, DependsOn, or a custom fragmenting relation. Cycles are still invalid and are diagnosed by the depth cache itself. | |
| GAIA_NODISCARD bool | relation_depth_order_prunes_disabled_subtrees (Entity relation) const |
| Returns true when depth-ordered iteration may safely prune disabled subtrees at archetype level. Only fragmenting hierarchy relations qualify because all rows in the archetype then share the same direct parent and therefore the same ancestor chain. | |
| GAIA_NODISCARD bool | component_uses_sparse_storage (Entity component) const |
| Returns whether component stores instance data in sparse storage instead of archetype chunks. This is currently the storage path used for sparse plain generic AoS components. | |
| GAIA_NODISCARD bool | component_is_non_fragmenting (Entity component) const |
| Returns whether component is non-fragmenting. Non-fragmenting components do not participate in archetype identity. | |
| GAIA_NODISCARD SparseStorageMode | sparse_storage_mode (Entity component) const |
| Returns the sparse storage mode used by a component. | |
| GAIA_NODISCARD bool | copies_sparse_payload_inter (Entity comp, Entity srcEntity, const SparseComponentStoreErased &store) const |
| Checks whether an inter-world copy includes a sparse component payload. | |
| GAIA_NODISCARD bool | copies_non_frag_sparse_payload_inter (Entity comp, Entity srcEntity, const SparseComponentStoreErased &store) const |
| Checks whether an inter-world copy includes a non-fragmenting sparse payload. | |
| GAIA_NODISCARD bool | sparse_copy_adds_id_inter (Entity comp) const |
| Checks whether copying a sparse payload must also add its id to the destination entity. | |
| void | sync_component_record (Entity component, Component comp) |
| Updates the cached component metadata in both the component cache and the core Component storage. | |
| void | validate_runtime_semantics (const RuntimeTypeDesc &runtimeType) const |
| Validates runtime-reflection state against the live scope graph in debug builds. Verifies that every semantic entity referenced by runtimeType resolves to a reachable scope path. All checks are compiled out when assertions are disabled. | |
| void | finalize_component_registration (const ComponentCacheItem &item, bool addSparseTrait) |
Finalizes a newly registered component entity after the cache record has been created. This synchronizes the core Component value stored on the component entity, registers the default symbol through the normal naming path, and optionally latches the Sparse trait. | |
| void | set_component_dont_fragment (Entity component, EntityContainer &ec) |
| Latches DontFragment on a component entity record. This first moves the payload out of chunks, then removes the id from archetype identity. | |
| void | set_component_sparse_storage (Entity component) |
| Latches Sparse storage on a component entity before any instances exist. This moves the payload out of chunks while keeping the id in archetype identity. Only plain generic AoS components are supported. | |
| GAIA_NODISCARD bool | can_add_component_storage_trait (Entity component) const |
| Returns whether a runtime storage trait can be attached to component. Compile-time component storage is authoritative. Runtime component descriptors remain mutable. | |
| GAIA_NODISCARD SparseStorageMode | compile_time_sparse_storage_mode (Entity component) const |
| Returns the fragmentation mode for a component known at compile time to use sparse storage. | |
| template<typename T > | |
| GAIA_NODISCARD bool | can_use_sparse_component_storage (Entity object) const |
| Returns whether object is a usable sparse storage target for component type T. | |
| template<typename T > | |
| GAIA_NODISCARD SparseComponentStore< T > * | sparse_component_store (Entity component) |
| Returns the sparse component store for component, or nullptr if it does not exist. | |
| template<typename T > | |
| GAIA_NODISCARD const SparseComponentStore< T > * | sparse_component_store (Entity component) const |
| Returns the sparse component store for component, or nullptr if it does not exist. | |
| template<typename T > | |
| GAIA_NODISCARD SparseComponentStore< T > & | sparse_component_store_mut (Entity component) |
| Returns the sparse component store for component, creating it if needed. | |
| template<typename T > | |
| GAIA_NODISCARD decltype(auto) | sparse_component_add_value (Entity component, Entity entity) |
| Adds or returns a sparse value through the store's erased payload interface. | |
| template<typename T > | |
| GAIA_NODISCARD decltype(auto) | sparse_component_mut_value (Entity component, Entity entity) |
| Returns a mutable sparse value through the store's erased payload interface. | |
| template<typename T > | |
| GAIA_NODISCARD decltype(auto) | sparse_component_get_value (Entity component, Entity entity) const |
| Returns a read-only sparse value through the store's erased payload interface. | |
| GAIA_NODISCARD const SparseComponentStoreErased * | sparse_component_store_erased (Entity component) const |
| Returns the erased sparse store for component, or nullptr when absent. | |
| GAIA_NODISCARD SparseComponentStoreErased & | sparse_component_store_erased_mut (Entity component, const ComponentCacheItem &item) |
| Returns the erased sparse store for component, creating runtime-sized storage when absent. | |
| void | finish_sparse_component_add_inter (Entity entity, Entity object, SparseStorageMode mode) |
| Finishes adding a sparse component after its payload has been created. Fragmenting components also add the id directly to the entity archetype. | |
| void | del_sparse_components (Entity entity) |
| Removes all sparse component instances owned by entity. | |
| void | del_sparse_component_store (Entity component) |
| Deletes the sparse component store associated with component. | |
| GAIA_NODISCARD const NonFragmentingRelationStore * | nonfragmenting_relation_store (Entity relation) const |
| Returns the non-fragmenting relation store for relation, or nullptr when absent. | |
| GAIA_NODISCARD NonFragmentingRelationStore & | nonfragmenting_relation_store_mut (Entity relation) |
| Returns the non-fragmenting relation store for relation, creating it if needed. | |
| void | nonfragmenting_relation_set (NonFragmentingRelationStore &store, Entity source, Entity relation, Entity target) |
| Sets an exclusive non-fragmenting relation target in an existing store. | |
| void | nonfragmenting_relation_set (Entity source, Entity relation, Entity target) |
| Sets an exclusive non-fragmenting relation target, creating its store when necessary. | |
| bool | nonfragmenting_relation_del (Entity source, Entity relation, Entity target) |
| Removes an exclusive non-fragmenting relation from a source entity. | |
| GAIA_NODISCARD bool | has_nonfragmenting_relation_pair (Entity source, Entity object) const |
| Checks whether a source matches a possibly wildcarded non-fragmenting relation pair. | |
| void | del_nonfragmenting_relation_source (Entity source) |
| Removes all outgoing non-fragmenting relations from a source entity. | |
| void | del_nonfragmenting_relation (Entity relation) |
| Removes every stored source-target mapping for a non-fragmenting relation. | |
| GAIA_NODISCARD bool | has_nonfragmenting_relation_target_cond (Entity target, Pair cond) const |
Checks whether any non-fragmenting exclusive relation targeting target uses an OnDeleteTarget rule. | |
| void | set_serializer (std::nullptr_t) |
| Resets runtime serializer binding to the default internal bin_stream backend. | |
| void | set_serializer (ser::serializer serializer) |
| Binds a pre-built runtime serializer handle. | |
| template<typename TSerializer > | |
| void | set_serializer (TSerializer &serializer) |
| Binds a concrete serializer object through ser::make_serializer(). | |
| ser::serializer | get_serializer () const |
| Returns the currently bound runtime serializer handle. | |
| GAIA_NODISCARD ComponentCache & | comp_cache_mut () |
| Returns mutable access to the world component cache. | |
| GAIA_NODISCARD const ComponentCache & | comp_cache () const |
| Returns read-only access to the world component cache. | |
| GAIA_NODISCARD Entity | symbol (const char *symbol, uint32_t len=0) const |
| Finds a component entity by its exact registered symbol. | |
| GAIA_NODISCARD util::str_view | symbol (Entity component) const |
| Returns the registered symbol name for a component entity. | |
| GAIA_NODISCARD Entity | path (const char *path, uint32_t len=0) const |
| Finds a component entity by its exact scoped path. | |
| GAIA_NODISCARD util::str_view | path (Entity component) const |
| Returns the scoped path name for a component entity. | |
| bool | path (Entity component, const char *path, uint32_t len=0) |
| Assigns a scoped path name to a component entity. | |
| GAIA_NODISCARD Entity | alias (const char *alias, uint32_t len=0) const |
| Finds an entity by its exact alias. | |
| GAIA_NODISCARD util::str_view | alias (Entity entity) const |
| Returns the alias assigned to an entity. | |
| bool | alias (Entity entity, const char *alias, uint32_t len=0) |
| Assigns an alias name to an entity. | |
| bool | alias_raw (Entity entity, const char *alias, uint32_t len=0) |
| Assigns an alias name to an entity without copying the string. | |
| GAIA_NODISCARD util::str_view | display_name (Entity entity) const |
| Returns the preferred display name for a entity. This is intended for diagnostics and other pretty output, not as a stable identity key. | |
| GAIA_NODISCARD bool | valid (Entity entity) const |
| Checks if entity is valid. | |
| GAIA_NODISCARD Entity | get (EntityId id) const |
| Returns the entity located at the index id. | |
| GAIA_NODISCARD Entity | try_get (EntityId id) const |
Returns the entity for id when it is still live, or EntityBad for stale cleanup-time ids. | |
| template<typename T > | |
| GAIA_NODISCARD Entity | get () const |
| Returns the entity registered for component type T. | |
| template<typename T > | |
| GAIA_NODISCARD const ComponentCacheItem & | reg_comp () |
| Returns the registered component cache item for T, auto-registering it when enabled. | |
| EntityBuilder | build (Entity entity) |
| Starts a bulk add/remove operation on entity. | |
| GAIA_NODISCARD Entity | add (EntityKind kind=EntityKind::EK_Gen) |
| Creates a new empty entity. | |
| GAIA_NODISCARD Entity | prefab (EntityKind kind=EntityKind::EK_Gen) |
| Creates a new prefab entity. | |
| template<typename Func = TFunc_Void_With_Entity> | |
| void | add_n (uint32_t count, Func func=func_void_with_entity) |
| Creates count new empty entities. | |
| template<typename Func = TFunc_Void_With_Entity> | |
| void | add_n (Entity entity, uint32_t count, Func func=func_void_with_entity) |
| Creates count of entities of the same archetype as entity. | |
| template<typename T > | |
| GAIA_NODISCARD const ComponentCacheItem & | add () |
| Creates a new component if not found already. | |
| template<typename T > | |
| GAIA_NODISCARD const ComponentCacheItem & | add (const RuntimeTypeDesc &runtimeType) |
| Registers a compile-time component with explicit runtime type metadata. Metadata is applied only during first registration. Existing component metadata remains immutable. Runtime metadata does not change typed storage, lifecycle callbacks, or the component symbol. | |
| GAIA_NODISCARD ComponentCacheItem & | add (const ComponentDesc &desc, EntityKind kind=EntityKind::EK_Gen) |
| Creates a new runtime component from a plain component descriptor if not found already. | |
| void | add (Entity entity, Entity object) |
| Attaches entity object to entity entity. | |
| void | add (Entity entity, Pair pair) |
| Attaches a relationship pair to entity. | |
| template<typename T > | |
| void | add (Entity entity) |
| Attaches a new component T to entity. | |
| template<typename T > | |
| void | add (Entity entity, Entity object, T &&value) |
| Attaches object to entity. Also sets its value. | |
| template<typename T , typename U = typename actual_type_t<T>::Type> | |
| void | add (Entity entity, U &&value) |
| Attaches a new component T to entity. Also sets its value. | |
| GAIA_NODISCARD bool | override (Entity entity, Entity object) |
Materializes an inherited id as directly owned storage on entity. | |
| GAIA_NODISCARD bool | override (Entity entity, Pair pair) |
Materializes an inherited pair as directly owned storage on entity. | |
| template<typename T > | |
| GAIA_NODISCARD bool | override (Entity entity) |
Materializes an inherited typed component as directly owned storage on entity. | |
| template<typename T > | |
| GAIA_NODISCARD bool | override (Entity entity, Entity object) |
Materializes an inherited typed component associated with object on entity. | |
| void | clear (Entity entity) |
| Removes any component or entity attached to entity. | |
| GAIA_NODISCARD Entity | copy (Entity srcEntity) |
| Creates a new entity by cloning an already existing one. Does not trigger observers. | |
| template<typename Func = TFunc_Void_With_Entity> | |
| void | copy_n (Entity entity, uint32_t count, Func func=func_void_with_entity) |
| Creates count new entities by cloning an already existing one. | |
| GAIA_NODISCARD Entity | instantiate (Entity prefabEntity) |
| Instantiates a prefab as a normal entity. The instance copies the prefab's direct data, drops the Prefab tag, does not copy the name, removes the prefab's direct Is edges, and adds a direct Pair(Is, prefabEntity) edge instead. Prefab children linked through Parent or ChildOf are instantiated with the same hierarchy relation. | |
| GAIA_NODISCARD Entity | instantiate (Entity prefabEntity, Entity parentInstance) |
Instantiates a prefab as a normal entity parented under parentInstance. The instance copies the prefab's direct data, drops the Prefab tag, does not copy the name, removes the prefab's direct Is edges, adds a direct Pair(Is, prefabEntity) edge instead, and attaches Pair(Parent, parentInstance) to the new root instance. Prefab children linked through Parent or ChildOf are instantiated with the same hierarchy relation. | |
| template<typename Func = TFunc_Void_With_Entity> | |
| void | instantiate_n (Entity prefabEntity, uint32_t count, Func func=func_void_with_entity) |
| Instantiates count copies of a prefab as normal root entities. Each instance copies the prefab's direct data, drops the Prefab tag, does not copy the name, removes the prefab's direct Is edges, and adds a direct Pair(Is, prefabEntity) edge instead. Recursively instantiated prefab children keep their Parent or ChildOf hierarchy relation. | |
| void | instantiate_n (Entity prefabEntity, Entity parentInstance, uint32_t count) |
| Instantiates count copies of a prefab as normal root entities parented under parentInstance. Each spawned root instance receives a direct Pair(Parent, parentInstance) relationship. Recursively instantiated prefab children keep their Parent or ChildOf hierarchy relation. | |
| template<typename Func > | |
| void | instantiate_n (Entity prefabEntity, Entity parentInstance, uint32_t count, Func func) |
| Instantiates count copies of a prefab as normal root entities, assigning a direct Pair(Parent, parentInstance) relationship when parentInstance is not EntityBad. The callback is invoked for each spawned root instance after its subtree has been instantiated. Recursively instantiated prefab children keep their Parent or ChildOf hierarchy relation. | |
| GAIA_NODISCARD uint32_t | sync (Entity prefabEntity) |
| Propagates additive prefab changes to existing non-prefab instances. Missing copied ids are added to existing instances and missing prefab children are spawned with their Parent or ChildOf hierarchy relation. Existing owned instance data is left intact. | |
| GAIA_NODISCARD Entity | find_prefab_instance (Entity instanceRoot, Entity prefabEntity) const |
Finds the entity inside instanceRoot that was instantiated from prefabEntity. The lookup checks instanceRoot first, then walks direct Parent and ChildOf descendants breadth-first. It matches the direct Pair(Is, prefabEntity) edge created by prefab instantiation and does not use names. | |
| void | del (Entity entity) |
| Removes an entity along with all data associated with it. | |
| void | del (Entity entity, Entity object) |
| Removes an object from entity if possible. | |
| void | del (Entity entity, Pair pair) |
| Removes an existing entity relationship pair. | |
| template<typename T > | |
| void | del (Entity entity) |
| Removes a component T from entity. | |
| void | as (Entity entity, Entity entityBase) |
| Shortcut for add(entity, Pair(Is, entityBase)). | |
| GAIA_NODISCARD bool | is (Entity entity, Entity entityBase) const |
| Checks if entity inherits from entityBase. | |
| GAIA_NODISCARD bool | in (Entity entity, Entity entityBase) const |
| Checks if entity is located in entityBase. This is almost the same as "is" with the exception that false is returned if entity matches entityBase. | |
| GAIA_NODISCARD bool | is_base (Entity target) const |
| Checks whether an entity is the target of at least one direct Is relation. | |
| void | child (Entity entity, Entity parent) |
| Shortcut for add(entity, Pair(ChildOf, parent)). | |
| GAIA_NODISCARD bool | child (Entity entity, Entity parent) const |
Checks whether entity has a ChildOf relationship to parent. | |
| void | parent (Entity entity, Entity parentEntity) |
Adds a direct non-fragmenting Parent relationship to parentEntity. The relationship is non-fragmenting and does not participate in archetype identity. | |
| GAIA_NODISCARD bool | parent (Entity entity, Entity parentEntity) const |
Checks whether entity has a direct non-fragmenting Parent relationship to parentEntity. | |
| template<typename T > | |
| void | modify (Entity entity) |
Marks the component type T as modified. Best used with acc_mut().sset() or set() to manually trigger an update at user's whim. If TriggerSetEffects is true, also triggers the component's set side effects: set hooks and OnSet observers. | |
| template<typename T > | |
| void | modify (Entity entity, Entity object) |
Marks the component associated with object as modified on entity. Best used with mut<T>(entity, object) or sset<T>(entity, object) to manually trigger an update at user's whim. If TriggerSetEffects is true, also triggers the component's set side effects: set hooks and OnSet observers. | |
| GAIA_NODISCARD ComponentSetter | acc_mut (Entity entity) |
| Starts a bulk set operation on entity. | |
| template<typename T > | |
| GAIA_NODISCARD auto | set (Entity entity) |
Returns a write-back proxy for the component T on entity. The proxy copies the current value, lets the caller mutate it, then writes it back at the end of the full expression or scope. OnSet observers and chunk-backed set hooks are triggered only after the write-back completes. | |
| template<typename T > | |
| GAIA_NODISCARD auto | set (Entity entity, Entity object) |
Returns a write-back proxy for the component associated with object on entity. The proxy copies the current value, lets the caller mutate it, then writes it back at the end of the full expression or scope. OnSet observers and chunk-backed set hooks are triggered only after the write-back completes. | |
| template<typename T > | |
| GAIA_NODISCARD decltype(auto) | sset (Entity entity) |
Returns silent mutable access to component type T on entity. This is a silent write and does not trigger set hooks or OnSet observers. | |
| template<typename T > | |
| GAIA_NODISCARD decltype(auto) | sset (Entity entity, Entity object) |
Sets the value of the component associated with object on entity without updating world version. This is a silent write and does not trigger set hooks or OnSet observers. | |
| template<typename T > | |
| GAIA_NODISCARD decltype(auto) | mut (Entity entity) |
Returns a mutable reference or proxy to the component on entity without triggering a world version update. This is a silent raw write path. Call modify<T, true>(entity) when you need hooks or OnSet. | |
| template<typename T > | |
| GAIA_NODISCARD decltype(auto) | mut (Entity entity, Entity object) |
Returns a mutable reference or proxy to the component associated with object on entity. This is a silent raw write path. Call modify<T, true>(entity, object) when you need hooks or OnSet. | |
| GAIA_NODISCARD ComponentRawView | get_raw (Entity entity, Entity component) const |
| Returns raw read-only bytes for an AoS component or exact pair payload on entity. Inherited ids resolve to the owning entity. SoA and unsupported components return an invalid view. | |
| GAIA_NODISCARD ComponentRawMutView | mut_raw (Entity entity, Entity component) |
Returns raw mutable bytes for a directly owned AoS component or exact pair payload. This is a silent write path. Pair with modify_raw() to emit set hooks and OnSet observers. | |
| GAIA_NODISCARD ComponentRawView | get_raw_field (Entity entity, Entity component, uint32_t fieldIdx) const |
| Returns one read-only field value from a directly addressed SoA field array. The field index follows the registered SoA field order. Inherited ids resolve to the owning entity. | |
| GAIA_NODISCARD ComponentRawMutView | mut_raw_field (Entity entity, Entity component, uint32_t fieldIdx) |
Returns one mutable field value from a directly owned SoA field array. This is a silent write path. Pair with modify_raw() to emit set hooks and OnSet observers. | |
| GAIA_NODISCARD ComponentCursor | cursor (Entity entity, Entity component) const |
| Creates a read-only cursor over a runtime component on entity. Inherited ids resolve like get_raw(). SoA roots expose fields without pretending the root is contiguous. | |
| GAIA_NODISCARD ComponentCursor | cursor_mut (Entity entity, Entity component) |
| Creates a mutable cursor over a directly owned runtime component on entity. Direct writes through mut_ptr() are silent and must be paired with modify_raw(). Writes through ComponentCursor::set_raw() finishes the root component write automatically. | |
| bool | add_raw (Entity entity, Entity component, const void *data, uint32_t size) |
Adds an AoS component and initializes its raw payload before OnAdd observers run. | |
| bool | set_raw (Entity entity, Entity component, const void *data, uint32_t size) |
| Replaces raw bytes for a directly owned AoS component and finishes the write. | |
| void | modify_raw (Entity entity, Entity component) |
| Marks a raw payload or SoA field returned by a mutable raw view as modified and emits normal set side effects. | |
| ComponentGetter | acc (Entity entity) const |
| Starts a bulk get operation on an entity. | |
| template<typename T > | |
| GAIA_NODISCARD decltype(auto) | get (Entity entity) const |
| Returns the value stored in the component T on entity. | |
| template<typename T > | |
| GAIA_NODISCARD decltype(auto) | get (Entity entity, Entity object) const |
Returns the value stored in the component associated with object on entity. | |
| GAIA_NODISCARD bool | has (Entity entity) const |
| Checks if entity is currently used by the world. | |
| GAIA_NODISCARD bool | has (Pair pair) const |
| Checks if pair is currently used by the world. | |
| GAIA_NODISCARD bool | has (Entity entity, Entity object) const |
| Checks if entity contains the entity object. | |
| GAIA_NODISCARD bool | has_direct (Entity entity, Entity object) const |
| Checks if entity directly contains the entity object, without semantic inheritance expansion. | |
| GAIA_NODISCARD bool | has_direct (Entity entity, Pair pair) const |
Checks if entity directly contains pair, without semantic inheritance expansion. | |
| GAIA_NODISCARD std::span< const Entity > | lookup_path () const |
| Returns the ordered component lookup path used for unqualified component lookup. Each scope is searched like a temporary component scope: the scope first, then its parents. | |
| void | lookup_path (std::span< const Entity > scopes) |
| Replaces the ordered component lookup path used for unqualified component lookup. Each scope is searched in the order provided, and each scope walk includes its parents. | |
| GAIA_NODISCARD Entity | scope () const |
| Returns the current component scope used for component registration and relative component lookup. | |
| Entity | scope (Entity scope) |
| Sets the current component scope used for component registration and relative component lookup. The scope entity and its ChildOf ancestors are expected to have names so we can build a path from them. | |
| template<typename Func > | |
| void | scope (Entity scopeEntity, Func &&func) |
| Executes func with a temporary component scope and restores the previous scope afterwards. Relative component lookup walks up the ChildOf hierarchy of the active scope. The scope entity and its ChildOf ancestors are expected to have names so we can build a path from them. | |
| Entity | module (const char *path, uint32_t len=0) |
| Finds or builds a named module hierarchy and returns the deepest scope entity. Each path segment is mapped to an entity name and connected with ChildOf relationships. | |
| GAIA_NODISCARD bool | has (Entity entity, Pair pair) const |
| Checks if entity contains pair. | |
| template<typename T > | |
| GAIA_NODISCARD bool | has (Entity entity) const |
| Checks if entity contains the component T. | |
| void | name (Entity entity, const char *name, uint32_t len=0) |
| Assigns a name to entity. Ignored if used with pair. The string is copied and kept internally. | |
| void | name_raw (Entity entity, const char *name, uint32_t len=0) |
| Assigns a name to entity. Ignored if used with pair. The string is NOT copied. Your are responsible for its lifetime. | |
| GAIA_NODISCARD util::str_view | name (Entity entity) const |
| Returns the name assigned to entity. | |
| GAIA_NODISCARD util::str_view | name (EntityId entityId) const |
| Returns the entity name assigned to entityId. | |
| GAIA_NODISCARD Entity | resolve (const char *name, uint32_t len=0) const |
| Resolves name in the world naming system. Entity names and hierarchical entity paths are attempted first. If they do not match, component lookup uses the current scope, then the lookup path, then global component symbol, path and alias lookup. | |
| void | resolve (cnt::darray< Entity > &out, const char *name, uint32_t len=0) const |
| Collects every entity and component entity that matches name. This is useful for diagnostics when a short lookup could refer to multiple scoped components. | |
| GAIA_NODISCARD Entity | get (const char *name, uint32_t len=0) const |
| Returns the entity assigned a name name. This is a convenience alias for resolve(name). | |
| GAIA_NODISCARD const cnt::set< EntityLookupKey > * | relations (Entity target) const |
Returns relations for target. | |
| GAIA_NODISCARD Entity | relation (Entity entity, Entity target) const |
| Returns the first relationship relation for the target entity on entity. | |
| template<typename Func > | |
| void | relations (Entity entity, Entity target, Func func) const |
| Returns the relationship relations for the target entity on entity. | |
| template<typename Func > | |
| void | relations_if (Entity entity, Entity target, Func func) const |
| Returns the relationship relations for the target entity on entity. | |
| GAIA_NODISCARD const cnt::darray< Entity > & | as_relations_trav_cache (Entity target) const |
Returns the cached transitive Is descendants for a target entity. The cache is rebuilt lazily and cleared whenever an Is edge changes. | |
| GAIA_NODISCARD const cnt::darray< Entity > & | as_targets_trav_cache (Entity relation) const |
Returns the cached transitive Is targets for a relation entity. The cache is rebuilt lazily and cleared whenever an Is edge changes. | |
| GAIA_NODISCARD const cnt::darray< Entity > & | targets_trav_cache (Entity relation, Entity source) const |
Returns the cached unlimited upward traversal chain for (relation, source). The cache excludes the source entity itself and is cleared whenever a pair edge changes. | |
| GAIA_NODISCARD const cnt::darray< Entity > & | targets_all_cache (Entity source) const |
Returns the cached deduped direct targets for wildcard target traversal on source. The cache is keyed by source and cleared whenever a pair edge changes. | |
| GAIA_NODISCARD const cnt::darray< Entity > & | sources_all_cache (Entity target) const |
Returns the cached deduped direct sources for wildcard source traversal on target. The cache is keyed by target and cleared whenever a pair edge changes. | |
| template<typename Func > | |
| void | targets_trav (Entity relation, Entity source, Func func) const |
Traverses relationship targets upwards starting from source. Disabled entities act as traversal barriers and are not yielded. | |
| template<typename Func > | |
| GAIA_NODISCARD bool | targets_trav_if (Entity relation, Entity source, Func func) const |
Traverses relationship targets upwards starting from source. Disabled entities act as traversal barriers and are not yielded. | |
| GAIA_NODISCARD const cnt::darray< Entity > & | sources_bfs_trav_cache (Entity relation, Entity rootTarget) const |
Returns the cached unlimited breadth-first descendant traversal for (relation, rootTarget). The cache excludes the root target itself and is cleared whenever a pair edge changes. | |
| GAIA_NODISCARD uint32_t | depth_order_cache (Entity relation, Entity sourceTarget) const |
Returns the cached fragmenting relation depth used by depth-ordered iteration for (relation, target). The returned value is 1 for direct dependents of a root/source with no further relation targets and grows by one per level. For multi-target relations, the deepest target chain determines the result. | |
| template<typename Func > | |
| void | as_relations_trav (Entity target, Func func) const |
Traverses transitive Is descendants of target. The traversal uses the cached closure built by as_relations_trav_cache(). | |
| template<typename Func > | |
| GAIA_NODISCARD bool | as_relations_trav_if (Entity target, Func func) const |
Traverses transitive Is descendants of target until func returns true. | |
| GAIA_NODISCARD const cnt::set< EntityLookupKey > * | targets (Entity relation) const |
Returns targets for relation. | |
| GAIA_NODISCARD Entity | target (Entity entity, Entity relation) const |
| Returns the first relationship target for the relation entity on entity. | |
| template<typename Func > | |
| void | targets (Entity entity, Entity relation, Func func) const |
| Returns the relationship targets for the relation entity on entity. | |
| template<typename Func > | |
| void | targets_if (Entity entity, Entity relation, Func func) const |
| Returns the relationship targets for the relation entity on entity. | |
| GAIA_NODISCARD Entity | pair_target_if_alive (Entity pair) const |
| Resolves the target of an archetype-stored exact pair id, skipping stale cleanup-time targets. | |
| template<typename Func > | |
| void | sources (Entity relation, Entity target, Func func) const |
| Returns relationship sources for the relation and target. | |
| template<typename Func > | |
| void | sources_if (Entity relation, Entity target, Func func) const |
| Returns relationship sources for the relation and target. | |
| GAIA_NODISCARD uint32_t | count_direct_term_entities (Entity term) const |
Counts entities directly matching term, including semantic Is inheritance expansion. | |
| GAIA_NODISCARD uint32_t | count_direct_term_entities_direct (Entity term) const |
Counts entities directly matching term without semantic Is expansion. | |
| void | collect_direct_term_entities (Entity term, cnt::darray< Entity > &out) const |
Appends entities directly matching term to out, including semantic Is expansion. | |
| void | collect_direct_term_entities_direct (Entity term, cnt::darray< Entity > &out) const |
Appends entities directly matching term to out without semantic Is expansion. | |
| GAIA_NODISCARD bool | for_each_direct_term_entity (Entity term, void *ctx, bool(*func)(void *, Entity)) const |
Visits entities directly matching term, including semantic Is expansion. | |
| GAIA_NODISCARD bool | for_each_direct_term_entity_direct (Entity term, void *ctx, bool(*func)(void *, Entity)) const |
Visits entities directly matching term without semantic Is expansion. | |
| template<typename Func > | |
| void | sources_bfs (Entity relation, Entity rootTarget, Func func) const |
| Traverses relationship sources in breadth-first order. Starting at rootTarget, this visits all direct sources first and then deeper levels. | |
| template<typename Func > | |
| GAIA_NODISCARD bool | sources_bfs_if (Entity relation, Entity rootTarget, Func func) const |
| Traverses relationship sources in breadth-first order. Starting at rootTarget, this visits all direct sources first and then deeper levels. | |
| template<typename Func > | |
| void | as_targets_trav (Entity relation, Func func) const |
Traverses transitive Is targets of relation. The traversal uses the cached closure built by as_targets_trav_cache(). | |
| template<typename Func > | |
| bool | as_targets_trav_if (Entity relation, Func func) const |
Traverses transitive Is targets of relation until func returns true. | |
| CommandBufferST & | cmd_buffer_st () const |
| Returns the single-threaded deferred command buffer owned by the world. | |
| CommandBufferMT & | cmd_buffer_mt () const |
| Returns the multi-thread-safe deferred command buffer owned by the world. | |
| void | defer_sort_inv_begin (uint32_t slotCount) |
| Starts recording sorted-query invalidations instead of applying them right away. Called by the coordinator before a region whose writes may run on worker threads. | |
| void | defer_sort_inv_end () |
| Stops recording sorted-query invalidations and applies everything recorded since the matching defer_sort_inv_begin(). Invalidation runs on the calling thread, which is the coordinator once the parallel region joins. | |
| GAIA_NODISCARD bool | defer_sort_inv_active () const |
| Returns whether sorted-query invalidations are currently being recorded. | |
| void | defer_sort_inv_record (uint32_t slot, Entity entity) |
| Records a sorted-query invalidation for later application. | |
| void | enable (Entity entity, bool enable) |
| Enables or disables an entire entity. | |
| GAIA_NODISCARD bool | enabled (const EntityContainer &ec) const |
| Checks if an entity is enabled. | |
| GAIA_NODISCARD bool | enabled (Entity entity) const |
| Checks if an entity is enabled. | |
| GAIA_NODISCARD bool | enabled_hierarchy (Entity entity, Entity relation) const |
Checks whether an entity is enabled together with all of its ancestors reachable through relation. This keeps direct enabled state separate from hierarchy-aware gating. | |
| GAIA_NODISCARD Chunk * | get_chunk (Entity entity) const |
| Returns a chunk containing the entity. | |
| GAIA_NODISCARD Chunk * | get_chunk (Entity entity, uint32_t &row) const |
| Returns a chunk containing the entity. Index of the entity is stored in row. | |
| GAIA_NODISCARD uint32_t | size () const |
| Returns the number of active entities. | |
| void | runtime_counters (uint32_t &outArchetypes, uint32_t &outChunks, uint32_t &outEntitiesTotal, uint32_t &outEntitiesActive) const |
| Returns high-level runtime counters useful for diagnostics/telemetry. | |
| GAIA_NODISCARD uint32_t & | world_version () |
| Returns the current version of the world. | |
| GAIA_NODISCARD uint32_t | rel_version (Entity relation) const |
| Returns structural version for a given relation. Increments whenever any Pair(relation, *) is added or removed on any entity. | |
| GAIA_NODISCARD uint32_t | enabled_hierarchy_version () const |
| Returns the version that changes when entity enabled state changes. Hierarchy-aware cached traversals use this to invalidate ancestor gating state. | |
| GAIA_NODISCARD uint32_t | archetype_delete_version () const |
| Returns the version that changes when archetype deletion visibility changes. | |
| void | update_src_entity_version (Entity entity) |
| Updates a tracked source-entity version after the entity changes archetype membership. | |
| void | remove_src_entity_version (Entity entity) |
| Removes sparse source-version state for an entity that is being destroyed. | |
| void | set_max_lifespan (Entity entity, uint32_t lifespan=Archetype::MAX_ARCHETYPE_LIFESPAN) |
| Sets maximal lifespan of an archetype entity belongs to. | |
| void | frame_cleanup () |
| Performs deferred cleanup for the current frame. | |
| void | frame_end () |
| Marks the end of the current frame. | |
| void | update () |
| Runs systems and then finishes the current frame. | |
| void | teardown () |
| Performs world shutdown maintenance without running systems or observers. Runtime callbacks are shut down in-place first, then deferred entity/chunk/archetype cleanup is drained until no more pending teardown work remains. | |
| void | cleanup () |
| Clears the world so that all its entities and components are released. | |
| void | defrag_entities_per_tick (uint32_t value) |
| Sets the maximum number of entities defragmented per world tick. | |
| void | diag_archetypes () const |
| Performs diagnostics on archetypes. Prints basic info about them and the chunks they contain. | |
| void | diag_components () const |
| Performs diagnostics on registered components. Prints basic info about them and reports and detected issues. | |
| void | diag_entities () const |
| Performs diagnostics on entities of the world. Also performs validation of internal structures which hold the entities. | |
| void | diag () const |
| Performs all diagnostics. | |
| GAIA_NODISCARD bool | locked () const |
| Checks if the chunk is locked for structural changes. | |
| GAIA_NODISCARD bool | tearing_down () const |
| Returns true while the world is draining teardown work and normal runtime callbacks must not execute. | |
| void | save () |
| Saves contents of the world to a buffer. The buffer is reset, not appended. NOTE: In order for custom version of save to be used for a given component, it needs to have either of the following functions defined: 1) member function: "void save(bin_stream& s)" 2) free function in gaia::ser namespace: "void tag_invoke(gaia::ser::save_v, bin_stream& s,
const YourType& data)". | |
| bool | load (ser::serializer inputSerializer={}) |
| Loads a world state from a buffer. The buffer is sought to 0 before any loading happens. NOTE: In order for custom version of load to be used for a given component, it needs to have either of the following functions defined: 1) member function: "void load(bin_stream& s)" 2) free function in gaia::ser namespace: "void tag_invoke(gaia::ser::load_v, bin_stream& s,
YourType& data)". | |
| template<typename TSerializer > | |
| bool | load (TSerializer &inputSerializer) |
| Loads a world state from a serializer-compatible stream wrapper. | |
| QuerySerBuffer & | query_buffer (QueryId &serId) |
| Returns the temporary serialization buffer used while building a query. A fresh query id is allocated lazily when serId is QueryIdBad. | |
| void | query_buffer_reset (QueryId &serId) |
| Releases the temporary serialization buffer associated with serId. | |
| void | invalidate_queries_for_structural_entity (EntityLookupKey entityKey) |
| Invalidates cached queries structurally affected by entityKey. | |
| void | invalidate_queries_for_rel (Entity relation) |
| Invalidates cached queries whose dynamic result depends on relation. | |
| GAIA_NODISCARD bool | has_sorted_queries () const |
| Checks whether any cached sorted query is registered in this world. | |
| GAIA_NODISCARD bool | has_sorted_queries_for_entity (Entity entity) const |
| Checks whether any cached sorted query depends on entity being written. | |
| void | invalidate_sorted_queries_for_entity (Entity entity) |
| Invalidates cached sorted queries whose row ordering depends on entity. | |
| void | invalidate_sorted_queries () |
| Invalidates all cached sorted queries after row-order changes. | |
| void | invalidate_queries_for_entity (Pair is_pair) |
Invalidates semantic Is queries affected by removing or changing is_pair. | |
| Entity | name_to_entity (std::span< const char > exprRaw) const |
Resolves a textual id expression to an entity. Supports names, aliases, wildcard *, and pair expressions like (Rel, Target). | |
| Entity | expr_to_entity (va_list &args, std::span< const char > exprRaw) const |
Resolves a textual id expression with e placeholders to an entity. Supports the same pair and wildcard syntax as name_to_entity(). | |
Static Public Member Functions | |
| static GAIA_NODISCARD bool | is_req_del (const EntityContainer &ec) |
| Returns whether the record is already in delete-requested state. Covers both explicit per-entity deletion and archetype-level forced teardown. | |
| template<typename T > | |
| static GAIA_NODISCARD constexpr bool | supports_sparse_component_storage () |
| Sparse storage currently supports only plain generic components. Pairs, unique components and SoA layouts stay on the normal archetype path. | |
| template<typename T > | |
| static GAIA_NODISCARD constexpr bool | uses_compile_time_sparse_storage () |
| Returns whether T has compile-time sparse payload storage. | |
Static Public Attributes | |
| static bool | s_enableUniqueNameDuplicateAssert = true |
| Allows asserts on duplicate name/alias assignment. | |
Friends | |
| struct | ComponentGetter |
| struct | ComponentSetter |
| void | lock (World &) |
| void | unlock (World &) |
| QueryMatchScratch & | query_match_scratch_acquire (World &) |
| Acquires temporary scratch storage used during query matching. | |
| void | query_match_scratch_release (World &, bool) |
| Releases previously acquired query-match scratch storage. | |
| uint32_t | world_component_index_bucket_size (const World &, Entity) |
| Returns the size of the component-to-archetype bucket for term. | |
| uint32_t | world_component_index_comp_idx (const World &, const Archetype &, Entity) |
| Returns the cached component index of term inside archetype. | |
| uint32_t | world_component_index_match_count (const World &, const Archetype &, Entity) |
| Returns the cached match count of term inside archetype. | |
| template<typename T > | |
| decltype(auto) | world_direct_entity_arg (World &world, Entity entity) |
| Returns a direct query argument for entity using immediate-write access for mutable references. | |
| template<typename T > | |
| decltype(auto) | world_direct_entity_arg_raw (World &world, Entity entity) |
| Returns a direct query argument for entity using raw mutable access. | |
| template<typename T > | |
| decltype(auto) | world_query_entity_arg_by_id (World &world, Entity entity, Entity id) |
| Returns the query argument for entity using explicit term id id. Mutable references materialize an override when inherited data must become direct. | |
| template<typename T > | |
| decltype(auto) | world_query_entity_arg_by_id_raw (World &world, Entity entity, Entity id) |
| Returns the query argument for entity using explicit term id id and raw mutable access. Mutable references materialize an override when inherited data must become direct. | |
| void | world_finish_write (World &world, Entity term, Entity entity) |
| Finishes a cursor write through the owning world. | |
| uint32_t | world_rel_version (const World &world, Entity relation) |
Returns the current version of relation-specific traversal metadata. | |
| uint32_t | world_version (const World &world) |
| Returns the current world structural version. | |
| uint32_t | world_archetype_delete_version (const World &world) |
| Returns the version that changes when an archetype enters or leaves the deletion-request set. | |
| uint32_t | world_entity_archetype_version (const World &world, Entity entity) |
| Returns the per-entity archetype version used for targeted source-query freshness checks. | |
Owns entities, components, archetypes, queries, observers, and systems.
|
inline |
Starts a bulk get operation on an entity.
| entity | Entity |
|
inline |
Starts a bulk set operation on entity.
| entity | Entity |
|
inline |
|
inline |
|
inline |
Registers a compile-time component with explicit runtime type metadata. Metadata is applied only during first registration. Existing component metadata remains immutable. Runtime metadata does not change typed storage, lifecycle callbacks, or the component symbol.
| T | Component type to register. |
| runtimeType | Reflection-only metadata attached during first registration. |
|
inline |
Attaches entity object to entity entity.
| entity | Source entity |
| object | Added entity |
|
inline |
Attaches object to entity. Also sets its value.
| object | Object |
| entity | Entity |
| value | Value to set for the object |
Attaches a relationship pair to entity.
| entity | Source entity. |
| pair | Pair to attach. |
|
inline |
Attaches a new component T to entity. Also sets its value.
| T | Component |
| entity | Entity |
| value | Value to set for the component |
|
inline |
Creates a new empty entity.
| kind | Entity kind. Generic entity by default. |
|
inline |
Creates count of entities of the same archetype as entity.
| entity | Source entity whose archetype is reused. |
| count | Number of entities to create. |
| func | Functor invoked for each new entity. |
|
inline |
Creates count new empty entities.
| count | Number of entities to create. |
| func | Functor invoked for each new entity. |
|
inline |
Adds an AoS component and initializes its raw payload before OnAdd observers run.
| entity | Entity receiving the component. |
| component | Runtime component entity or exact relationship pair. |
| data | Payload bytes. Must be non-null when the component size is non-zero. |
| size | Payload byte count. Must match the registered component size. |
|
inline |
Finds an entity by its exact alias.
| alias | Exact entity alias. |
| len | String length. If zero, the length is calculated. |
|
inline |
Returns the alias assigned to an entity.
| entity | Entity. |
|
inline |
Assigns an alias name to an entity.
| entity | Entity. |
| alias | Alias to assign. Pass nullptr to clear the current alias. |
| len | String length. If zero, the length is calculated. |
|
inline |
Assigns an alias name to an entity without copying the string.
| entity | Entity. |
| alias | Alias to assign. Pass nullptr to clear the current alias. |
| len | String length. If zero, the length is calculated. |
|
inline |
Returns the version that changes when archetype deletion visibility changes.
Shortcut for add(entity, Pair(Is, entityBase)).
| entity | Entity receiving the inheritance pair. |
| entityBase | Base entity to inherit from. |
|
inline |
Traverses transitive Is descendants of target. The traversal uses the cached closure built by as_relations_trav_cache().
| target | Target entity |
| func | void(Entity relation) functor executed for each descendant relation. |
|
inline |
Returns the cached transitive Is descendants for a target entity. The cache is rebuilt lazily and cleared whenever an Is edge changes.
| target | Base entity whose derived entities are requested. |
target. Small inline traversal stack for the common shallow inheritance case.
|
inline |
Traverses transitive Is descendants of target until func returns true.
| target | Target entity |
| func | bool(Entity relation) functor executed for each descendant relation. Stops if true is returned. |
|
inline |
Traverses transitive Is targets of relation. The traversal uses the cached closure built by as_targets_trav_cache().
| relation | Relation entity |
| func | void(Entity target) functor executed for each inherited target. |
|
inline |
Returns the cached transitive Is targets for a relation entity. The cache is rebuilt lazily and cleared whenever an Is edge changes.
| relation | Derived entity whose transitive bases are requested. |
relation. Small inline traversal stack for the common shallow inheritance case.
|
inline |
Traverses transitive Is targets of relation until func returns true.
| relation | Relation entity |
| func | bool(Entity target) functor executed for each inherited target. Stops if true is returned. |
|
inline |
Starts a bulk add/remove operation on entity.
| entity | Entity |
|
inline |
Returns whether a runtime storage trait can be attached to component. Compile-time component storage is authoritative. Runtime component descriptors remain mutable.
| component | Component entity. |
|
inline |
Shortcut for add(entity, Pair(ChildOf, parent)).
| entity | Entity receiving the ChildOf pair. |
| parent | Parent target of the ChildOf pair. |
Checks whether entity has a ChildOf relationship to parent.
| entity | Entity to inspect. |
| parent | Candidate parent entity. |
|
inline |
Removes any component or entity attached to entity.
| entity | Entity we want to remove any attached component or entity from |
|
inline |
Returns the multi-thread-safe deferred command buffer owned by the world.
|
inline |
Returns the single-threaded deferred command buffer owned by the world.
|
inline |
Appends entities directly matching term to out, including semantic Is expansion.
| term | Query term |
| out | Output array |
|
inline |
Appends entities directly matching term to out without semantic Is expansion.
| term | Query term |
| out | Output array |
|
inline |
Returns read-only access to the world component cache.
|
inline |
Returns mutable access to the world component cache.
|
inline |
Returns the fragmentation mode for a component known at compile time to use sparse storage.
| component | Typed sparse component entity. |
|
inline |
Returns whether component is non-fragmenting. Non-fragmenting components do not participate in archetype identity.
| component | Component entity to inspect. |
|
inline |
Returns whether component stores instance data in sparse storage instead of archetype chunks. This is currently the storage path used for sparse plain generic AoS components.
| component | Component entity to inspect. |
|
inline |
Checks whether an inter-world copy includes a non-fragmenting sparse payload.
| comp | Component entity being copied. |
| srcEntity | Source entity in store. |
| store | Type-erased sparse store containing the source payload. |
|
inline |
Checks whether an inter-world copy includes a sparse component payload.
| comp | Component entity being copied. |
| srcEntity | Source entity in store. |
| store | Type-erased sparse store containing the source payload. |
srcEntity owns the sparse payload and comp uses sparse storage. Creates a new entity by cloning an already existing one. Does not trigger observers.
| srcEntity | Entity to clone |
|
inline |
Creates count new entities by cloning an already existing one.
| entity | Entity to clone |
| count | Number of clones to make |
| func | Functor executed every time a copy is created. It can be either void(ecs::Entity) or void(ecs::CopyIter&). |
|
inline |
Counts entities directly matching term, including semantic Is inheritance expansion.
| term | Query term |
|
inline |
Counts entities directly matching term without semantic Is expansion.
| term | Query term |
|
inline |
Creates a read-only cursor over a runtime component on entity. Inherited ids resolve like get_raw(). SoA roots expose fields without pretending the root is contiguous.
| entity | Entity being read. |
| component | Component entity or exact relationship pair being read. |
|
inline |
Creates a mutable cursor over a directly owned runtime component on entity. Direct writes through mut_ptr() are silent and must be paired with modify_raw(). Writes through ComponentCursor::set_raw() finishes the root component write automatically.
| entity | Entity being mutated. |
| component | Component entity or exact relationship pair being mutated. |
|
inline |
Returns whether sorted-query invalidations are currently being recorded.
|
inline |
Starts recording sorted-query invalidations instead of applying them right away. Called by the coordinator before a region whose writes may run on worker threads.
| slotCount | Number of work items that can record concurrently. |
|
inline |
Records a sorted-query invalidation for later application.
| slot | Work-item slot owned exclusively by the calling thread. |
| entity | Component entity whose version was bumped by a write. |
|
inline |
Sets the maximum number of entities defragmented per world tick.
| value | Number of entities to defragment |
|
inline |
Removes an entity along with all data associated with it.
| entity | Entity to delete |
|
inline |
Removes an existing entity relationship pair.
| entity | Source entity |
| pair | Pair |
|
inline |
Removes every stored source-target mapping for a non-fragmenting relation.
| relation | Relation entity whose store is removed. |
|
inline |
Removes all outgoing non-fragmenting relations from a source entity.
| source | Source entity whose stored relation targets are removed. |
|
inline |
Deletes the sparse component store associated with component.
| component | Component entity identifying the store. |
|
inline |
Removes all sparse component instances owned by entity.
| entity | Entity |
|
inline |
Returns the cached fragmenting relation depth used by depth-ordered iteration for (relation, target). The returned value is 1 for direct dependents of a root/source with no further relation targets and grows by one per level. For multi-target relations, the deepest target chain determines the result.
| relation | Fragmenting relation defining depth edges. |
| sourceTarget | Target entity whose depth is requested. |
|
inline |
Returns the preferred display name for a entity. This is intended for diagnostics and other pretty output, not as a stable identity key.
| entity | Entity. |
|
inline |
Enables or disables an entire entity.
| entity | Entity |
| enable | Enable or disable the entity |
|
inline |
Checks if an entity is enabled.
| ec | Entity container of the entity |
|
inline |
Checks if an entity is enabled.
| entity | Entity |
|
inline |
Checks whether an entity is enabled together with all of its ancestors reachable through relation. This keeps direct enabled state separate from hierarchy-aware gating.
| entity | Entity whose effective enabled state is requested. |
| relation | Relation defining the ancestor chain. |
entity and every reachable ancestor are enabled. False otherwise.
|
inline |
Returns the version that changes when entity enabled state changes. Hierarchy-aware cached traversals use this to invalidate ancestor gating state.
|
inline |
Resolves a textual id expression with e placeholders to an entity. Supports the same pair and wildcard syntax as name_to_entity().
| args | Vararg list consumed by e placeholders |
| exprRaw | Expression text |
|
inline |
Returns the internal record for entity.
| entity | Entity or exact pair record. |
|
inline |
Returns the internal record for entity.
| entity | Entity or exact pair record. |
|
inline |
Finalizes a newly registered component entity after the cache record has been created. This synchronizes the core Component value stored on the component entity, registers the default symbol through the normal naming path, and optionally latches the Sparse trait.
| item | Registered component cache item. |
| addSparseTrait | Whether runtime sparse registration should attach the Sparse trait. |
|
inline |
Finds the entity inside instanceRoot that was instantiated from prefabEntity. The lookup checks instanceRoot first, then walks direct Parent and ChildOf descendants breadth-first. It matches the direct Pair(Is, prefabEntity) edge created by prefab instantiation and does not use names.
| instanceRoot | Root instance entity to search from. |
| prefabEntity | Prefab entity to map into the instance subtree. |
|
inline |
Visits entities directly matching term, including semantic Is expansion.
| term | Query term |
| ctx | User context passed to func |
| func | bool(void*, Entity) callback executed for each matching entity. |
|
inline |
Visits entities directly matching term without semantic Is expansion.
| term | Query term |
| ctx | User context passed to func |
| func | bool(void*, Entity) callback executed for each matching entity. |
|
inline |
Performs deferred cleanup for the current frame.
This finalizes deferred entity deletion and runs Gaia-ECS garbage collection. Use this after an external loop calls systems_run() itself, or when a frame has no system pass but still needs world cleanup.
|
inline |
Marks the end of the current frame.
This flushes pending log output and emits the profiler frame marker. External loops that call systems_run() directly should usually call frame_cleanup() and then frame_end() once per frame.
|
inline |
|
inline |
Returns the entity assigned a name name. This is a convenience alias for resolve(name).
| name | Pointer to a stable null-terminated string |
| len | String length. If zero, the length is calculated |
|
inline |
Returns the value stored in the component T on entity.
| T | Component |
| entity | Entity |
|
inline |
Returns the value stored in the component associated with object on entity.
| T | Component type represented by object. |
| entity | Entity to read, resolving inherited ownership when necessary. |
| object | Component entity selecting the payload. |
|
inline |
|
inline |
Returns raw read-only bytes for an AoS component or exact pair payload on entity. Inherited ids resolve to the owning entity. SoA and unsupported components return an invalid view.
| entity | Entity being read. |
| component | Component entity or exact relationship pair being read. |
|
inline |
Returns one read-only field value from a directly addressed SoA field array. The field index follows the registered SoA field order. Inherited ids resolve to the owning entity.
| entity | Entity being read. |
| component | Runtime component entity being read. |
| fieldIdx | SoA field array index. |
|
inline |
Returns the currently bound runtime serializer handle.
|
inline |
Checks if entity is currently used by the world.
| entity | Entity. |
|
inline |
Checks if entity contains the component T.
| T | Component |
| entity | Entity |
Checks if entity contains the entity object.
| entity | Entity |
| object | Tested entity |
Checks if entity contains pair.
| entity | Entity |
| pair | Tested pair |
|
inline |
Checks if pair is currently used by the world.
| pair | Pair |
Checks if entity directly contains the entity object, without semantic inheritance expansion.
| entity | Entity |
| object | Tested entity |
Checks if entity directly contains pair, without semantic inheritance expansion.
| entity | Entity to inspect. |
| pair | Exact or wildcard pair to test. |
pair is directly present. False otherwise.
|
inline |
Checks whether a source matches a possibly wildcarded non-fragmenting relation pair.
| source | Source entity to inspect. |
| object | Exact or wildcard relation pair to match. |
object. False otherwise.
|
inline |
Checks whether any non-fragmenting exclusive relation targeting target uses an OnDeleteTarget rule.
| target | Target entity referenced by stored non-fragmenting relations. |
| cond | OnDeleteTarget condition pair to test on each matching relation. |
cond. False otherwise.
|
inline |
Checks whether any cached sorted query is registered in this world.
|
inline |
Checks whether any cached sorted query depends on entity being written.
| entity | Entity. |
Checks if entity is located in entityBase. This is almost the same as "is" with the exception that false is returned if entity matches entityBase.
| entity | Entity |
| entityBase | Base entity |
Instantiates a prefab as a normal entity. The instance copies the prefab's direct data, drops the Prefab tag, does not copy the name, removes the prefab's direct Is edges, and adds a direct Pair(Is, prefabEntity) edge instead. Prefab children linked through Parent or ChildOf are instantiated with the same hierarchy relation.
| prefabEntity | Prefab entity to instantiate. |
prefabEntity is not marked Prefab.
|
inline |
Instantiates a prefab as a normal entity parented under parentInstance. The instance copies the prefab's direct data, drops the Prefab tag, does not copy the name, removes the prefab's direct Is edges, adds a direct Pair(Is, prefabEntity) edge instead, and attaches Pair(Parent, parentInstance) to the new root instance. Prefab children linked through Parent or ChildOf are instantiated with the same hierarchy relation.
| prefabEntity | Prefab entity to instantiate. |
| parentInstance | Entity receiving the spawned root through Parent. |
prefabEntity is not marked Prefab.
|
inline |
Instantiates count copies of a prefab as normal root entities parented under parentInstance. Each spawned root instance receives a direct Pair(Parent, parentInstance) relationship. Recursively instantiated prefab children keep their Parent or ChildOf hierarchy relation.
| prefabEntity | Prefab entity to clone |
| parentInstance | Parent entity attached to each spawned root instance |
| count | Number of clones to make |
|
inline |
Instantiates count copies of a prefab as normal root entities, assigning a direct Pair(Parent, parentInstance) relationship when parentInstance is not EntityBad. The callback is invoked for each spawned root instance after its subtree has been instantiated. Recursively instantiated prefab children keep their Parent or ChildOf hierarchy relation.
| Func | Callback type. It can be either void(ecs::Entity) or void(ecs::CopyIter&). |
| prefabEntity | Prefab entity to clone |
| parentInstance | Parent entity attached to each spawned root instance, or EntityBad for unparented roots |
| count | Number of clones to make |
| func | Functor executed for spawned root instances. |
|
inline |
Instantiates count copies of a prefab as normal root entities. Each instance copies the prefab's direct data, drops the Prefab tag, does not copy the name, removes the prefab's direct Is edges, and adds a direct Pair(Is, prefabEntity) edge instead. Recursively instantiated prefab children keep their Parent or ChildOf hierarchy relation.
| Func | Callback type. It can be either void(ecs::Entity) or void(ecs::CopyIter&). |
| prefabEntity | Prefab entity to clone |
| count | Number of clones to make |
| func | Functor executed for spawned root instances. It can be either void(ecs::Entity) or void(ecs::CopyIter&). |
|
inline |
|
inline |
Invalidates cached queries whose dynamic result depends on relation.
| relation | Relation whose dependent query results are invalidated. |
|
inline |
Invalidates cached queries structurally affected by entityKey.
| entityKey | Structural entity lookup key |
|
inline |
Invalidates cached sorted queries whose row ordering depends on entity.
| entity | Entity. |
Checks if entity inherits from entityBase.
| entity | Entity |
| entityBase | Base entity |
|
inline |
Checks whether an entity is the target of at least one direct Is relation.
| target | Candidate base entity. |
target has a derived entity. False otherwise.
|
inline |
Returns whether entity is marked DontFragment.
| entity | Entity |
|
inlinestatic |
Returns whether the record is already in delete-requested state. Covers both explicit per-entity deletion and archetype-level forced teardown.
| ec | Entity container record |
|
inline |
Loads a world state from a buffer. The buffer is sought to 0 before any loading happens. NOTE: In order for custom version of load to be used for a given component, it needs to have either of the following functions defined: 1) member function: "void load(bin_stream& s)" 2) free function in gaia::ser namespace: "void tag_invoke(gaia::ser::load_v, bin_stream& s, YourType& data)".
| inputSerializer | Serializer to read from, or an invalid handle to use the world's bound serializer. |
|
inline |
Loads a world state from a serializer-compatible stream wrapper.
| inputSerializer | Input serializer |
|
inline |
Checks if the chunk is locked for structural changes.
|
inline |
Returns the ordered component lookup path used for unqualified component lookup. Each scope is searched like a temporary component scope: the scope first, then its parents.
|
inline |
Replaces the ordered component lookup path used for unqualified component lookup. Each scope is searched in the order provided, and each scope walk includes its parents.
| scopes | Ordered lookup scopes. Pass an empty span to clear the lookup path. |
|
inline |
Marks the component type T as modified. Best used with acc_mut().sset() or set() to manually trigger an update at user's whim. If TriggerSetEffects is true, also triggers the component's set side effects: set hooks and OnSet observers.
| T | Component type |
| TriggerSetEffects | Triggers set side effects if true |
| entity | Entity whose component version is updated. |
Marks the component associated with object as modified on entity. Best used with mut<T>(entity, object) or sset<T>(entity, object) to manually trigger an update at user's whim. If TriggerSetEffects is true, also triggers the component's set side effects: set hooks and OnSet observers.
| T | Component type |
| TriggerSetEffects | Triggers set side effects if true |
|
inline |
Finds or builds a named module hierarchy and returns the deepest scope entity. Each path segment is mapped to an entity name and connected with ChildOf relationships.
| path | Dotted module path such as "gameplay.render". |
| len | String length. If zero, the length is calculated. |
|
inline |
Returns a mutable reference or proxy to the component on entity without triggering a world version update. This is a silent raw write path. Call modify<T, true>(entity) when you need hooks or OnSet.
| T | Component |
| entity | Entity |
|
inline |
Returns a mutable reference or proxy to the component associated with object on entity. This is a silent raw write path. Call modify<T, true>(entity, object) when you need hooks or OnSet.
| T | Component type represented by object. |
|
inline |
Returns raw mutable bytes for a directly owned AoS component or exact pair payload. This is a silent write path. Pair with modify_raw() to emit set hooks and OnSet observers.
| entity | Entity being mutated. |
| component | Component entity or exact relationship pair being mutated. |
|
inline |
Returns one mutable field value from a directly owned SoA field array. This is a silent write path. Pair with modify_raw() to emit set hooks and OnSet observers.
| entity | Entity being mutated. |
| component | Runtime component entity being mutated. |
| fieldIdx | SoA field array index. |
|
inline |
Returns the name assigned to entity.
| entity | Entity |
|
inline |
Assigns a name to entity. Ignored if used with pair. The string is copied and kept internally.
| entity | Entity |
| name | A null-terminated string |
| len | String length. If zero, the length is calculated |
|
inline |
Returns the entity name assigned to entityId.
| entityId | EntityId |
|
inline |
Assigns a name to entity. Ignored if used with pair. The string is NOT copied. Your are responsible for its lifetime.
| entity | Entity |
| name | Pointer to a stable null-terminated string |
| len | String length. If zero, the length is calculated |
|
inline |
Resolves a textual id expression to an entity. Supports names, aliases, wildcard *, and pair expressions like (Rel, Target).
| exprRaw | Expression text |
|
inline |
Removes an exclusive non-fragmenting relation from a source entity.
| source | Source entity whose relation is removed. |
| relation | Non-fragmenting relation entity. |
| target | Expected target, or EntityBad to remove the current target unconditionally. |
|
inline |
Sets an exclusive non-fragmenting relation target, creating its store when necessary.
| source | Source entity whose target is replaced. |
| relation | Non-fragmenting relation entity. |
| target | New target entity. |
|
inline |
Sets an exclusive non-fragmenting relation target in an existing store.
| store | Relation store to update. |
| source | Source entity whose target is replaced. |
| relation | Non-fragmenting relation entity represented by store. |
| target | New target entity. |
|
inline |
Returns the non-fragmenting relation store for relation, or nullptr when absent.
| relation | Relation entity |
|
inline |
Returns the non-fragmenting relation store for relation, creating it if needed.
| relation | Relation entity |
|
inline |
Materializes an inherited id as directly owned storage on entity.
| entity | Entity receiving the local override. |
| object | Inherited component or pair id to materialize. |
|
inline |
Materializes an inherited typed component associated with object on entity.
| T | Component type represented by object. |
| entity | Entity receiving the local override. |
| object | Inherited component entity to materialize. |
Materializes an inherited pair as directly owned storage on entity.
| entity | Entity receiving the local override. |
| pair | Inherited pair to materialize. |
Resolves the target of an archetype-stored exact pair id, skipping stale cleanup-time targets.
| pair | Exact relationship pair whose target is resolved. |
Adds a direct non-fragmenting Parent relationship to parentEntity. The relationship is non-fragmenting and does not participate in archetype identity.
| entity | Entity to inspect. |
| parentEntity | Candidate parent entity. |
Checks whether entity has a direct non-fragmenting Parent relationship to parentEntity.
| entity | Entity to inspect. |
| parentEntity | Candidate parent entity. |
Parent. False otherwise.
|
inline |
Finds a component entity by its exact scoped path.
| path | Exact component path. |
| len | String length. If zero, the length is calculated. |
|
inline |
Returns the scoped path name for a component entity.
| component | Component entity. |
|
inline |
Assigns a scoped path name to a component entity.
| component | Component entity. |
| path | Path to assign. Pass nullptr to clear the current path. |
| len | String length. If zero, the length is calculated. |
|
inline |
Creates a new prefab entity.
| kind | Entity kind. Generic entity by default. |
|
inline |
Provides a cached query set up to work with the parent world. Cached queries use local scope by default.
|
inline |
Returns the temporary serialization buffer used while building a query. A fresh query id is allocated lazily when serId is QueryIdBad.
| serId | Query serialization id |
|
inline |
Releases the temporary serialization buffer associated with serId.
| serId | Query serialization id reset to QueryIdBad on return. |
|
inline |
|
inline |
Returns structural version for a given relation. Increments whenever any Pair(relation, *) is added or removed on any entity.
| relation | Relation whose structural version is requested. |
Returns the first relationship relation for the target entity on entity.
| entity | Source entity |
| target | Target entity |
|
inline |
Returns true when depth-ordered iteration may safely prune disabled subtrees at archetype level. Only fragmenting hierarchy relations qualify because all rows in the archetype then share the same direct parent and therefore the same ancestor chain.
| relation | Relation entity to inspect. |
|
inline |
Returns true when the relation still participates in archetype identity. Non-fragmenting relations such as Parent are excluded.
| relation | Relation entity to inspect. |
relation participates in archetype identity. False otherwise.
|
inline |
Returns true for hierarchy relations that still fragment archetypes. ChildOf satisfies this today, while Parent intentionally does not.
| relation | Relation entity to inspect. |
relation is both hierarchical and fragmenting. False otherwise.
|
inline |
Returns true for hierarchy-like relations whose targets form an exclusive traversable parent chain. ChildOf and Parent satisfy this today. DependsOn intentionally does not.
| relation | Relation entity to inspect. |
relation is exclusive and traversable. False otherwise.
|
inline |
Returns whether relation is non-fragmenting.
| relation | Relation entity |
|
inline |
Returns true when the relation can drive cached depth-ordered iteration. This requires a fragmenting relation whose target participates in archetype identity, such as ChildOf, DependsOn, or a custom fragmenting relation. Cycles are still invalid and are diagnosed by the depth cache itself.
| relation | Relation entity to inspect. |
relation can provide archetype-level depth ordering. False otherwise.
|
inline |
Returns whether relation uses non-fragmenting relation storage. Only exclusive non-fragmenting relations use this storage path.
| relation | Relation entity |
|
inline |
Returns the relationship relations for the target entity on entity.
| entity | Source entity |
| target | Target entity |
| func | void(Entity relation) functor executed for relationship relation found. |
|
inline |
Returns relations for target.
| target | Target entity |
target, or nullptr when none do. target is valid. Undefined behavior otherwise.
|
inline |
Returns the relationship relations for the target entity on entity.
| entity | Source entity |
| target | Target entity |
| func | bool(Entity relation) functor executed for relationship relation found. Stops if false is returned. |
|
inline |
Removes sparse source-version state for an entity that is being destroyed.
| entity | Source entity whose tracked version entry is removed. |
|
inline |
Collects every entity and component entity that matches name. This is useful for diagnostics when a short lookup could refer to multiple scoped components.
| [out] | out | Output array cleared and then filled with unique matching entities. |
| name | Pointer to a stable null-terminated string. | |
| len | String length. If zero, the length is calculated. |
|
inline |
Resolves name in the world naming system. Entity names and hierarchical entity paths are attempted first. If they do not match, component lookup uses the current scope, then the lookup path, then global component symbol, path and alias lookup.
| name | Pointer to a stable null-terminated string |
| len | String length. If zero, the length is calculated |
|
inline |
Returns high-level runtime counters useful for diagnostics/telemetry.
| [out] | outArchetypes | Number of allocated archetypes, including deletion-pending archetypes. |
| [out] | outChunks | Number of chunks owned by those archetypes. |
| [out] | outEntitiesTotal | Total rows across those chunks. |
| [out] | outEntitiesActive | Enabled rows across those chunks. |
|
inline |
Returns the resolved scheduler used by this world.
|
inline |
Returns the current component scope used for component registration and relative component lookup.
Sets the current component scope used for component registration and relative component lookup. The scope entity and its ChildOf ancestors are expected to have names so we can build a path from them.
| scope | Scope entity. Pass EntityBad to clear the current component scope. |
|
inline |
Executes func with a temporary component scope and restores the previous scope afterwards. Relative component lookup walks up the ChildOf hierarchy of the active scope. The scope entity and its ChildOf ancestors are expected to have names so we can build a path from them.
| scopeEntity | Scope entity. Pass EntityBad to temporarily disable component scope. |
| func | Callable executed while the scope is active. |
|
inline |
Returns a write-back proxy for the component T on entity. The proxy copies the current value, lets the caller mutate it, then writes it back at the end of the full expression or scope. OnSet observers and chunk-backed set hooks are triggered only after the write-back completes.
| T | Component |
| entity | Entity |
|
inline |
Returns a write-back proxy for the component associated with object on entity. The proxy copies the current value, lets the caller mutate it, then writes it back at the end of the full expression or scope. OnSet observers and chunk-backed set hooks are triggered only after the write-back completes.
| T | Component |
|
inline |
|
inline |
Latches Sparse storage on a component entity before any instances exist. This moves the payload out of chunks while keeping the id in archetype identity. Only plain generic AoS components are supported.
| component | Component entity. |
|
inline |
Sets maximal lifespan of an archetype entity belongs to.
| entity | Entity |
| lifespan | How many world updates an empty archetype is kept. If zero, the archetype it kept indefinitely. |
|
inline |
Replaces raw bytes for a directly owned AoS component and finishes the write.
| entity | Entity whose component is being replaced. |
| component | Runtime component entity or exact relationship pair. |
| data | Payload bytes. Must be non-null when the component size is non-zero. |
| size | Payload byte count. Must match the registered component size. |
|
inline |
Installs a custom scheduler used by ECS parallel execution paths.
| sched | Scheduler descriptor to bind to this world. |
|
inline |
Binds a pre-built runtime serializer handle.
| serializer | Serializer handle to store. |
|
inline |
Binds a concrete serializer object through ser::make_serializer().
| serializer | Serializer instance to wrap. |
|
inline |
Returns the number of active entities.
|
inline |
Returns relationship sources for the relation and target.
| relation | Relation entity |
| target | Target entity |
| func | void(Entity source) functor executed for each source entity found. |
|
inline |
Returns the cached deduped direct sources for wildcard source traversal on target. The cache is keyed by target and cleared whenever a pair edge changes.
| target | Entity whose direct pair sources are requested. |
target.
|
inline |
Traverses relationship sources in breadth-first order. Starting at rootTarget, this visits all direct sources first and then deeper levels.
| relation | Relation entity |
| rootTarget | Root target entity |
| func | void(Entity source) functor executed for each traversed source. |
|
inline |
Traverses relationship sources in breadth-first order. Starting at rootTarget, this visits all direct sources first and then deeper levels.
| relation | Relation entity |
| rootTarget | Root target entity |
| func | bool(Entity source) functor executed for each traversed source. Stops if true is returned. |
|
inline |
Returns the cached unlimited breadth-first descendant traversal for (relation, rootTarget). The cache excludes the root target itself and is cleared whenever a pair edge changes.
| relation | Relation defining descendant edges. |
| rootTarget | Target entity where traversal starts. |
|
inline |
Returns relationship sources for the relation and target.
| relation | Relation entity |
| target | Target entity |
| func | bool(Entity source) functor executed for each source entity found. Stops if false is returned. |
|
inline |
Adds or returns a sparse value through the store's erased payload interface.
| T | Expected payload type. |
| component | Sparse component entity. |
| entity | Entity owning the value. |
|
inline |
Returns a read-only sparse value through the store's erased payload interface.
| T | Expected payload type. |
| component | Sparse component entity. |
| entity | Entity owning the value. |
|
inline |
Returns a mutable sparse value through the store's erased payload interface.
| T | Expected payload type. |
| component | Sparse component entity. |
| entity | Entity owning the value. |
|
inline |
|
inline |
|
inline |
Returns the erased sparse store for component, or nullptr when absent.
| component | Sparse component entity. |
|
inline |
Returns the erased sparse store for component, creating runtime-sized storage when absent.
| component | Sparse component entity. |
| item | Runtime component metadata controlling payload size, alignment, and lifecycle. |
|
inline |
|
inline |
Checks whether copying a sparse payload must also add its id to the destination entity.
| comp | Sparse component entity being copied. |
|
inline |
Returns the sparse storage mode used by a component.
| component | Component entity to inspect. |
|
inline |
Returns silent mutable access to component type T on entity. This is a silent write and does not trigger set hooks or OnSet observers.
| T | Component |
| entity | Entity |
entity. Undefined behavior otherwise. entity is valid. Undefined behavior otherwise. entity changes archetype after ComponentSetter is created.
|
inline |
Sets the value of the component associated with object on entity without updating world version. This is a silent write and does not trigger set hooks or OnSet observers.
| T | Component type represented by object. |
|
inlinestaticconstexpr |
Sparse storage currently supports only plain generic components. Pairs, unique components and SoA layouts stay on the normal archetype path.
| T | Component type to inspect. |
|
inline |
Finds a component entity by its exact registered symbol.
| symbol | Registered component symbol. |
| len | String length. If zero, the length is calculated. |
|
inline |
Returns the registered symbol name for a component entity.
| component | Component entity. |
|
inline |
Propagates additive prefab changes to existing non-prefab instances. Missing copied ids are added to existing instances and missing prefab children are spawned with their Parent or ChildOf hierarchy relation. Existing owned instance data is left intact.
| prefabEntity | Prefab root whose instances are synchronized. |
Returns the first relationship target for the relation entity on entity.
| entity | Source entity |
| relation | Relation entity |
|
inline |
Returns the relationship targets for the relation entity on entity.
| entity | Source entity |
| relation | Relation entity |
| func | void(Entity target) functor executed for relationship target found. |
|
inline |
Returns targets for relation.
| relation | Relation entity |
relation, or nullptr when none exist. relation is valid. Undefined behavior otherwise.
|
inline |
Returns the cached deduped direct targets for wildcard target traversal on source. The cache is keyed by source and cleared whenever a pair edge changes.
| source | Entity whose direct pair targets are requested. |
source.
|
inline |
Returns the relationship targets for the relation entity on entity.
| entity | Source entity |
| relation | Relation entity |
| func | bool(Entity target) functor executed for relationship target found. Stops if false is returned. |
|
inline |
Traverses relationship targets upwards starting from source. Disabled entities act as traversal barriers and are not yielded.
| Func | Callable type accepting each target entity. |
| relation | Relation defining each upward edge. |
| source | Entity where traversal starts. |
| func | Callable invoked for each enabled target. |
|
inline |
Returns the cached unlimited upward traversal chain for (relation, source). The cache excludes the source entity itself and is cleared whenever a pair edge changes.
| relation | Relation defining each upward edge. |
| source | Entity where traversal starts. |
source in traversal order.
|
inline |
Traverses relationship targets upwards starting from source. Disabled entities act as traversal barriers and are not yielded.
| Func | Callable type returning whether traversal should continue. |
| relation | Relation defining each upward edge. |
| source | Entity where traversal starts. |
| func | Callable invoked for each enabled target. Returning false stops traversal. |
func, false otherwise.
|
inline |
Returns true while the world is draining teardown work and normal runtime callbacks must not execute.
|
inline |
Returns the entity for id when it is still live, or EntityBad for stale cleanup-time ids.
| id | Entity id to resolve. |
id, or EntityBad when the id is stale or absent.
|
inline |
Runs systems and then finishes the current frame.
This is the normal frame step. When systems are enabled, it executes registered systems through systems_run(). It then calls frame_cleanup() and frame_end(). With systems disabled, only the frame maintenance steps run.
|
inline |
Updates a tracked source-entity version after the entity changes archetype membership.
| entity | Source entity whose existing tracked version is incremented. |
|
inline |
Provides an uncached query set up to work with the parent world. Uncached queries keep only a local immutable plan and rebuild transient matches on demand.
|
inlinestaticconstexpr |
Returns whether T has compile-time sparse payload storage.
| T | Component type to inspect. |
GAIA_STORAGE(Sparse) is authoritative for T.
|
inline |
Checks if entity is valid.
| entity | Checked entity. |
|
inline |
Validates runtime-reflection state against the live scope graph in debug builds. Verifies that every semantic entity referenced by runtimeType resolves to a reachable scope path. All checks are compiled out when assertions are disabled.
| runtimeType | Runtime descriptor whose semantic entities are validated. |
|
inline |
Returns the current version of the world.
|
friend |
Acquires temporary scratch storage used during query matching.
| world | World providing the scratch stack. |
|
friend |
Releases previously acquired query-match scratch storage.
| world | World providing the scratch stack. |
| keepStamps | Whether stamp buffers should be preserved. |
|
friend |
Returns the version that changes when an archetype enters or leaves the deletion-request set.
Returns the version of the world's pending archetype-deletion set.
| world | World whose archetype deletion state is inspected. |
Returns the size of the component-to-archetype bucket for term.
| world | World to query. |
| term | Term to inspect. |
Returns the per-entity archetype version used for targeted source-query freshness checks.
Returns the sparse archetype-membership version tracked for a source entity. Invalid source entities report version 0 so cached queries see deletions immediately. Valid entries are created on first use so non-source entities do not pay any extra storage.
| world | World containing the sparse source-version state. |
| entity | Source entity whose archetype-membership version is requested. |
|
friend |
Returns the query argument for entity using explicit term id id. Mutable references materialize an override when inherited data must become direct.
| T | Query argument type. |
| world | World to query. |
| entity | Entity to read or mutate. |
| id | Explicit component or pair id, or EntityBad to derive it from T. |
|
friend |
Returns the query argument for entity using explicit term id id and raw mutable access. Mutable references materialize an override when inherited data must become direct.
| T | Query argument type. |
| world | World to query. |
| entity | Entity to read or mutate. |
| id | Explicit component or pair id, or EntityBad to derive it from T. |
Returns the current version of relation-specific traversal metadata.
Returns the current traversal-metadata version for a relation.
| world | World that owns the traversal metadata. |
| relation | Relation whose metadata version is inspected. |
|
friend |
Returns the current world structural version.
Returns the world's current structural version.
| world | World whose version is inspected. |