System Class
Type-erased wrapper for game logic processors. More...
Declaration
Public Constructors Index
| System ()=default | |
template <typename T> | |
| System (T system) | |
| System (const System &)=delete | |
| System (System &&) noexcept=default | |
Public Operators Index
| System & | operator= (const System &)=delete |
| System & | operator= (System &&)=default |
Public Member Functions Index
| void | update (UpdateContext &updateContext) noexcept |
|
Delegates to the wrapped system's `update()` method. More... | |
| void | init (GameWorld &gameWorld) noexcept |
|
Delegates to the wrapped system's `init()` method, if present. More... | |
| void * | underlying () noexcept |
|
Returns a type-erased pointer to the wrapped system instance. More... | |
| const void * | underlying () const noexcept |
|
Returns a type-erased pointer to the wrapped system instance. More... | |
Private Member Attributes Index
| std::unique_ptr< Concept > | pimpl_ |
Description
Type-erased wrapper for game logic processors.
System uses the Concept/Model pattern to erase the concrete system type. Concrete systems are plain classes that satisfy `HasUpdate<T>` — they do not inherit from System.
The internal `Concept` base defines the virtual interface, and `Model<T>` adapts the concrete type T, owning it by value. `init()` is conditionally forwarded if `HasInit<T>` is satisfied.
System is move-only (non-copyable).
- See Also
HasUpdate
- See Also
HasInit
- See Also
Definition at line 43 of file System.ixx.
Public Constructors
System()
| default |
System()
| inline explicit |
Wraps a concrete system in a type-erased System.
- Template Parameters
-
T The concrete system type, must satisfy `HasUpdate<T>`.
- Parameters
-
system The concrete system instance to wrap (moved into internal storage).
Definition at line 109 of file System.ixx.
System()
| delete |
Definition at line 111 of file System.ixx.
Reference System.
System()
| noexcept default |
Definition at line 115 of file System.ixx.
Reference System.
Public Operators
operator=()
| delete |
Definition at line 112 of file System.ixx.
Reference System.
operator=()
| default |
Definition at line 114 of file System.ixx.
Reference System.
Public Member Functions
init()
| inline noexcept |
Delegates to the wrapped system's `init()` method, if present.
If the concrete type satisfies `HasInit<T>`, its `init()` is called. Otherwise this is a no-op.
- Parameters
-
gameWorld The GameWorld for one-time initialization.
- Precondition
System must be initialized (pimpl_ != nullptr).
Definition at line 140 of file System.ixx.
underlying()
| inline nodiscard noexcept |
Returns a type-erased pointer to the wrapped system instance.
- Returns
Pointer to the underlying concrete system.
- Precondition
System must be initialized (pimpl_ != nullptr).
Definition at line 152 of file System.ixx.
underlying()
| inline nodiscard noexcept |
Returns a type-erased pointer to the wrapped system instance.
- Returns
Pointer to the underlying concrete system.
- Precondition
System must be initialized (pimpl_ != nullptr).
Definition at line 160 of file System.ixx.
update()
| inline noexcept |
Delegates to the wrapped system's `update()` method.
- Parameters
-
updateContext The current frame's update context.
- Precondition
System must be initialized (pimpl_ != nullptr).
Definition at line 125 of file System.ixx.
Reference update.
Referenced by update.
Private Member Attributes
pimpl_
|
Definition at line 91 of file System.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.