#include <base_registry.hpp>
|
| constexpr auto | alive (entity ent) const noexcept -> bool |
| | Checks if the specified entity is currently active within the registry.
|
| |
| void | destroy (entity ent) |
| | Destroys the given entity.
|
| |
| constexpr auto | archetypes () noexcept -> class archetypes & |
| | Provides access to the modifiable list of archetypes in the registry.
|
| |
| constexpr auto | archetypes () const noexcept -> const class archetypes & |
| | Provides access to the immutable list of archetypes in the registry.
|
| |
| constexpr auto | reserve () -> placeholder_entity |
| | Reserves an entity in a thread-safe manner.
|
| |
| constexpr void | sync () |
| | Synchronizes concurently reserved entities.
|
| |
| template<component... C> |
| constexpr auto | has (entity ent) const -> bool |
| | Checks if the specified entity has all the given components.
|
| |
| constexpr void | visit (entity ent, auto &&func) |
| | Visit all components of an entity.
|
| |
| constexpr void | visit (entity ent, auto &&func) const |
| | Visit all components of an entity (const variant).
|
| |
|
| template<component... Args> |
| static constexpr auto | get_impl (auto &&self, entity ent) -> decltype(auto) |
| |
◆ alive()
| constexpr auto co_ecs::base_registry::alive |
( |
entity | ent | ) |
const -> bool |
|
inlineconstexprnoexcept |
Checks if the specified entity is currently active within the registry.
This method determines whether an entity is still active and not yet destroyed in the registry. This is useful for validating entities before performing operations on them, helping to avoid errors related to using invalid or destroyed entity references.
- Parameters
-
| ent | The entity to check for activity. |
- Returns
- bool Returns true if the entity is active, false otherwise.
◆ allocate()
| constexpr auto co_ecs::base_registry::allocate |
( |
| ) |
-> entity |
|
inlineconstexprprotected |
◆ archetypes() [1/2]
| constexpr auto co_ecs::base_registry::archetypes |
( |
| ) |
const -> const class archetypes& |
|
inlineconstexprnoexcept |
Provides access to the immutable list of archetypes in the registry.
This constant method returns a reference to the internal container of archetypes without allowing modifications. It is intended for inspecting or querying the archetypes, suitable for operations that require reading archetype information without altering it.
- Returns
- const archetypes& A reference to the immutable archetypes container.
◆ archetypes() [2/2]
| constexpr auto co_ecs::base_registry::archetypes |
( |
| ) |
-> class archetypes& |
|
inlineconstexprnoexcept |
Provides access to the modifiable list of archetypes in the registry.
This method returns a reference to the internal container of archetypes, allowing for modifications to the archetypes. It can be used to add, modify, or inspect the archetypes directly, which represent different entity configurations within the entity-component system.
- Returns
- archetypes& A reference to the modifiable archetypes container.
◆ clone() [1/2]
◆ clone() [2/2]
◆ copy() [1/2]
◆ copy() [2/2]
◆ create_impl()
template<component... Components>
| constexpr auto co_ecs::base_registry::create_impl |
( |
Components &&... | args | ) |
-> entity |
|
inlineconstexprprotected |
◆ destroy()
| void co_ecs::base_registry::destroy |
( |
entity | ent | ) |
|
|
inline |
Destroys the given entity.
void destroy(entity ent)
Destroys the given entity.
Definition base_registry.hpp:55
Registry is a container for all our entities and components. Components are stored in continuously in...
Definition registry.hpp:13
detail::handle< struct entity_tag_t > entity
Represents an entity, consisting of an ID and generation.
Definition entity.hpp:13
- Parameters
-
◆ get_impl()
template<component... Args>
| static constexpr auto co_ecs::base_registry::get_impl |
( |
auto && | self, |
|
|
entity | ent ) -> decltype(auto) |
|
inlinestaticconstexprprotected |
◆ has()
template<component... C>
| constexpr auto co_ecs::base_registry::has |
( |
entity | ent | ) |
const -> bool |
|
inlineconstexpr |
Checks if the specified entity has all the given components.
- Template Parameters
-
| C | Variadic template arguments representing the component types to check. |
- Parameters
-
| ent | The entity to check for component existence. |
- Returns
- True if the entity has all specified components, false otherwise.
◆ move() [1/2]
◆ move() [2/2]
◆ remove()
template<component C>
| constexpr void co_ecs::base_registry::remove |
( |
entity | ent | ) |
|
|
inlineconstexprprotected |
◆ reserve()
Reserves an entity in a thread-safe manner.
This method reserves an entity ID concurrently and guarantees thread safety. The reserved entity is not fully initialized or published until the sync() method is called. This mechanism allows multiple threads to reserve entities concurrently without interference.
- Returns
- Returns a reserved entity that will need to be published by calling the
sync() method.
◆ set_impl()
template<component C>
| constexpr auto co_ecs::base_registry::set_impl |
( |
entity | ent | ) |
-> std::pair<bool, C*> |
|
inlineconstexprprotected |
◆ sync()
| constexpr void co_ecs::base_registry::sync |
( |
| ) |
|
|
inlineconstexpr |
Synchronizes concurently reserved entities.
- Postcondition
- Once called, all the entities returned by reserve() accessible in the registry.
◆ visit() [1/2]
| constexpr void co_ecs::base_registry::visit |
( |
entity | ent, |
|
|
auto && | func ) |
|
inlineconstexpr |
Visit all components of an entity.
- Parameters
-
| ent | Entity to visit. |
| func | Function, a visitor, to apply components to. |
◆ visit() [2/2]
| constexpr void co_ecs::base_registry::visit |
( |
entity | ent, |
|
|
auto && | func ) const |
|
inlineconstexpr |
Visit all components of an entity (const variant).
- Parameters
-
| ent | Entity to visit. |
| func | Function, a visitor, to apply components to. |
◆ const_entity_ref
◆ entity_ref
◆ _archetypes
| class archetypes co_ecs::base_registry::_archetypes |
|
protected |
◆ _entity_archetype_map
◆ _entity_pool
The documentation for this class was generated from the following file: