MayaFlux 1.0.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 189 of file RootGraphicsBuffer.cpp.

190{
191 auto root_graphics_buffer = std::dynamic_pointer_cast<RootGraphicsBuffer>(buffer);
192 if (!root_graphics_buffer) {
193 error<std::invalid_argument>(
196 std::source_location::current(),
197 "RenderProcessor can only be attached to RootGraphicsBuffer");
198 }
199
201 error<std::runtime_error>(
204 std::source_location::current(),
205 "RenderProcessor token incompatible with RootGraphicsBuffer requirements");
206 }
207
208 m_root_buffer = root_graphics_buffer;
209 m_attached = true;
210
212 "RenderProcessor attached to RootGraphicsBuffer (has_callback: {})",
213 has_callback());
214}
#define MF_INFO(comp, ctx,...)
std::shared_ptr< NetworkGeometryBuffer > buffer
bool has_callback() const
Checks if a callback is configured.
std::weak_ptr< RootGraphicsBuffer > m_root_buffer
Root buffer this presenter is attached to.
bool m_attached
Distinguishes an expired attachment from an unattached presenter.
@ GRAPHICS_BACKEND
Standard graphics processing backend configuration.
bool are_tokens_compatible(ProcessingToken preferred, ProcessingToken current)
Determines if two processing tokens are compatible for joint execution.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

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

+ Here is the call graph for this function: