CommandBuffer Class
Type-erased wrapper for command buffers using the Concept/Model pattern. More...
Declaration
Public Constructors Index
| CommandBuffer ()=default | |
template <typename T> | |
| CommandBuffer (T cmdBuffer) | |
|
Constructs a CommandBuffer wrapping the given concrete buffer. More... | |
| CommandBuffer (const CommandBuffer &)=delete | |
| CommandBuffer (CommandBuffer &&) noexcept=default | |
Public Operators Index
| CommandBuffer & | operator= (const CommandBuffer &)=delete |
| CommandBuffer & | operator= (CommandBuffer &&)=default |
Public Member Functions Index
| void | flush (UpdateContext &updateContext) noexcept |
|
Executes all queued commands and clears the buffer. More... | |
| void | clear () noexcept |
|
Discards all queued commands without executing them. More... | |
| void | init (CommandHandlerRegistry &commandHandlerRegistry, TimerManager &timerManager) noexcept |
| void * | underlying () noexcept |
|
Returns a type-erased pointer to the owned buffer instance. More... | |
| const void * | underlying () const noexcept |
|
Returns a type-erased pointer to the owned buffer instance. More... | |
Private Member Attributes Index
| std::unique_ptr< Concept > | pimpl_ |
|
Owning pointer to the type-erased command buffer. More... | |
Description
Type-erased wrapper for command buffers using the Concept/Model pattern.
CommandBuffer erases the concrete buffer type at construction time, allowing heterogeneous storage and polymorphic dispatch without requiring concrete buffers to inherit from a common base class.
Definition at line 50 of file CommandBuffer.ixx.
Public Constructors
CommandBuffer()
| default |
Definition at line 113 of file CommandBuffer.ixx.
CommandBuffer()
| inline explicit |
Constructs a CommandBuffer wrapping the given concrete buffer.
Ownership of the buffer is transferred into a heap-allocated Model<T>. The concrete type is erased after construction.
- Template Parameters
-
T The concrete buffer type. Must satisfy IsCommandBufferLike.
- Parameters
-
cmdBuffer The buffer instance to wrap. Moved into the wrapper.
Definition at line 127 of file CommandBuffer.ixx.
CommandBuffer()
| delete |
Definition at line 129 of file CommandBuffer.ixx.
CommandBuffer()
| noexcept default |
Definition at line 133 of file CommandBuffer.ixx.
Public Operators
operator=()
| delete |
Definition at line 130 of file CommandBuffer.ixx.
operator=()
| default |
Definition at line 132 of file CommandBuffer.ixx.
Public Member Functions
clear()
| inline noexcept |
Discards all queued commands without executing them.
- Precondition
The CommandBuffer must be initialized.
Definition at line 157 of file CommandBuffer.ixx.
Reference helios::engine::runtime::registerComponents.
flush()
| inline noexcept |
Executes all queued commands and clears the buffer.
Delegates to the wrapped buffer's flush(). Commands are routed to their registered handler if available, otherwise executed directly.
- Parameters
-
gameWorld The game world providing the CommandHandlerRegistry.
updateContext The current frame's update context.
- Precondition
The CommandBuffer must be initialized (not default-constructed).
Definition at line 147 of file CommandBuffer.ixx.
Reference helios::engine::runtime::registerComponents.
init()
| inline noexcept |
Definition at line 162 of file CommandBuffer.ixx.
Reference helios::engine::runtime::registerComponents.
underlying()
| inline noexcept |
Returns a type-erased pointer to the owned buffer instance.
- Returns
Non-null void pointer to the underlying concrete buffer.
- Precondition
The CommandBuffer must be initialized.
Definition at line 174 of file CommandBuffer.ixx.
Reference helios::engine::runtime::registerComponents.
underlying()
| inline noexcept |
Returns a type-erased pointer to the owned buffer instance.
- Returns
Non-null void pointer to the underlying concrete buffer.
- Precondition
The CommandBuffer must be initialized.
Definition at line 182 of file CommandBuffer.ixx.
Reference helios::engine::runtime::registerComponents.
Private Member Attributes
pimpl_
|
Owning pointer to the type-erased command buffer.
Definition at line 109 of file CommandBuffer.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.