Skip to main content

LambdaSystem Class Template

ECS system that executes a stored lambda on each update. More...

Declaration

template <typename THandle> class helios::engine::core::systems::LambdaSystem<THandle> { ... }

Public Member Typedefs Index

template <typename THandle>
usingEngineRoleTag = SystemRole

Private Member Typedefs Index

template <typename THandle>
usingFunctionType = std::function< void(UpdateContext &)>

Public Constructors Index

template <typename THandle>
LambdaSystem (FunctionType lambda)

Creates the system from an update callback. More...

Public Member Functions Index

template <typename THandle>
voidupdate (UpdateContext &updateContext) noexcept

Executes the stored callback for the current update step. More...

Private Member Attributes Index

template <typename THandle>
FunctionTypelambda_

Description

ECS system that executes a stored lambda on each update.

Template Parameters
THandle

Handle type used by the surrounding system graph.

Definition at line 28 of file LambdaSystem.ixx.

Public Member Typedefs

EngineRoleTag

template <typename THandle>
using helios::engine::core::systems::LambdaSystem< THandle >::EngineRoleTag = SystemRole

Definition at line 35 of file LambdaSystem.ixx.

Private Member Typedefs

FunctionType

template <typename THandle>
using helios::engine::core::systems::LambdaSystem< THandle >::FunctionType = std::function<void(UpdateContext&)>

Definition at line 30 of file LambdaSystem.ixx.

30 using FunctionType = std::function<void(UpdateContext&)>;

Public Constructors

LambdaSystem()

template <typename THandle>
helios::engine::core::systems::LambdaSystem< THandle >::LambdaSystem (FunctionType lambda)
inline explicit

Creates the system from an update callback.

Parameters
lambda

Callback executed in update.

Definition at line 41 of file LambdaSystem.ixx.

41 explicit LambdaSystem(FunctionType lambda) : lambda_(std::move(lambda)) {}

Public Member Functions

update()

template <typename THandle>
void helios::engine::core::systems::LambdaSystem< THandle >::update (UpdateContext & updateContext)
inline noexcept

Executes the stored callback for the current update step.

Parameters
updateContext

Runtime context of the engine update.

Definition at line 48 of file LambdaSystem.ixx.

49 lambda_(updateContext);
50 }

Reference helios::engine::core::registerComponents.

Private Member Attributes

lambda_

template <typename THandle>
FunctionType helios::engine::core::systems::LambdaSystem< THandle >::lambda_

Definition at line 31 of file LambdaSystem.ixx.

31 FunctionType lambda_;

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.