Skip to main content

Pass Class

Abstract base class for game loop passes. More...

Declaration

class helios::engine::runtime::gameloop::Pass { ... }

Derived Classes

classTypedPass<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

voidupdate (helios::engine::runtime::world::UpdateContext &updateContext)=0

Updates all systems in this pass. More...

voidinit (helios::engine::runtime::world::GameWorld &gameWorld)=0

Initializes all systems in this pass. More...

Phase &addCommitPoint (const CommitPoint commitPoint=CommitPoint::PassEvents)=0

Adds a commit point and returns the owning Phase. More...

CommitPointcommitPoint () const noexcept=0

Returns the configured commit point. More...

boolshouldRun (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...

Protected Member Attributes Index

helios::engine::runtime::world::SystemRegistrysystemRegistry_ {}

Registry holding all systems for this pass. More...

GameWorld &gameWorld_

Reference to the owning GameWorld. 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 48 of file Pass.ixx.

Public Constructors

Pass()

helios::engine::runtime::gameloop::Pass::Pass (GameWorld & gameWorld)
inline explicit

Constructs a pass bound to a specific GameWorld.

Parameters
gameWorld

GameWorld used for system initialization and command buffer lookup.

Definition at line 74 of file Pass.ixx.

74 explicit Pass(GameWorld& gameWorld) : gameWorld_(gameWorld) {};

Public Destructor

~Pass()

virtual helios::engine::runtime::gameloop::Pass::~Pass ()
virtual default

Definition at line 66 of file Pass.ixx.

Public Member Functions

addCommitPoint()

virtual Phase & helios::engine::runtime::gameloop::Pass::addCommitPoint (const CommitPoint commitPoint=CommitPoint::PassEvents)

Adds a commit point and returns the owning Phase.

Parameters
commitPoint

The synchronization flags.

Returns

Reference to the owning Phase.

Definition at line 97 of file Pass.ixx.

addSystem()

template <typename T, typename... Args>
Pass & helios::engine::runtime::gameloop::Pass::addSystem (Args &&... args)
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 131 of file Pass.ixx.

132
133 T concreteSystem(std::forward<Args>(args)...);
134
135 void* bufferPtr = nullptr;
136 if constexpr (requires { typename T::CommandBuffer_type; }) {
137 using TCommandBuffer = typename T::CommandBuffer_type;
139 assert(bufferPtr && "Command buffer not found for system's CommandBuffer_type");
140 }
141
142 systemRegistry_.template add<T>(
144 );
145
146 return *this;
147 }

References gameWorld_, helios::engine::runtime::registerComponents, systemRegistry_ and helios::engine::runtime::world::GameWorld::tryCommandBuffer.

commitPoint()

virtual CommitPoint helios::engine::runtime::gameloop::Pass::commitPoint ()
noexcept

Returns the configured commit point.

Returns

The commit point flags for this pass.

Definition at line 104 of file Pass.ixx.

init()

virtual void helios::engine::runtime::gameloop::Pass::init (helios::engine::runtime::world::GameWorld & gameWorld)

Initializes all systems in this pass.

Parameters
gameWorld

Reference to the game world.

Definition at line 88 of file Pass.ixx.

shouldRun()

virtual bool helios::engine::runtime::gameloop::Pass::shouldRun (helios::engine::runtime::world::UpdateContext & updateContext)
noexcept

Determines if this pass should execute.

Parameters
updateContext

The current update context.

Returns

True if the pass should run.

Definition at line 113 of file Pass.ixx.

update()

virtual void helios::engine::runtime::gameloop::Pass::update (helios::engine::runtime::world::UpdateContext & updateContext)

Updates all systems in this pass.

Parameters
updateContext

The current update context.

Definition at line 81 of file Pass.ixx.

Protected Member Attributes

gameWorld_

GameWorld& helios::engine::runtime::gameloop::Pass::gameWorld_
protected

Reference to the owning GameWorld.

Used to resolve optional command buffer dependencies for systems declaring CommandBuffer_type.

Definition at line 62 of file Pass.ixx.

Referenced by addSystem.

systemRegistry_

helios::engine::runtime::world::SystemRegistry helios::engine::runtime::gameloop::Pass::systemRegistry_ {}
protected

Registry holding all systems for this pass.

Definition at line 54 of file Pass.ixx.

Referenced by addSystem.


The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.