InternalBuffer Class Template
Per-command-type storage and dispatch unit. More...
Declaration
Public Member Typedefs Index
template <typename TCommandType> | |
| using | EngineRoleTag = CommandBufferRole |
|
Role tag marking this as a command buffer for the engine registry. More... | |
Public Constructors Index
template <typename TCommandType> | |
| InternalBuffer () | |
|
Reserves default capacity for the command vector. More... | |
Public Member Functions Index
template <typename TCommandType> | |
| void | flush (UpdateContext &updateContext) |
|
Forwards all buffered commands to the handler registry and clears the buffer. More... | |
template <typename TCommandType> | |
| void | clear () |
|
Discards all buffered commands without dispatching them. More... | |
template <typename TCommandType> | |
| void | init (CommandHandlerRegistry &commandHandlerRegistry, ManagerRegistry &managerRegistry) |
|
Wires this buffer to the handler and manager registries. More... | |
template <typename ... TArgs> | |
| void | add (TArgs &&... args) |
|
Enqueues a new command, constructing it in-place from args. More... | |
Private Member Attributes Index
template <typename TCommandType> | |
| CommandHandlerRegistry * | commandHandlerRegistry_ {nullptr} |
|
Registry used to submit commands to their handlers on first flush. More... | |
template <typename TCommandType> | |
| ManagerRegistry * | managerRegistry_ {nullptr} |
|
Registry used to resolve the EntityMutationManager on first flush. More... | |
template <typename TCommandType> | |
| bool | handlerRegistered_ {false} |
|
true once the handler for TCommandType has been registered. More... | |
template <typename TCommandType> | |
| EntityMutationManager< TEntityManager > * | entityMutationManager_ {nullptr} |
|
Cached pointer to the EntityMutationManager; resolved lazily on first flush. More... | |
template <typename TCommandType> | |
| std::vector< TCommandType > | commands_ |
Description
Per-command-type storage and dispatch unit.
Created lazily by EntityMutationCommandBuffer::modelFor<TCommand>(). On flush() every buffered command is forwarded to the CommandHandlerRegistry, which routes it to the EntityMutationManager.
- Template Parameters
-
TCommandType ECS command struct to buffer (e.g. AddComponentCommand<C>).
Definition at line 70 of file EntityMutationCommandBuffer.ixx.
Public Member Typedefs
EngineRoleTag
|
Role tag marking this as a command buffer for the engine registry.
Definition at line 88 of file EntityMutationCommandBuffer.ixx.
Public Constructors
InternalBuffer()
| inline |
Reserves default capacity for the command vector.
Definition at line 91 of file EntityMutationCommandBuffer.ixx.
Public Member Functions
add()
| inline |
Enqueues a new command, constructing it in-place from args.
- Template Parameters
-
TArgs Constructor argument types for TCommandType.
- Parameters
-
args Arguments forwarded to the TCommandType constructor.
Definition at line 141 of file EntityMutationCommandBuffer.ixx.
clear()
| inline |
Discards all buffered commands without dispatching them.
Definition at line 119 of file EntityMutationCommandBuffer.ixx.
flush()
| inline |
Forwards all buffered commands to the handler registry and clears the buffer.
This method must not be called in parallel running tasks.
- Parameters
-
updateContext Frame-local update context (passed through to handlers).
Definition at line 102 of file EntityMutationCommandBuffer.ixx.
init()
| inline |
Wires this buffer to the handler and manager registries.
- Parameters
-
commandHandlerRegistry Registry used to route commands to their handlers.
managerRegistry Registry providing the EntityMutationManager<>.
Definition at line 129 of file EntityMutationCommandBuffer.ixx.
Private Member Attributes
commandHandlerRegistry_
|
Registry used to submit commands to their handlers on first flush.
Definition at line 73 of file EntityMutationCommandBuffer.ixx.
commands_
|
Definition at line 84 of file EntityMutationCommandBuffer.ixx.
entityMutationManager_
|
Cached pointer to the EntityMutationManager; resolved lazily on first flush.
Definition at line 82 of file EntityMutationCommandBuffer.ixx.
handlerRegistered_
|
true once the handler for TCommandType has been registered.
Definition at line 79 of file EntityMutationCommandBuffer.ixx.
managerRegistry_
|
Registry used to resolve the EntityMutationManager on first flush.
Definition at line 76 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.