CommandBuffer.ixx File
Type-erased command buffer wrapper using the Concept/Model pattern. More...
Included Headers
#include <cassert>
#include <memory>
#include <helios.engine.runtime.messaging.command.CommandHandlerRegistry>
#include <helios.engine.runtime.timing.TimerManager>
#include <helios.engine.runtime.messaging.command.concepts.IsCommandBufferLike>
#include <helios.engine.runtime.world.UpdateContext>
Namespaces Index
| namespace | helios |
| namespace | engine |
| namespace | runtime |
| namespace | messaging |
| namespace | command |
Classes Index
| class | CommandBuffer |
|
Type-erased wrapper for command buffers using the Concept/Model pattern. More... | |
| class | Concept |
|
Internal virtual interface for type-erased dispatch. More... | |
| class | Model<T> |
|
Typed model that adapts a concrete buffer to the Concept interface. More... | |
Description
Type-erased command buffer wrapper using the Concept/Model pattern.
File Listing
The file content with the documentation metadata removed is:
19using namespace helios::engine::runtime::timing;
21using namespace helios::engine::runtime::world;
22export namespace helios::engine::runtime::messaging::command {
50 class CommandBuffer {
60 virtual void flush(UpdateContext& updateContext) noexcept = 0;
62 virtual void init(CommandHandlerRegistry& commandHandlerRegistry, TimerManager& timerManager) noexcept = 0;
64 [[nodiscard]] virtual void* underlying() noexcept = 0;
65 [[nodiscard]] virtual const void* underlying() const noexcept = 0;
74 class Model final : public Concept {
85 void flush(UpdateContext& updateContext) noexcept override {
86 cmdBuffer_.flush(updateContext);
89 void init(CommandHandlerRegistry& commandHandlerRegistry, TimerManager& timerManager) noexcept override {
90 cmdBuffer_.init(commandHandlerRegistry, timerManager);
113 CommandBuffer() = default;
126 requires IsCommandBufferLike<T>
127 explicit CommandBuffer(T cmdBuffer) : pimpl_(std::make_unique<Model<T>>(std::move(cmdBuffer))) {}
129 CommandBuffer(const CommandBuffer&) = delete;
130 CommandBuffer& operator=(const CommandBuffer&) = delete;
132 CommandBuffer& operator=(CommandBuffer&&) = default;
147 void flush(UpdateContext& updateContext) noexcept {
148 assert(pimpl_ && "CommandBuffer not initialized");
149 pimpl_->flush(updateContext);
158 assert(pimpl_ && "CommandBuffer not initialized");
162 void init(CommandHandlerRegistry& commandHandlerRegistry, TimerManager& timerManager) noexcept {
163 assert(pimpl_ && "CommandBuffer not initialized");
164 pimpl_->init(commandHandlerRegistry, timerManager);
174 [[nodiscard]] void* underlying() noexcept {
175 assert(pimpl_ && "CommandBuffer not initialized");
182 [[nodiscard]] const void* underlying() const noexcept {
183 assert(pimpl_ && "CommandBuffer not initialized");
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.