Pass Class
Abstract base class for game loop passes. More...
Declaration
Derived Classes
| class | TypedPass<StateType> |
|
State-filtered pass that only executes in specific states. More... | |
Public Constructors Index
| Pass (GameWorld &gameWorld) | |
|
Constructs a pass bound to a specific GameWorld. More... | |
Public Destructor Index
| ~Pass ()=default | |
Public Member Functions Index
| void | update (helios::engine::runtime::world::UpdateContext &updateContext)=0 |
|
Updates all systems in this pass. More... | |
| void | init (helios::engine::runtime::world::GameWorld &gameWorld)=0 |
|
Initializes all systems in this pass. More... | |
| Phase & | endPass ()=0 |
|
Ends this pass. More... | |
| bool | shouldRun (helios::engine::runtime::world::UpdateContext &updateContext) const noexcept=0 |
|
Determines if this pass should execute. More... | |
template <typename T, typename... Args> | |
| Pass & | addSystem (Args &&... args) |
|
Adds a system of type T to this pass. More... | |
template <typename ... TSystem> | |
| Pass & | addParallelSystems () |
|
Adds TypedSystem-like systems that should be executed parallel. More... | |
template <typename ... TSystem> | |
| Pass & | addParallelSystems (TSystem &&... system) |
|
Adds two or more TypedSystemSpec-wrapped systems that may execute in parallel. More... | |
template <typename TSystem> | |
| Pass & | addSystem (TSystem &&system) |
|
Adds a system of type TSystem to this pass. More... | |
template <typename ... TSystem> | |
| Pass & | addParallelSystems (TSystem &&... system) |
|
Adds multiple systems to this pass, allowing for parallel execution. More... | |
template <typename... T> | |
| Pass & | flush () |
|
Registers the Managers this pass should flush. More... | |
template <typename TManager> | |
| Pass & | flushParallel () |
|
Register the Manager this pass should flush in parallel. More... | |
| std::span< const ManagerTypeId > | managerTypeIds () noexcept |
|
Returns a span of the ManagerTypeIds this pass is flushing. More... | |
| std::span< const ManagerTypeId > | parallelManagerTypeIds () noexcept |
|
Returns a span of the ManagerTypeIds this pass is flushing in parallel. More... | |
Protected Member Functions Index
template <typename T> | |
| void | registerManagerFlush () |
|
Registers the ManagerTypeIds for the Managers this pass should flush. More... | |
template <typename T> | |
| void | registerManagerParallelFlush () |
|
Registers the ManagerTypeIds for the Managers this pass should flush in parallel. More... | |
template <typename TSystem> | |
| Pass & | registerCallableSystem (TSystem &&system, const bool isParallel=false) |
|
Registers a callable system for this pass. More... | |
template <typename T, typename... Args> | |
| Pass & | registerParallelTypedSystem (Args &&... args) |
template <typename T, typename... Args> | |
| Pass & | registerTypedSystem (Args &&... args) |
|
Registers a TypedSystem-like system with this pass. More... | |
template <typename T> | |
| Pass & | registerTypedSystemSpec (T &&spec) |
|
Registers a system described by a TypedSystemSpec with this pass. More... | |
Protected Member Attributes Index
| helios::engine::runtime::world::SystemRegistry | systemRegistry_ {} |
|
Registry holding all systems for this pass. More... | |
| std::vector< std::vector< SystemTypeId > > | systemTypeIdQueue_ |
|
Queue of system type IDs for execution order. More... | |
| GameWorld & | gameWorld_ |
|
Reference to the owning GameWorld. More... | |
| std::vector< ManagerTypeId > | managerTypeIds_ |
|
List of ManagerTypeIds. More... | |
| std::vector< ManagerTypeId > | parallelManagerTypeIds_ |
|
List of ManagerTypeIds for parallel execution. More... | |
Description
Abstract base class for game loop passes.
A Pass represents a logical grouping of systems executed sequentially within a Phase. Concrete implementations (TypedPass) add state-based filtering via shouldRun().
Definition at line 55 of file Pass.ixx.
Public Constructors
Pass()
| inline explicit |
Public Member Functions
addParallelSystems()
| inline |
Adds TypedSystem-like systems that should be executed parallel.
- Template Parameters
-
TSystem The types of the systems to add.
- Returns
Reference to this Pass for method chaining.
Definition at line 306 of file Pass.ixx.
References helios::engine::runtime::registerComponents and systemTypeIdQueue_.
addParallelSystems()
| inline |
Adds two or more TypedSystemSpec-wrapped systems that may execute in parallel.
Each spec is unpacked via registerTypedSystemSpec() and all resulting system type IDs are placed in a single execution group, signalling to the scheduler that the systems are independent and can run concurrently.
- Template Parameters
-
TSystem TypedSystemSpec specialisations whose System_type satisfies IsTypedSystemLike. At least two types are required.
- Parameters
-
system Spec instances forwarded to registerTypedSystemSpec().
- Returns
Reference to this pass for method chaining.
Definition at line 341 of file Pass.ixx.
References helios::engine::runtime::registerComponents and systemTypeIdQueue_.
addParallelSystems()
| inline |
Adds multiple systems to this pass, allowing for parallel execution.
- Template Parameters
-
TSystem The types of the systems to add.
- Parameters
-
system The system instances to add.
- Returns
Reference to this pass.
Definition at line 383 of file Pass.ixx.
References registerCallableSystem, helios::engine::runtime::registerComponents and systemTypeIdQueue_.
addSystem()
| inline |
Adds a system of type T to this pass.
- Template Parameters
-
T The system type to add.
Args Constructor argument types for the system.
- Parameters
-
args Arguments forwarded to the system constructor.
If T defines CommandBuffer_type, the buffer is resolved from the bound GameWorld and injected into the wrapped helios::engine::runtime::world::System.
- Returns
Reference to this Pass for method chaining.
Definition at line 287 of file Pass.ixx.
References helios::engine::runtime::registerComponents and systemTypeIdQueue_.
addSystem()
| inline |
Adds a system of type TSystem to this pass.
- Template Parameters
-
TSystem The system type to add.
- Parameters
-
system System forwarded to the system constructor.
If TSystem defines CommandBuffer_type, the buffer is resolved from the bound GameWorld and injected into the wrapped helios::engine::runtime::world::System.
- Returns
Reference to this Pass for method chaining.
Definition at line 367 of file Pass.ixx.
References registerCallableSystem, helios::engine::runtime::registerComponents and systemTypeIdQueue_.
endPass()
|
flush()
| inline |
Registers the Managers this pass should flush.
- Template Parameters
-
T The types of the Managers to flush.
- Returns
Reference to this Pass for method chaining.
Definition at line 402 of file Pass.ixx.
Reference helios::engine::runtime::registerComponents.
flushParallel()
| inline |
Register the Manager this pass should flush in parallel.
- Template Parameters
-
TManager The type of the Manager to flush in parallel.
- Returns
Reference to this Pass for method chaining.
Definition at line 417 of file Pass.ixx.
Reference helios::engine::runtime::registerComponents.
init()
|
managerTypeIds()
| inline noexcept |
Returns a span of the ManagerTypeIds this pass is flushing.
- Returns
A span of ManagerTypeIds.
Definition at line 429 of file Pass.ixx.
Reference managerTypeIds_.
parallelManagerTypeIds()
| inline noexcept |
Returns a span of the ManagerTypeIds this pass is flushing in parallel.
- Returns
A span of ManagerTypeIds.
Definition at line 438 of file Pass.ixx.
Reference parallelManagerTypeIds_.
shouldRun()
| noexcept |
update()
|
Protected Member Functions
registerCallableSystem()
| inline protected |
Registers a callable system for this pass.
- Template Parameters
-
TSystem The type of the system to register.
- Parameters
-
system The system instance to register.
isParallel
- Returns
Reference to this pass.
Definition at line 123 of file Pass.ixx.
References gameWorld_, helios::engine::runtime::registerComponents, systemRegistry_ and helios::engine::runtime::world::GameWorld::tryCommandBuffer.
Referenced by addParallelSystems and addSystem.
registerManagerFlush()
| inline protected |
Registers the ManagerTypeIds for the Managers this pass should flush.
- Template Parameters
-
T The type of the manager to register.
Definition at line 94 of file Pass.ixx.
References gameWorld_, managerTypeIds_, helios::engine::runtime::registerComponents and helios::engine::runtime::world::GameWorld::tryManager.
registerManagerParallelFlush()
| inline protected |
Registers the ManagerTypeIds for the Managers this pass should flush in parallel.
- Template Parameters
-
T The type of the manager to register.
Definition at line 107 of file Pass.ixx.
References gameWorld_, parallelManagerTypeIds_, helios::engine::runtime::registerComponents and helios::engine::runtime::world::GameWorld::tryManager.
registerParallelTypedSystem()
| inline protected |
Definition at line 158 of file Pass.ixx.
References helios::engine::runtime::registerComponents and systemRegistry_.
registerTypedSystem()
| inline protected |
Registers a TypedSystem-like system with this pass.
- Template Parameters
-
T The concrete system type to register.
Args The constructor arg types, if any.
- Parameters
-
args Concrete constructor args.
- Returns
This pass.
Definition at line 187 of file Pass.ixx.
References gameWorld_, helios::engine::runtime::registerComponents, systemRegistry_ and helios::engine::runtime::world::GameWorld::tryCommandBuffer.
registerTypedSystemSpec()
| inline protected |
Registers a system described by a TypedSystemSpec with this pass.
Unpacks the argument tuple stored in spec and delegates to registerTypedSystem<TSystem>(args...).
- Template Parameters
-
T A TypedSystemSpec specialisation whose System_type satisfies IsTypedSystemLike.
- Parameters
-
spec Spec instance carrying the system type and its construction arguments.
- Returns
Reference to this pass.
Definition at line 217 of file Pass.ixx.
Reference helios::engine::runtime::registerComponents.
Protected Member Attributes
gameWorld_
| protected |
Reference to the owning GameWorld.
Used to resolve optional command buffer dependencies for systems declaring CommandBuffer_type.
Definition at line 76 of file Pass.ixx.
Referenced by registerCallableSystem, registerManagerFlush, registerManagerParallelFlush and registerTypedSystem.
managerTypeIds_
| protected |
List of ManagerTypeIds.
Definition at line 81 of file Pass.ixx.
Referenced by managerTypeIds and registerManagerFlush.
parallelManagerTypeIds_
| protected |
List of ManagerTypeIds for parallel execution.
Definition at line 86 of file Pass.ixx.
Referenced by parallelManagerTypeIds and registerManagerParallelFlush.
systemRegistry_
| protected |
Registry holding all systems for this pass.
Definition at line 61 of file Pass.ixx.
Referenced by registerCallableSystem, registerParallelTypedSystem and registerTypedSystem.
systemTypeIdQueue_
| protected |
Queue of system type IDs for execution order.
Each entry holds a group of one or more SystemType-ids, whereas multiple ids indicate systems that can be executed in parallel.
Definition at line 68 of file Pass.ixx.
Referenced by addParallelSystems, addParallelSystems, addSystem and addSystem.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.