EntityMutationManager Class Template
Receives submitted ECS mutation commands and applies them during flush. More...
Declaration
Public Member Typedefs Index
template <typename TEntityManager> | |
| using | Handle_type = THandle |
|
The entity handle type this manager operates on. More... | |
template <typename TEntityManager> | |
| using | EngineRoleTag = ManagerRole |
|
Role tag identifying this as a manager in the engine registry. More... | |
Private Member Typedefs Index
template <typename TEntityManager> | |
| using | THandle = typename TEntityManager::Handle_type |
|
Shorthand for the entity handle type derived from TEntityManager. More... | |
Public Constructors Index
template <typename TEntityManager> | |
| EntityMutationManager (TEntityManager &entity_manager, JobSystem &jobSystem) | |
|
Constructs the manager bound to entityManager and jobSystem. More... | |
Public Member Functions Index
template <typename TCommand> | |
| bool | submit (TCommand &&command) |
|
Accepts a command from the CommandHandlerRegistry and enqueues it. More... | |
template <typename TEntityManager> | |
| void | init (CommandHandlerRegistry &commandHandlerRegistry) |
|
Initialises the manager. Currently a no-op. More... | |
template <typename TEntityManager> | |
| void | flush (UpdateContext &updateContext) |
|
Flushes all internal buffers sequentially, applying every queued mutation. More... | |
template <typename TEntityManager> | |
| void | flushParallel (UpdateContext &updateContext) |
|
Flushes independent buffer groups concurrently via the JobSystem. More... | |
Private Member Functions Index
template <typename TCommand> | |
| auto * | modelFor () |
|
Returns (or lazily creates) the InternalBuffer for TCommand. More... | |
Private Member Attributes Index
template <typename TEntityManager> | |
| TEntityManager & | entityManager_ |
|
Reference to the entity manager mutations are applied to. More... | |
template <typename TEntityManager> | |
| CommandBufferRegistry | commandBufferRegistry_ {} |
|
Registry of lazily created per-command-type InternalBuffer instances. More... | |
template <typename TEntityManager> | |
| CommandHandlerRegistry * | commandHandlerRegistry_ {nullptr} |
|
Unused; retained for interface uniformity. More... | |
template <typename TEntityManager> | |
| JobSystem & | jobSystem_ |
|
Job system used by flushParallel() for concurrent buffer execution. More... | |
template <typename TEntityManager> | |
| std::vector< std::vector< CommandBufferTypeId > > | componentToBufferGroups_ {} |
|
Maps component type IDs to the CommandBufferTypeIds of their associated buffers. More... | |
template <typename TEntityManager> | |
| std::vector< std::size_t > | bufferGroupIndices_ |
|
Ordered list of component type IDs that have at least one registered buffer. More... | |
Private Static Attributes Index
template <typename TEntityManager> | |
| static auto & | logger_ = helios::engine::util::log::LogManager::loggerForScope(HELIOS_LOG_SCOPE) |
|
Module-scoped logger. More... | |
Description
Receives submitted ECS mutation commands and applies them during flush.
Acts as the write-back stage for EntityMutationCommandBuffer: commands queued there are routed here via the CommandHandlerRegistry and buffered per command type. On flush() each command is resolved against the live UpdateContext and executed (add/remove component, activate/deactivate entity).
- Template Parameters
-
TEntityManager Entity manager type identifying the target ECS registry.
Definition at line 68 of file EntityMutationManager.ixx.
Public Member Typedefs
EngineRoleTag
|
Role tag identifying this as a manager in the engine registry.
Definition at line 225 of file EntityMutationManager.ixx.
Handle_type
|
The entity handle type this manager operates on.
Definition at line 222 of file EntityMutationManager.ixx.
Private Member Typedefs
THandle
|
Shorthand for the entity handle type derived from TEntityManager.
Definition at line 71 of file EntityMutationManager.ixx.
Public Constructors
EntityMutationManager()
| inline explicit |
Constructs the manager bound to entityManager and jobSystem.
- Parameters
-
entity_manager Entity manager mutations are applied to.
jobSystem Job system used for parallel flush execution.
Definition at line 233 of file EntityMutationManager.ixx.
Public Member Functions
flush()
| inline |
Flushes all internal buffers sequentially, applying every queued mutation.
- Parameters
-
updateContext Frame-local ECS context forwarded to each buffer's flush.
Definition at line 306 of file EntityMutationManager.ixx.
Reference helios::engine::runtime::registerComponents.
flushParallel()
| inline |
Flushes independent buffer groups concurrently via the JobSystem.
Each component-type group is dispatched as a separate job; groups that operate on different component types are assumed to be executable in parallel without contention.
- Parameters
-
updateContext Frame-local ECS context forwarded to each buffer's flush.
Definition at line 321 of file EntityMutationManager.ixx.
References helios::engine::runtime::registerComponents and helios::engine::core::thread::JobSystem::runAndWait.
init()
| inline |
Initialises the manager. Currently a no-op.
- Parameters
-
commandHandlerRegistry Unused; kept for interface uniformity.
Definition at line 299 of file EntityMutationManager.ixx.
submit()
| inline |
Accepts a command from the CommandHandlerRegistry and enqueues it.
TCommand::Handle_type must match THandle.
- Template Parameters
-
TCommand Deduced ECS command type.
- Parameters
-
command Command instance forwarded into the internal buffer.
- Returns
true unconditionally (reserved for future error reporting).
Definition at line 247 of file EntityMutationManager.ixx.
Reference helios::engine::runtime::registerComponents.
Private Member Functions
modelFor()
| inline |
Returns (or lazily creates) the InternalBuffer for TCommand.
- Template Parameters
-
TCommand Command type whose buffer is requested.
- Returns
Non-owning pointer to the buffer.
Definition at line 186 of file EntityMutationManager.ixx.
Private Member Attributes
bufferGroupIndices_
|
Ordered list of component type IDs that have at least one registered buffer.
Definition at line 94 of file EntityMutationManager.ixx.
commandBufferRegistry_
|
Registry of lazily created per-command-type InternalBuffer instances.
Definition at line 77 of file EntityMutationManager.ixx.
commandHandlerRegistry_
|
Unused; retained for interface uniformity.
Definition at line 80 of file EntityMutationManager.ixx.
componentToBufferGroups_
|
Maps component type IDs to the CommandBufferTypeIds of their associated buffers.
Indexed by component type ID; each slot holds one or more buffer IDs that can be flushed independently in parallel.
Definition at line 91 of file EntityMutationManager.ixx.
entityManager_
|
Reference to the entity manager mutations are applied to.
Definition at line 74 of file EntityMutationManager.ixx.
jobSystem_
|
Job system used by flushParallel() for concurrent buffer execution.
Definition at line 83 of file EntityMutationManager.ixx.
Private Static Attributes
logger_
| static |
Module-scoped logger.
Definition at line 97 of file EntityMutationManager.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.