WorldLifecycleManager Class
Manager that processes deferred world lifecycle commands. More...
Declaration
Public Member Typedefs Index
| using | EngineRoleTag = helios::engine::runtime::world::tags::ManagerRole |
Public Member Functions Index
| bool | submit (WorldLifecycleCommand cmd) noexcept |
|
Enqueues a lifecycle command for deferred processing. More... | |
| void | init (CommandHandlerRegistry &commandHandlerRegistry) |
|
Registers this manager as the WorldLifecycleCommand handler. More... | |
| void | flush (UpdateContext &updateContext) noexcept |
|
Processes all pending lifecycle commands. More... | |
| void | reset () |
|
Clears all pending commands. More... | |
Private Member Attributes Index
| std::vector< WorldLifecycleCommand > | pending_ |
|
Pending commands queued for the next flush. More... | |
Description
Manager that processes deferred world lifecycle commands.
WorldLifecycleManager collects WorldLifecycleCommands via submit() and executes them during flush(). This allows systems to request world-level operations (e.g. reset) through the command pipeline instead of calling GameWorld methods directly.
On Reset, the pending queue is moved to a local variable before processing. This prevents re-entrant issues since GameWorld::reset() calls Manager::reset() on all managers, including this one.
- See Also
WorldLifecycleCommand
- See Also
- See Also
Definition at line 41 of file WorldLifecycleManager.ixx.
Public Member Typedefs
EngineRoleTag
|
Definition at line 51 of file WorldLifecycleManager.ixx.
Public Member Functions
flush()
| inline noexcept |
Processes all pending lifecycle commands.
Moves the pending queue to a local variable before iterating. This is necessary because a Reset action triggers GameWorld::reset(), which in turn calls reset() on this manager, clearing pending_.
- Parameters
-
updateContext The current frame's update context.
Definition at line 84 of file WorldLifecycleManager.ixx.
Reference helios::engine::runtime::lifecycle::registerComponents.
init()
| inline |
Registers this manager as the WorldLifecycleCommand handler.
- Parameters
-
gameWorld The GameWorld to register with.
Definition at line 70 of file WorldLifecycleManager.ixx.
Reference helios::engine::runtime::messaging::command::CommandHandlerRegistry::registerHandler.
reset()
| inline |
Clears all pending commands.
Definition at line 110 of file WorldLifecycleManager.ixx.
submit()
| inline noexcept |
Enqueues a lifecycle command for deferred processing.
- Parameters
-
cmd The command to enqueue.
- Returns
True if the command was accepted.
Definition at line 60 of file WorldLifecycleManager.ixx.
Reference helios::engine::runtime::lifecycle::registerComponents.
Private Member Attributes
pending_
|
Pending commands queued for the next flush.
Definition at line 46 of file WorldLifecycleManager.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.