Skip to main content

Model Class Template

Typed wrapper that adapts a concrete system to the Concept interface. More...

Declaration

template <typename T> class helios::engine::runtime::world::System::Model<T> { ... }

Base class

classhelios::engine::runtime::world::System::Concept

Public Constructors Index

template <typename T>
Model (T sys, void *buffer=nullptr)

Public Member Functions Index

template <typename T>
voidupdate (UpdateContext &ctx) noexcept override
template <typename T>
voidinit (GameWorld &gameWorld) noexcept override
template <typename T>
voidflush (UpdateContext &ctx) noexcept override
template <typename T>
void *underlying () noexcept override
template <typename T>
const void *underlying () const noexcept override

Private Member Attributes Index

template <typename T>
Tsystem_
template <typename T>
void *injectedBuffer_ {nullptr}

Description

Typed wrapper that adapts a concrete system to the Concept interface.

Template Parameters
T

The concrete system type, must satisfy IsSystemLike<T>.

Definition at line 74 of file System.ixx.

Public Constructors

Model()

template <typename T>
helios::engine::runtime::world::System::Model< T >::Model (T sys, void * buffer=nullptr)
inline explicit

Definition at line 79 of file System.ixx.

79 explicit Model(T sys, void* buffer = nullptr)
80 : system_(std::move(sys)), injectedBuffer_(buffer) {}

Public Member Functions

flush()

template <typename T>
void helios::engine::runtime::world::System::Model< T >::flush (UpdateContext & ctx)
inline noexcept

Definition at line 95 of file System.ixx.

95 void flush(UpdateContext& ctx) noexcept override {
96 if constexpr (requires { typename T::CommandBuffer_type; }) {
97 static_cast<typename T::CommandBuffer_type*>(injectedBuffer_)->flush(ctx);
98 }
99 }

init()

template <typename T>
void helios::engine::runtime::world::System::Model< T >::init (GameWorld & gameWorld)
inline noexcept

Definition at line 91 of file System.ixx.

91 void init(GameWorld& gameWorld) noexcept override {
92 // noop
93 }

underlying()

template <typename T>
void * helios::engine::runtime::world::System::Model< T >::underlying ()
inline noexcept

Definition at line 101 of file System.ixx.

101 void* underlying() noexcept override {
102 return &system_;
103 }

underlying()

template <typename T>
const void * helios::engine::runtime::world::System::Model< T >::underlying ()
inline noexcept

Definition at line 105 of file System.ixx.

105 const void* underlying() const noexcept override {
106 return &system_;
107 }

update()

template <typename T>
void helios::engine::runtime::world::System::Model< T >::update (UpdateContext & ctx)
inline noexcept

Definition at line 82 of file System.ixx.

82 void update(UpdateContext& ctx) noexcept override {
83 if constexpr (requires { typename T::CommandBuffer_type; }) {
84 using BufT = typename T::CommandBuffer_type;
85 system_.update(ctx, *static_cast<BufT*>(injectedBuffer_));
86 } else {
87 system_.update(ctx);
88 }
89 }

Private Member Attributes

injectedBuffer_

template <typename T>
void* helios::engine::runtime::world::System::Model< T >::injectedBuffer_ {nullptr}

Definition at line 76 of file System.ixx.

76 void* injectedBuffer_{nullptr};

system_

template <typename T>
T helios::engine::runtime::world::System::Model< T >::system_

Definition at line 75 of file System.ixx.

75 T system_;

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.