MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Yantra::ComputeOperation< InputType, OutputType > Class Template Referenceabstract

Base interface for all computational operations in the processing pipeline. More...

#include <ComputeOperation.hpp>

+ Inheritance diagram for MayaFlux::Yantra::ComputeOperation< InputType, OutputType >:
+ Collaboration diagram for MayaFlux::Yantra::ComputeOperation< InputType, OutputType >:

Public Types

using input_type = Datum< InputType >
 
using output_type = Datum< OutputType >
 

Public Member Functions

void add_dependency (std::shared_ptr< ComputeOperation > dep)
 
output_type apply_operation (const input_type &input)
 Public synchronous execution interface.
 
output_type apply_operation_with_dependencies (const input_type &input)
 Applies the operation with dependencies resolved.
 
OutputType apply_to_data (const InputType &data)
 Convenience overload that extracts just the data from result.
 
 ComputeOperation ()
 Constructor with data type validation warnings.
 
output_type execute (const input_type &input)
 OpUnit interface - operations can act as units in dependency graphs.
 
virtual std::map< std::string, std::any > get_all_parameters () const
 Retrieves all parameters and their values.
 
virtual const std::shared_ptr< Kakshya::SignalSourceContainer > & get_container_for_regions () const
 
const auto & get_dependencies () const
 
const ExecutionContextget_last_execution_context () const
 
virtual std::string get_name () const
 Get operation name for debugging/introspection.
 
virtual OperationType get_operation_type () const =0
 Returns the category of this operation for grammar and registry discovery.
 
virtual std::any get_parameter (const std::string &name) const =0
 Retrieves a parameter's current value.
 
bool has_gpu_backend () const
 
output_type operator() (const InputType &data)
 Convenience overload for direct data processing (backward compatibility)
 
virtual void set_container_for_regions (const std::shared_ptr< Kakshya::SignalSourceContainer > &container)
 
void set_gpu_backend (std::shared_ptr< GpuExecutionContext< InputType, OutputType > > backend)
 Attach a GPU execution backend.
 
void set_last_execution_context (const ExecutionContext &ctx)
 
virtual void set_parameter (const std::string &name, std::any value)=0
 Sets a named parameter that configures the operation's behavior.
 
void set_post_execution_hook (const OperationHookCallback &hook)
 
void set_pre_execution_hook (const OperationHookCallback &hook)
 
void set_reconstruction_callback (const ReconstructionCallback &callback)
 
virtual bool validate_input (const input_type &) const
 Validates if the input data meets the operation's requirements.
 
virtual ~ComputeOperation ()=default
 Virtual destructor for proper cleanup of derived classes.
 

Protected Member Functions

output_type apply_hooks (const input_type &input, const ExecutionContext &context)
 
virtual std::future< output_typeapply_operation_async (const input_type &input)
 Optional async implementation - default delegates to operation_function.
 
virtual output_type apply_operation_chained (const input_type &input, const ExecutionContext &ctx)
 Optional chain-aware implementation - default delegates to operation_function.
 
virtual output_type apply_operation_internal (const input_type &input, const ExecutionContext &context)
 Internal execution method - ComputeMatrix can access this.
 
virtual output_type apply_operation_parallel (const input_type &input, const ExecutionContext &ctx)
 Optional parallel-aware implementation - default delegates to operation_function.
 
output_type convert_result (std::vector< std::vector< double > > &result_data, DataStructureInfo &metadata)
 Convert processed double data back to OutputType using metadata and optional callback.
 
virtual output_type operation_function (const input_type &input)=0
 Executes the computational transformation on the input data.
 

Protected Attributes

std::shared_ptr< Kakshya::SignalSourceContainerm_container
 
ExecutionContext m_last_execution_context
 

Private Member Functions

void validate_operation_data_types () const
 Validate input/output types and warn about marker types.
 

Private Attributes

std::vector< std::shared_ptr< ComputeOperation > > m_dependencies
 
std::shared_ptr< GpuExecutionContext< InputType, OutputType > > m_gpu_backend
 

Friends

class ComputeMatrix
 

Detailed Description

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = InputType>
class MayaFlux::Yantra::ComputeOperation< InputType, OutputType >

Base interface for all computational operations in the processing pipeline.

Defines the core contract for operations that transform data from one type to another. Operations can be parameterized, validated, and composed into complex processing networks.

Template Parameters
InputTypeThe data type accepted by this operation
OutputTypeThe data type produced by this operation, defaults to InputType

Definition at line 22 of file ComputeOperation.hpp.


The documentation for this class was generated from the following file: