|
MayaFlux 0.4.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 | |
| 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. | |
| template<ComputeData InputType> | |
| Datum< InputType > | execute_with_grammar (const Datum< InputType > &input, const ExecutionContext &context={}) |
| Execute operations with grammar rule pre-processing. | |
| template<ComputeData InputType> | |
| Datum< InputType > | execute_with_grammar (const std::string &rule_name, const Datum< InputType > &input, const ExecutionContext &context={}) |
| Execute a named grammar rule explicitly by name. | |
| std::shared_ptr< ComputationGrammar > | get_grammar () const |
| Get the grammar instance. | |
| GrammarAwareComputeMatrix (std::shared_ptr< ComputationGrammar > grammar=nullptr) | |
| Constructor with optional grammar. | |
| void | set_grammar (std::shared_ptr< ComputationGrammar > grammar) |
| Set grammar instance. | |
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. | |
| void | clear_operations () |
| Clear all operations from this matrix. | |
| ComputeMatrix ()=default | |
| 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. | |
| void | drain_async () |
| Block until all in-flight async chains complete. | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType = InputType, typename... Args> | |
| std::optional< Datum< OutputType > > | execute (const Datum< InputType > &input, Args &&... args) |
| Execute an operation by creating a new instance. | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType = InputType, typename... Args> | |
| std::future< std::optional< Datum< OutputType > > > | execute_async (const Datum< InputType > &input, Args &&... args) |
| Execute operation asynchronously. | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType = InputType, typename... Args> | |
| std::vector< std::optional< Datum< OutputType > > > | execute_batch (const std::vector< Datum< InputType > > &inputs, Args &&... args) |
| Execute operation on multiple inputs. | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType = InputType, typename... Args> | |
| std::vector< std::optional< Datum< OutputType > > > | execute_batch_parallel (const std::vector< Datum< InputType > > &inputs, Args &&... args) |
| Execute operation on multiple inputs in parallel. | |
| template<typename FirstOp , typename SecondOp , ComputeData InputType, ComputeData IntermediateType, ComputeData OutputType> | |
| std::optional< Datum< OutputType > > | execute_chain (const Datum< InputType > &input) |
| Execute operations in sequence (type-safe chain) | |
| template<typename FirstOp , typename SecondOp , ComputeData InputType, ComputeData IntermediateType, ComputeData OutputType> | |
| std::optional< Datum< OutputType > > | execute_chain_named (const std::string &first_name, const std::string &second_name, const Datum< InputType > &input) |
| Execute named operations in sequence. | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType = InputType> | |
| std::optional< Datum< OutputType > > | execute_named (const std::string &name, const Datum< InputType > &input) |
| Execute a named operation from the pool. | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType = InputType> | |
| std::future< std::optional< Datum< OutputType > > > | execute_named_async (const std::string &name, const Datum< InputType > &input) |
| Execute named operation asynchronously. | |
| template<ComputeData InputType, typename... OpClasses> | |
| auto | execute_parallel (const Datum< InputType > &input) |
| Execute multiple operations in parallel. | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType = InputType> | |
| std::vector< std::optional< Datum< OutputType > > > | execute_parallel_named (const std::vector< std::string > &names, const Datum< InputType > &input) |
| Execute multiple named operations in parallel. | |
| template<typename OpClass , ComputeData InputType, ComputeData OutputType = InputType> | |
| std::optional< Datum< OutputType > > | execute_with (std::shared_ptr< OpClass > operation, const Datum< InputType > &input) |
| Execute with provided operation instance. | |
| ExecutionPolicy | get_execution_policy () const |
| Get current execution policy. | |
| std::string | get_last_error () const |
| Get last error message. | |
| template<typename OpClass > | |
| std::shared_ptr< OpClass > | get_operation (const std::string &name) |
| Get a named operation from this matrix. | |
| std::unordered_map< std::string, std::any > | get_statistics () const |
| Get execution statistics. | |
| std::vector< std::string > | list_operations () const |
| List all operation names in this matrix. | |
| bool | remove_operation (const std::string &name) |
| Remove a named operation from this matrix. | |
| 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. | |
| void | set_error_callback (std::function< void(const std::exception &, const std::type_index &)> callback) |
| Set error callback. | |
| void | set_execution_policy (ExecutionPolicy policy) |
| Set execution policy for this matrix. | |
| void | set_profiling (bool enabled) |
| Enable/disable execution profiling. | |
| template<ComputeData StartType> | |
| FluentExecutor< ComputeMatrix, StartType > | with (const Datum< StartType > &input) |
| Create a fluent executor for chaining operations. | |
| template<ComputeData StartType> | |
| FluentExecutor< ComputeMatrix, StartType > | with (const StartType &input) |
| template<ComputeData StartType> | |
| FluentExecutor< ComputeMatrix, StartType > | with (Datum< StartType > &&input) |
| Create a fluent executor with move semantics. | |
| template<ComputeData StartType> | |
| FluentExecutor< ComputeMatrix, StartType > | with (StartType &&input) |
| template<ComputeData StartType, typename ChainFunc , typename CompleteFn > | |
| void | with_async (Datum< StartType > input, ChainFunc &&chain, CompleteFn &&on_complete) |
| Execute an operation chain asynchronously. | |
| template<ComputeData StartType, typename ChainFunc , typename CompleteFn > | |
| void | with_async (StartType input, ChainFunc &&chain, CompleteFn &&on_complete) |
| ~ComputeMatrix () | |
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 445 of file ComputePipeline.hpp.