Manager Class
Type-erased wrapper for game world managers. More...
Declaration
Public Constructors Index
| Manager ()=default | |
template <typename T> | |
| Manager (T manager) | |
| Manager (const Manager &)=delete | |
| Manager (Manager &&) noexcept=default | |
Public Operators Index
| Manager & | operator= (const Manager &)=delete |
| Manager & | operator= (Manager &&)=default |
Public Member Functions Index
| void | flush (UpdateContext &updateContext) noexcept |
| void | init (CommandHandlerRegistry &commandHandlerRegistry) noexcept |
|
Delegates to the wrapped manager's init() method, if present. More... | |
| void | reset () noexcept |
|
Delegates to the wrapped manager's reset() method, if present. More... | |
| void * | underlying () noexcept |
|
Returns a type-erased pointer to the wrapped manager instance. More... | |
| const void * | underlying () const noexcept |
|
Returns a type-erased pointer to the wrapped manager instance. More... | |
Private Member Attributes Index
| std::unique_ptr< Concept > | pimpl_ |
Description
Type-erased wrapper for game world managers.
Manager uses the Concept/Model pattern to erase the concrete manager type. Concrete managers are plain classes that satisfy IsManagerLike<T> (i.e. provide flush(UpdateContext&) and declare using EngineRoleTag = ManagerRole;).
The internal Concept base defines the virtual interface, and Model<T> adapts the concrete type T, owning it by value. init() and reset() are conditionally forwarded if the concrete type satisfies HasInit<T> or HasReset<T> respectively.
Manager is move-only (non-copyable).
- See Also
IsManagerLike
- See Also
ManagerRole
- See Also
- See Also
ConceptModelRegistry
Definition at line 63 of file Manager.ixx.
Public Constructors
Manager()
| default |
Default constructor creating an empty Manager.
Definition at line 123 of file Manager.ixx.
Manager()
| inline explicit |
Wraps a concrete manager in a type-erased Manager.
- Template Parameters
-
T The concrete manager type, must satisfy IsManagerLike<T>.
- Parameters
-
manager The concrete manager instance to wrap (moved into internal storage).
Definition at line 134 of file Manager.ixx.
Manager()
Definition at line 136 of file Manager.ixx.
Manager()
| noexcept default |
Definition at line 140 of file Manager.ixx.
Public Operators
operator=()
Definition at line 137 of file Manager.ixx.
operator=()
| default |
Definition at line 139 of file Manager.ixx.
Public Member Functions
flush()
| inline noexcept |
Delegates to the wrapped manager's flush() method.
Called by the GameLoop at each commit point after CommandBuffers have been flushed. Managers process their accumulated requests in batch.
- Parameters
-
updateContext The current frame's update context.
- Precondition
Manager must be initialized (pimpl_ != nullptr).
Definition at line 154 of file Manager.ixx.
Reference helios::engine::runtime::registerComponents.
init()
| inline noexcept |
Delegates to the wrapped manager's init() method, if present.
If the concrete type satisfies HasInit<T>, its init() is called. Otherwise this is a no-op. Typically used by managers to register command handlers in the command-handler registry.
- Parameters
-
commandHandlerRegistry Registry used for one-time handler registration.
- Precondition
Manager must be initialized (pimpl_ != nullptr).
Definition at line 171 of file Manager.ixx.
Reference helios::engine::runtime::registerComponents.
reset()
| inline noexcept |
Delegates to the wrapped manager's reset() method, if present.
If the concrete type satisfies HasReset<T>, its reset() is called. Otherwise this is a no-op. Used during level transitions or game restarts to clear accumulated state.
- Precondition
Manager must be initialized (pimpl_ != nullptr).
Definition at line 185 of file Manager.ixx.
Reference helios::engine::runtime::registerComponents.
underlying()
| inline noexcept |
Returns a type-erased pointer to the wrapped manager instance.
- Returns
Pointer to the underlying concrete manager.
- Precondition
Manager must be initialized (pimpl_ != nullptr).
Definition at line 197 of file Manager.ixx.
Reference helios::engine::runtime::registerComponents.
underlying()
| inline noexcept |
Returns a type-erased pointer to the wrapped manager instance.
- Returns
Pointer to the underlying concrete manager.
- Precondition
Manager must be initialized (pimpl_ != nullptr).
Definition at line 205 of file Manager.ixx.
Reference helios::engine::runtime::registerComponents.
Private Member Attributes
pimpl_
|
Definition at line 116 of file Manager.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.