MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ then() [3/4]

template<typename Executor , ComputeData DataType>
template<typename OpClass , ComputeData OutputType = DataType>
requires (!FunctionalOperationOn<OpClass, DataType>)
FluentExecutor< Executor, OutputType > MayaFlux::Yantra::FluentExecutor< Executor, DataType >::then ( const std::string &  name)
inline

Chain a named operation fetched from the executor's pool.

Retrieves the pre-configured operation instance registered under name and executes it on the current Datum. The full Datum is passed through, preserving container and metadata.

Template Parameters
OpClassOperation class type
OutputTypeExpected output type (defaults to current DataType)
Parameters
nameName of the operation in the pool
Returns
New FluentExecutor carrying the result Datum

Definition at line 202 of file OperationChain.hpp.

203 {
204 if (!m_successful) {
205 error<std::runtime_error>(
207 std::source_location::current(),
208 "Cannot continue chain after failed operation: {}", name);
209 }
210
211 try {
212 auto result = m_executor->template execute_named<OpClass, DataType, OutputType>(name, m_data);
213 if (!result) {
214 m_successful = false;
215 record_error("Named operation '" + name + "' failed");
216 error<std::runtime_error>(
218 std::source_location::current(),
219 "Named operation failed in fluent chain: {}", name);
220 }
221
222 auto next = FluentExecutor<Executor, OutputType>(m_executor, std::move(*result));
223 next.m_operation_history = m_operation_history;
224 next.m_operation_history.push_back(name);
225 return next;
226 } catch (const std::exception& e) {
227 m_successful = false;
228 record_error(e.what());
231 std::source_location::current(),
232 "Exception in named operation '{}': {}", name, e.what());
233 }
234 }
std::string name
Definition VKDevice.cpp:123
void record_error(const std::string &err)
std::shared_ptr< Executor > m_executor
std::vector< std::string > m_operation_history
@ ComputeMatrix
Compute operations (Yantra - algorithms, matrices, DSP)
void error_rethrow(Component component, Context context, std::source_location location=std::source_location::current(), std::string_view additional_context="")
Catch and log an exception, then rethrow it.
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.

References name.