MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ on_attach()

void MayaFlux::Buffers::PresentProcessor::on_attach ( std::shared_ptr< Buffer buffer)
overridevirtual

Called when processor is attached to a buffer.

Parameters
bufferBuffer being attached to

Validates that the buffer is a RootGraphicsBuffer and ensures token compatibility for graphics rendering.

Reimplemented from MayaFlux::Buffers::BufferProcessor.

Definition at line 146 of file RootGraphicsBuffer.cpp.

147{
148 auto root_graphics_buffer = std::dynamic_pointer_cast<RootGraphicsBuffer>(buffer);
149 if (!root_graphics_buffer) {
150 error<std::invalid_argument>(
153 std::source_location::current(),
154 "RenderProcessor can only be attached to RootGraphicsBuffer");
155 }
156
158 error<std::runtime_error>(
161 std::source_location::current(),
162 "RenderProcessor token incompatible with RootGraphicsBuffer requirements");
163 }
164
165 m_root_buffer = root_graphics_buffer;
166
168 "RenderProcessor attached to RootGraphicsBuffer (has_callback: {})",
169 has_callback());
170}
#define MF_INFO(comp, ctx,...)
bool has_callback() const
Checks if a callback is configured.
std::shared_ptr< RootGraphicsBuffer > m_root_buffer
Reference to root buffer (for validation and callbacks)
bool are_tokens_compatible(ProcessingToken preferred, ProcessingToken current)
Determines if two processing tokens are compatible for joint execution.
@ GRAPHICS_BACKEND
Standard graphics processing backend configuration.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Buffers::are_tokens_compatible(), MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, MayaFlux::Buffers::GRAPHICS_BACKEND, has_callback(), MayaFlux::Buffers::BufferProcessor::m_processing_token, m_root_buffer, and MF_INFO.

+ Here is the call graph for this function: