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

◆ on_attach()

void MayaFlux::Buffers::PresentProcessor::on_attach ( const 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 149 of file RootGraphicsBuffer.cpp.

150{
151 auto root_graphics_buffer = std::dynamic_pointer_cast<RootGraphicsBuffer>(buffer);
152 if (!root_graphics_buffer) {
153 error<std::invalid_argument>(
156 std::source_location::current(),
157 "RenderProcessor can only be attached to RootGraphicsBuffer");
158 }
159
161 error<std::runtime_error>(
164 std::source_location::current(),
165 "RenderProcessor token incompatible with RootGraphicsBuffer requirements");
166 }
167
168 m_root_buffer = root_graphics_buffer;
169
171 "RenderProcessor attached to RootGraphicsBuffer (has_callback: {})",
172 has_callback());
173}
#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: