PassCommitListener Class
Interface for receiving notifications when a pass reaches its commit point. More...
Declaration
Derived Classes
| class | GameLoop |
|
Central orchestrator for the game update cycle. More... | |
Public Destructor Index
| ~PassCommitListener ()=default | |
|
Virtual destructor for proper polymorphic cleanup. More... | |
Public Member Functions Index
| void | onPassCommit (CommitPoint commitPoint, GameWorld &gameWorld, UpdateContext &updateContext) noexcept=0 |
|
Called when a pass reaches its commit point. More... | |
Description
Interface for receiving notifications when a pass reaches its commit point.
The PassCommitListener provides a callback mechanism for responding to pass-level synchronization events within the game loop. When a Pass has a configured CommitPoint and finishes execution, registered listeners are notified via onPassCommit().
This interface is primarily implemented by the GameLoop class to handle:
- Event buffer swapping: Making pass-level events readable to subsequent passes.
- Command flushing: Executing deferred commands from the CommandBuffer.
- Manager flushing: Processing queued requests (e.g., spawn/despawn operations).
The CommitPoint flags determine which synchronization actions are performed:
| Flag | Action |
|---|---|
| PassEvents | Swaps pass event bus buffers |
| FlushCommands | Executes pending commands |
| FlushManagers | Processes manager requests |
| Structural | Combines all three flags |
- Integration with GameLoop
The GameLoop implements this interface and registers itself with each Phase. When a Pass with a commit point completes, the Phase calls onPassCommit(), allowing the GameLoop to perform the appropriate synchronization.
- See Also
- See Also
- See Also
- See Also
Definition at line 65 of file PassCommitListener.ixx.
Public Destructor
~PassCommitListener()
| virtual default |
Virtual destructor for proper polymorphic cleanup.
Definition at line 73 of file PassCommitListener.ixx.
Public Member Functions
onPassCommit()
| noexcept |
Called when a pass reaches its commit point.
Implementations should check the CommitPoint flags and perform the appropriate synchronization actions. The order of operations should be:
- PassEvents - Swap event buffers first so subsequent actions can emit events.
- FlushCommands - Execute commands before managers to generate spawn requests.
- FlushManagers - Process requests after commands have been executed.
- Parameters
-
commitPoint The flags specifying which synchronization actions to perform.
gameWorld The game world for which the pass occurred.
updateContext The current frame's update context.
This method is marked noexcept as it is called during the game loop hot path and should not throw exceptions.
- See Also
- See Also
Definition at line 96 of file PassCommitListener.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.