System.ixx File
Type-erased system wrapper using the Concept/Model pattern. More...
Included Headers
#include <cassert>
#include <memory>
#include <helios.engine.runtime.world.concepts>
#include <helios.engine.runtime.world.GameWorld>
#include <helios.engine.runtime.world.UpdateContext>
Namespaces Index
| namespace | helios |
| namespace | engine |
| namespace | runtime |
| namespace | world |
Classes Index
| class | System |
|
Type-erased wrapper for game logic processors. More... | |
| class | Concept |
|
Internal virtual interface for type erasure. More... | |
| class | Model<T> |
|
Typed wrapper that adapts a concrete system to the Concept interface. More... | |
Description
Type-erased system wrapper using the Concept/Model pattern.
File Listing
The file content with the documentation metadata removed is:
18using namespace helios::engine::runtime::world;
20export namespace helios::engine::runtime::world {
54 virtual void update(UpdateContext& updateContext) noexcept = 0;
65 class Model final : public Concept {
70 explicit Model(T sys, void* buffer = nullptr)
71 : system_(std::move(sys)), injectedBuffer_(buffer) {}
73 void update(UpdateContext& ctx) noexcept override {
75 using BufT = typename T::CommandBuffer_type;
78 system_.update(ctx);
110 requires IsSystemLike<T>
112 : pimpl_(std::make_unique<Model<T>>(std::move(system), buffer))
130 void update(UpdateContext& updateContext) noexcept {
131 assert(pimpl_ && "System not initialized");
132 pimpl_->update(updateContext);
143 [[nodiscard]] void* underlying() noexcept {
144 assert(pimpl_ && "System not initialized");
151 [[nodiscard]] const void* underlying() const noexcept {
152 assert(pimpl_ && "System not initialized");
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.