TypedPass Class Template
State-filtered pass that only executes in specific states. More...
Declaration
Base class
| class | Pass |
|
Abstract base class for game loop passes. More... | |
Friends Index
template <typename StateType> | |
| class | helios::engine::runtime::gameloop::Phase |
Public Constructors Index
template <typename StateType> | |
| TypedPass (Phase &owner, const StateType mask, helios::engine::runtime::world::GameWorld &gameWorld) | |
|
Constructs a typed pass for a state mask. More... | |
Public Member Functions Index
template <typename StateType> | |
| Phase & | addCommitPoint (const CommitPoint commitPoint=CommitPoint::PassEvents) override |
|
Marks this pass with a commit point and returns the owning Phase. More... | |
template <typename StateType> | |
| CommitPoint | commitPoint () const noexcept override |
|
Returns the configured commit point for this pass. More... | |
template <typename StateType> | |
| bool | shouldRun (helios::engine::runtime::world::UpdateContext &updateContext) const noexcept override |
|
Checks if this pass should execute based on current state. More... | |
template <typename StateType> | |
| bool | hasFlag (StateType mask, StateType value) const noexcept |
|
Checks if a value has any bit set in the mask. More... | |
Private Member Functions Index
template <typename StateType> | |
| void | update (helios::engine::runtime::world::UpdateContext &updateContext) override |
|
Updates all systems registered in this pass. More... | |
template <typename StateType> | |
| void | init (helios::engine::runtime::world::GameWorld &gameWorld) override |
|
Initializes all systems registered in this pass. More... | |
Private Member Attributes Index
template <typename StateType> | |
| Phase & | owner_ |
template <typename StateType> | |
| StateType | mask_ |
|
Bitmask of states in which this pass should execute. More... | |
template <typename StateType> | |
| CommitPoint | commitPoint_ = CommitPoint::None |
Description
State-filtered pass that only executes in specific states.
TypedPass extends the base Pass class with state-based filtering. The pass only executes when the current state (queried from Session) matches the configured state mask using bitwise AND.
Definition at line 55 of file TypedPass.ixx.
Friends
helios::engine::runtime::gameloop::Phase
Definition at line 57 of file TypedPass.ixx.
Public Constructors
TypedPass()
| inline explicit |
Constructs a typed pass for a state mask.
- Parameters
-
owner Reference to the parent Phase.
mask State mask controlling when this pass runs.
gameWorld GameWorld used by the base Pass for buffer injection.
Definition at line 107 of file TypedPass.ixx.
Public Member Functions
addCommitPoint()
| inline virtual |
Marks this pass with a commit point and returns the owning Phase.
When a commit point is set, the specified synchronization actions are performed after this pass completes. The default is CommitPoint::PassEvents which only synchronizes pass-level events.
Available CommitPoint flags:
- PassEvents - Events pushed via UpdateContext::pushPass() become readable.
- FlushCommands - Pending commands from the CommandBuffer are executed.
- FlushManagers - Managers process their queued requests.
- Structural - Combines all three flags.
Flags can be combined using bitwise OR:
- Parameters
-
commitPoint The flags specifying which actions to perform (default: PassEvents).
- Returns
Reference to the owning Phase for continued configuration.
- See Also
- See Also
UpdateContext::pushPass()
- See Also
UpdateContext::readPass()
- See Also
GameLoop::passCommit()
Definition at line 137 of file TypedPass.ixx.
Reference helios::engine::runtime::gameloop::TypedPass< StateType >::commitPoint.
commitPoint()
| inline noexcept virtual |
Returns the configured commit point for this pass.
The commit point determines what synchronization actions are performed after this pass completes. If no commit point was added, returns CommitPoint::None.
- Returns
The commit point flags for this pass.
- See Also
- See Also
Definition at line 154 of file TypedPass.ixx.
Referenced by helios::engine::runtime::gameloop::TypedPass< StateType >::addCommitPoint.
hasFlag()
| inline noexcept |
Checks if a value has any bit set in the mask.
- Parameters
-
mask The bitmask to check against.
value The value to test.
- Returns
True if any bit in mask matches value.
Definition at line 182 of file TypedPass.ixx.
Reference helios::engine::runtime::registerComponents.
Referenced by helios::engine::runtime::gameloop::TypedPass< StateType >::shouldRun.
shouldRun()
| inline noexcept virtual |
Checks if this pass should execute based on current state.
Queries the current state from the Session and compares it against the configured mask using bitwise AND. The pass runs if any bit in the mask matches the current state.
- Parameters
-
updateContext The current update context.
- Returns
True if the pass should execute.
Definition at line 169 of file TypedPass.ixx.
References helios::engine::runtime::gameloop::TypedPass< StateType >::hasFlag and helios::engine::runtime::registerComponents.
Private Member Functions
init()
| inline virtual |
Initializes all systems registered in this pass.
- Parameters
-
gameWorld Reference to the game world.
Definition at line 86 of file TypedPass.ixx.
update()
| inline virtual |
Updates all systems registered in this pass.
- Parameters
-
updateContext The current update context.
Definition at line 74 of file TypedPass.ixx.
Private Member Attributes
commitPoint_
|
The CommitPoint configured for this Pass.
Definition at line 94 of file TypedPass.ixx.
mask_
|
Bitmask of states in which this pass should execute.
Definition at line 67 of file TypedPass.ixx.
owner_
|
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.