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

◆ on_attach()

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

Called when this processor is attached to a buffer.

Parameters
bufferBuffer this processor is being attached to

Provides an opportunity for the processor to initialize buffer-specific state, allocate resources, or perform validation. With expanded processor capabilities, this method can also:

  • Analyze Buffer Characteristics: Examine data type, size, and format requirements
  • Select Optimal Backend: Choose the most appropriate processing backend for the buffer
  • Initialize Hardware Resources: Set up GPU contexts, CUDA streams, or other acceleration
  • Configure Processing Parameters: Adapt algorithm parameters to buffer characteristics
  • Establish Processing Strategy: Determine whether to use sequential or parallel execution
  • Validate Compatibility: Ensure the processor can handle the buffer's data type and format

Default implementation does nothing, but derived classes should override this method to leverage the full capabilities of the expanded processor architecture.

Reimplemented from MayaFlux::Buffers::BufferProcessor.

Definition at line 116 of file BufferDownloadProcessor.cpp.

117{
118 if (!is_compatible_with(buffer)) {
119 error<std::runtime_error>(
122 std::source_location::current(),
123 "BufferDownloadProcessor can only be attached to VKBuffer");
124 }
125
126 if (!m_buffer_service) {
128 .get_service<Registry::Service::BufferService>();
129 }
130
131 if (!m_buffer_service) {
132 error<std::runtime_error>(
135 std::source_location::current(),
136 "No processing context available for BufferDownloadProcessor");
137 }
138
140 "BufferDownloadProcessor attached");
141}
#define MF_INFO(comp, ctx,...)
bool is_compatible_with(std::shared_ptr< Buffer > buffer) const override
Checks if this processor can handle the specified buffer type.
Registry::Service::BufferService * m_buffer_service
Definition VKBuffer.hpp:468
Interface * get_service()
Query for a backend service.
static BackendRegistry & instance()
Get the global registry instance.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, MayaFlux::Registry::BackendRegistry::get_service(), MayaFlux::Registry::BackendRegistry::instance(), is_compatible_with(), MayaFlux::Buffers::VKBufferProcessor::m_buffer_service, and MF_INFO.

+ Here is the call graph for this function: