|
MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
|
ComputeMatrix extension that integrates grammar-based operation selection. More...
#include <ComputePipeline.hpp>
Inheritance diagram for MayaFlux::Yantra::GrammarAwareComputeMatrix:
Collaboration diagram for MayaFlux::Yantra::GrammarAwareComputeMatrix:Public Member Functions | |
| GrammarAwareComputeMatrix (std::shared_ptr< ComputationGrammar > grammar=nullptr) | |
| Constructor with optional grammar. | |
| template<ComputeData InputType> | |
| auto | execute_with_grammar (const InputType &input, const ExecutionContext &context={}) |
| Execute operations with grammar rule pre-processing. | |
| std::shared_ptr< ComputationGrammar > | get_grammar () const |
| Get the grammar instance. | |
| void | set_grammar (std::shared_ptr< ComputationGrammar > grammar) |
| Set grammar instance. | |
| void | add_grammar_rule (ComputationGrammar::Rule rule) |
| Add a grammar rule directly to the matrix. | |
| ComputationGrammar::RuleBuilder | create_grammar_rule (const std::string &name) |
| Create a rule builder for this matrix's grammar. | |
Public Member Functions inherited from MayaFlux::Yantra::ComputeMatrix | |
| 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. | |
Private Attributes | |
| std::shared_ptr< ComputationGrammar > | m_grammar |
| Grammar instance for rule-based operation selection. | |
Additional Inherited Members | |
Static Public Member Functions inherited from MayaFlux::Yantra::ComputeMatrix | |
| static std::shared_ptr< ComputeMatrix > | create () |
| Create a new ComputeMatrix instance. | |
ComputeMatrix extension that integrates grammar-based operation selection.
The GrammarAwareComputeMatrix extends the base ComputeMatrix functionality with grammar-based rule processing. This allows for intelligent operation selection and preprocessing based on input data characteristics and execution context.
Unlike pipelines that execute operations in sequence, the grammar-aware matrix can dynamically select which operations to apply based on the current data and context, making it suitable for adaptive and conditional processing workflows.
Definition at line 436 of file ComputePipeline.hpp.