EntityMutationCommandBuffer Class Template
Collects deferred entity-mutation commands and dispatches them in bulk. More...
Declaration
Public Member Typedefs Index
template <typename TEntityManager> | |
| using | Handle_type = typename TEntityManager::Handle_type |
|
The entity handle type this buffer operates on. More... | |
template <typename TEntityManager> | |
| using | EngineRoleTag = CommandBufferRole |
|
Role tag marking this as a command buffer for the engine registry. More... | |
Public Member Functions Index
template <typename TCommand, typename... Args> | |
| void | add (Args &&... args) |
|
Enqueues a command of type TCommand, constructing it from args. More... | |
template <typename TCommand> | |
| auto * | bufferForCommand () |
|
Returns a raw pointer to the InternalBuffer for TCommand. More... | |
template <typename TEntityManager> | |
| void | init (CommandHandlerRegistry &commandHandlerRegistry, ManagerRegistry &managerRegistry) |
|
Initialises this buffer and all already-registered internal buffers. More... | |
template <typename TEntityManager> | |
| void | flush (UpdateContext &updateContext) |
|
Flushes all internal buffers, dispatching every queued command. More... | |
template <typename TEntityManager> | |
| void | clear () |
|
Discards all queued commands across every internal buffer without dispatching. 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> | |
| CommandBufferRegistry | commandBufferRegistry_ {} |
|
Registry of lazily created per-command-type InternalBuffer instances. More... | |
template <typename TEntityManager> | |
| CommandHandlerRegistry * | commandHandlerRegistry_ {nullptr} |
|
Registry used to route submitted commands to their handlers. More... | |
template <typename TEntityManager> | |
| ManagerRegistry * | managerRegistry_ {nullptr} |
|
Registry providing the EntityMutationManager during handler registration. More... | |
Description
Collects deferred entity-mutation commands and dispatches them in bulk.
Commands are enqueued during system execution and forwarded to the EntityMutationManager during the flush phase, decoupling structural ECS mutations from hot iteration loops.
Each concrete command type gets its own InternalBuffer, created lazily on first use and stored in an internal CommandBufferRegistry.
- Template Parameters
-
TEntityManager Entity manager type that identifies the target registry.
Definition at line 49 of file EntityMutationCommandBuffer.ixx.
Public Member Typedefs
EngineRoleTag
|
Role tag marking this as a command buffer for the engine registry.
Definition at line 181 of file EntityMutationCommandBuffer.ixx.
Handle_type
|
The entity handle type this buffer operates on.
Definition at line 178 of file EntityMutationCommandBuffer.ixx.
Public Member Functions
add()
| inline |
Enqueues a command of type TCommand, constructing it from args.
TCommand::Handle_type must match THandle.
- Template Parameters
-
TCommand ECS command type to enqueue.
Args Constructor argument types.
- Parameters
-
args Arguments forwarded to the command constructor.
Definition at line 194 of file EntityMutationCommandBuffer.ixx.
Reference helios::engine::runtime::registerComponents.
bufferForCommand()
| inline |
Returns a raw pointer to the InternalBuffer for TCommand.
Useful when a caller needs direct access to the buffer (e.g. for batched inserts).
- Template Parameters
-
TCommand Command type whose buffer is requested.
- Returns
Non-owning pointer to the internal buffer.
Definition at line 210 of file EntityMutationCommandBuffer.ixx.
Reference helios::engine::runtime::registerComponents.
clear()
| inline |
Discards all queued commands across every internal buffer without dispatching.
Definition at line 246 of file EntityMutationCommandBuffer.ixx.
Reference helios::engine::core::container::ConceptModelRegistry< AnyT, IdProvider >::items.
flush()
| inline |
Flushes all internal buffers, dispatching every queued command.
- Parameters
-
updateContext Frame-local update context forwarded to each buffer's flush.
Definition at line 237 of file EntityMutationCommandBuffer.ixx.
References helios::engine::core::container::ConceptModelRegistry< AnyT, IdProvider >::items and helios::engine::runtime::registerComponents.
init()
| inline |
Initialises this buffer and all already-registered internal buffers.
Must be called once before the first add() or flush().
- Parameters
-
commandHandlerRegistry Registry used to route commands to handlers.
managerRegistry Registry providing the EntityMutationManager<Handle_type>.
Definition at line 222 of file EntityMutationCommandBuffer.ixx.
Reference helios::engine::core::container::ConceptModelRegistry< AnyT, IdProvider >::items.
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 154 of file EntityMutationCommandBuffer.ixx.
Private Member Attributes
commandBufferRegistry_
|
Registry of lazily created per-command-type InternalBuffer instances.
Definition at line 52 of file EntityMutationCommandBuffer.ixx.
commandHandlerRegistry_
|
Registry used to route submitted commands to their handlers.
Definition at line 55 of file EntityMutationCommandBuffer.ixx.
managerRegistry_
|
Registry providing the EntityMutationManager during handler registration.
Definition at line 58 of file EntityMutationCommandBuffer.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.