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

◆ processing_function()

void MayaFlux::Buffers::DataReadProcessor::processing_function ( const std::shared_ptr< Buffer > &  buffer)
overrideprotectedvirtual

The core processing function that must be implemented by derived classes.

Parameters
bufferBuffer to process

This method is where the actual transformation logic is implemented. It should contain the algorithmic details of how the buffer's data is transformed, analyzed, or processed. The implementation can utilize any backend capabilities available to the processor, including:

  • Parallel Processing: Using multi-threading or GPU compute for large datasets
  • Data Transformations: Applying mathematical operations, filters, or effects
  • Feature Extraction: Analyzing data characteristics for further processing

Derived classes must override this method to provide specific processing behavior.

Implements MayaFlux::Buffers::BufferProcessor.

Definition at line 459 of file DataReadProcessor.cpp.

460{
463 "DataReadProcessor attached to an incompatible buffer");
464 return;
465 }
466
467 if (m_result_occupied.load(std::memory_order_acquire)) {
468 return;
469 }
470
471 const auto vk_buffer = std::static_pointer_cast<VKBuffer>(buffer);
472 if (!vk_buffer->is_initialized()) {
473 return;
474 }
475
476 std::optional<ReadRequest> request;
477 m_request.drain([&request](ReadRequest& next) {
478 if (!request) {
479 request.emplace(std::move(next));
480 }
481 });
482 if (!request) {
483 return;
484 }
485
486 auto pending = std::make_unique<PendingRead>();
487 pending->source = vk_buffer;
488
489 if (!request->fill(*this, vk_buffer, *pending)) {
490 return;
491 }
492
493 m_result_occupied.store(true, std::memory_order_release);
494 m_result.push(std::move(pending));
495 m_result_ready.store(true, std::memory_order_release);
496}
#define MF_RT_ERROR(comp, ctx,...)
std::shared_ptr< NetworkGeometryBuffer > buffer
Memory::SweepList< std::unique_ptr< PendingRead > > m_result
Memory::SweepList< ReadRequest > m_request
bool is_compatible_with(const std::shared_ptr< Buffer > &buffer) const override
Checks if this processor can handle the specified buffer type.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References buffer, MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, is_compatible_with(), m_request, m_result, m_result_occupied, m_result_ready, and MF_RT_ERROR.

+ Here is the call graph for this function: