MayaFlux 0.4.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 148 of file RootGraphicsBuffer.cpp.

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