|
MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
|
Local execution orchestrator for computational operations. More...
#include <ComputeMatrix.hpp>
Inheritance diagram for MayaFlux::Yantra::ComputeMatrix:
Collaboration diagram for MayaFlux::Yantra::ComputeMatrix:Public Member Functions | |
| template<typename OpClass > | |
| bool | add_operation (const std::string &name, std::shared_ptr< OpClass > operation) |
| Add a pre-configured operation instance to this matrix. | |
| template<typename OpClass , typename... Args> | |
| std::shared_ptr< OpClass > | create_operation (const std::string &name, Args &&... args) |
| Create and add an operation to this matrix. | |
| template<typename OpClass > | |
| std::shared_ptr< OpClass > | get_operation (const std::string &name) |
| Get a named operation from this matrix. | |
| bool | remove_operation (const std::string &name) |
| Remove a named operation from this matrix. | |
| std::vector< std::string > | list_operations () const |
| List all operation names in this matrix. | |
| void | clear_operations () |
| Clear all operations from this matrix. | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType = InputType, typename... Args> | |
| std::optional< IO< OutputType > > | execute (const InputType &input, Args &&... args) |
| Execute an operation by creating a new instance. | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType = InputType> | |
| std::optional< IO< OutputType > > | execute_named (const std::string &name, const InputType &input) |
| Execute a named operation from the pool. | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType = InputType> | |
| std::optional< IO< OutputType > > | execute_with (std::shared_ptr< OpClass > operation, const InputType &input) |
| Execute with provided operation instance. | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType = InputType, typename... Args> | |
| std::future< std::optional< IO< OutputType > > > | execute_async (const InputType &input, Args &&... args) |
| Execute operation asynchronously. | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType = InputType> | |
| std::future< std::optional< IO< OutputType > > > | execute_named_async (const std::string &name, const InputType &input) |
| Execute named operation asynchronously. | |
| template<ComputeData InputType, typename... OpClasses> | |
| auto | execute_parallel (const InputType &input) |
| Execute multiple operations in parallel. | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType = InputType> | |
| std::vector< std::optional< IO< OutputType > > > | execute_parallel_named (const std::vector< std::string > &names, const InputType &input) |
| Execute multiple named operations in parallel. | |
| template<typename FirstOp , typename SecondOp , ComputeData InputType, ComputeData IntermediateType, ComputeData OutputType> | |
| std::optional< IO< OutputType > > | execute_chain (const InputType &input) |
| Execute operations in sequence (type-safe chain) | |
| template<typename FirstOp , typename SecondOp , ComputeData InputType, ComputeData IntermediateType, ComputeData OutputType> | |
| std::optional< IO< OutputType > > | execute_chain_named (const std::string &first_name, const std::string &second_name, const InputType &input) |
| Execute named operations in sequence. | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType = InputType, typename... Args> | |
| std::vector< std::optional< IO< OutputType > > > | execute_batch (const std::vector< InputType > &inputs, Args &&... args) |
| Execute operation on multiple inputs. | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType = InputType, typename... Args> | |
| std::vector< std::optional< IO< OutputType > > > | execute_batch_parallel (const std::vector< InputType > &inputs, Args &&... args) |
| Execute operation on multiple inputs in parallel. | |
| template<ComputeData StartType> | |
| FluentExecutor< ComputeMatrix, StartType > | with (const StartType &input) |
| Create a fluent executor for chaining operations. | |
| template<ComputeData StartType> | |
| FluentExecutor< ComputeMatrix, StartType > | with (StartType &&input) |
| Create a fluent executor with move semantics. | |
| void | set_execution_policy (ExecutionPolicy policy) |
| Set execution policy for this matrix. | |
| ExecutionPolicy | get_execution_policy () const |
| Get current execution policy. | |
| void | set_profiling (bool enabled) |
| Enable/disable execution profiling. | |
| std::unordered_map< std::string, std::any > | get_statistics () const |
| Get execution statistics. | |
| void | set_context_configurator (std::function< void(ExecutionContext &, const std::type_index &)> configurator) |
| Set custom context configurator. | |
| void | set_default_timeout (std::chrono::milliseconds timeout) |
| Set default execution timeout. | |
| ComputeMatrix ()=default | |
| void | set_error_callback (std::function< void(const std::exception &, const std::type_index &)> callback) |
| Set error callback. | |
| std::string | get_last_error () const |
| Get last error message. | |
Static Public Member Functions | |
| static std::shared_ptr< ComputeMatrix > | create () |
| Create a new ComputeMatrix instance. | |
Private Member Functions | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType> | |
| std::optional< IO< OutputType > > | execute_operation (std::shared_ptr< OpClass > operation, const InputType &input) |
| Core execution implementation. | |
| void | configure_execution_context (ExecutionContext &ctx, const std::type_index &op_type) |
| Configure execution context based on operation type and policy. | |
| void | handle_execution_error (const std::exception &e, const std::type_index &op_type) |
| Handle execution errors. | |
| void | update_execution_time (double ms) |
| Update execution time statistics. | |
Private Attributes | |
| OperationPool | m_operations |
| ExecutionPolicy | m_execution_policy = ExecutionPolicy::BALANCED |
| std::chrono::milliseconds | m_default_timeout { 0 } |
| std::function< void(ExecutionContext &, const std::type_index &)> | m_context_configurator |
| std::atomic< size_t > | m_total_executions { 0 } |
| std::atomic< size_t > | m_failed_executions { 0 } |
| std::atomic< double > | m_average_execution_time { 0.0 } |
| bool | m_profiling_enabled = false |
| std::string | m_last_error |
| std::type_index | m_last_error_type { typeid(void) } |
| std::function< void(const std::exception &, const std::type_index &)> | m_error_callback |
Local execution orchestrator for computational operations.
ComputeMatrix provides a self-contained execution environment for operations. It maintains its own operation instances and execution strategies without relying on any global registries. Each matrix instance is independent.
Key Design Principles:
Core Responsibilities:
Definition at line 40 of file ComputeMatrix.hpp.