Chain an anonymous operation instance by type.
129 {
131 error<std::runtime_error>(
133 std::source_location::current(),
134 "Cannot continue chain after failed operation");
135 }
136
137 try {
138 auto result =
m_executor->template execute<OpClass, DataType, OutputType>(
m_data);
139 if (!result) {
141 record_error(
"Operation " + std::string(
typeid(OpClass).name()) +
" failed");
142 error<std::runtime_error>(
144 std::source_location::current(),
145 "Operation failed in fluent chain: {}", std::string(typeid(OpClass).name()));
146 }
147
148 auto next = FluentExecutor<Executor, OutputType>(
m_executor, std::move(*result));
150 next.m_operation_history.push_back(typeid(OpClass).name());
151 return next;
152 } catch (const std::exception& e) {
157 std::source_location::current(),
158 "Exception in fluent chain: " + std::string(e.what()));
159 }
160 }
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.