|
MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
|
Fluent interface for chaining operations on any executor. More...
#include <OperationChain.hpp>
Collaboration diagram for MayaFlux::Yantra::FluentExecutor< Executor, DataType >:Public Types | |
| using | executor_type = Executor |
| using | data_type = DataType |
Public Member Functions | |
| FluentExecutor (std::shared_ptr< Executor > executor, const DataType &input) | |
| Construct with executor and initial data. | |
| FluentExecutor (std::shared_ptr< Executor > executor, DataType &&input) | |
| Move constructor for efficiency. | |
| template<typename OpClass , ComputeData OutputType = DataType> | |
| FluentExecutor< Executor, OutputType > | then () |
| Chain operation execution by type. | |
| template<typename OpClass , ComputeData OutputType = DataType> | |
| FluentExecutor< Executor, OutputType > | then (const std::string &name) |
| Chain named operation. | |
| template<typename Func > requires std::invocable<Func, const DataType&> | |
| auto | apply (Func &&func) |
| Apply custom transformation function. | |
| template<typename Func > requires std::invocable<Func, DataType&> | |
| FluentExecutor & | tap (Func &&func) |
| Apply function with side effects (doesn't change data type) | |
| template<typename OpClass > | |
| FluentExecutor & | when (bool condition) |
| Conditional execution. | |
| template<typename OpClass , typename Pred > requires std::predicate<Pred, const DataType&> | |
| FluentExecutor & | when (Pred &&predicate) |
| Conditional execution with predicate. | |
| template<typename... OpClasses> | |
| auto | fork () |
| Fork execution into multiple paths. | |
| const DataType & | get () const |
| Get the final result. | |
| DataType & | get_mutable () |
| Get mutable reference to the result. | |
| DataType | consume () && |
| Move the result out. | |
| IO< DataType > | to_io () const |
| Extract to IO wrapper with metadata. | |
| DataType | get_or (const DataType &default_value) const |
| Get or provide default value. | |
| template<typename Generator > requires std::invocable<Generator> | |
| DataType | get_or_else (Generator &&generator) const |
| Get or compute default value. | |
| bool | is_successful () const |
| Check if all operations succeeded. | |
| const std::vector< std::string > & | get_history () const |
| Get operation history. | |
| const std::vector< std::string > & | get_errors () const |
| Get accumulated errors. | |
| std::shared_ptr< Executor > | get_executor () const |
| Get the executor. | |
| FluentExecutor & | reset (const DataType &new_data) |
| Reset with new data. | |
Private Member Functions | |
| void | record_error (const std::string &error) |
Private Attributes | |
| std::shared_ptr< Executor > | m_executor |
| DataType | m_data |
| bool | m_successful |
| std::vector< std::string > | m_operation_history |
| std::vector< std::string > | m_errors |
Fluent interface for chaining operations on any executor.
Provides a composable, type-safe way to chain operations together. This class is executor-agnostic and can work with any type that satisfies the ExecutorConcept.
Key Features:
Usage:
Definition at line 41 of file OperationChain.hpp.