CallableSystem.ixx File
Small ECS system wrapper around an update lambda. More...
Included Headers
#include <memory>
#include <functional>
#include <type_traits>
#include <utility>
#include <helios.ecs.components>
#include <helios.engine.runtime.messaging.command.concepts>
#include <helios.engine.runtime.world.UpdateContext>
#include <helios.engine.runtime.world.tags.SystemRole>
Namespaces Index
| namespace | helios |
| namespace | engine |
| namespace | core |
| namespace | systems |
| namespace | components |
Classes Index
| class | CallableSystem<THandle, TFunc> |
|
ECS system that executes a stored lambda on each update. More... | |
| class | CallableSystem<THandle, TCommandBuffer, TFunc> |
|
ECS system that executes a stored lambda on each update. More... | |
Description
Small ECS system wrapper around an update lambda.
File Listing
The file content with the documentation metadata removed is:
21using namespace helios::engine::runtime::world;
22using namespace helios::engine::runtime::world::tags;
24export namespace helios::engine::core::systems {
26 template <typename THandle, typename... TArgs>
27 class CallableSystem;
36 class CallableSystem<THandle, TFunc> {
38 TFunc lambda_;
42 using EngineRoleTag = CallableSystemRole;
55 void update(UpdateContext& updateContext) noexcept {
56 std::invoke(lambda_, updateContext);
68 requires IsCommandBufferLike<TCommandBuffer>
69 class CallableSystem<THandle, TCommandBuffer, TFunc> {
71 TFunc lambda_;
75 using CommandBuffer_type = TCommandBuffer;
77 using EngineRoleTag = CallableSystemRole;
91 void update(UpdateContext& updateContext, TCommandBuffer& commandBuffer) noexcept {
92 std::invoke(lambda_, updateContext, commandBuffer);
108 [[nodiscard]] auto callableSystemForLambda(TFunc&& func) {
109 using FuncType = std::remove_cvref_t<TFunc>;
111 return CallableSystem<THandle, FuncType>(std::forward<TFunc>(func));
127 requires IsCommandBufferLike<TCommandBuffer>
128 [[nodiscard]] auto callableSystemForLambda(TFunc&& func) {
129 using FuncType = std::remove_cvref_t<TFunc>;
131 return CallableSystem<THandle, TCommandBuffer, FuncType>(std::forward<TFunc>(func));
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.