Chain an anonymous operation instance by type.
155 {
157 error<std::runtime_error>(
159 std::source_location::current(),
160 "Cannot continue chain after failed operation");
161 }
162
163 try {
164 auto result =
m_executor->template execute<OpClass, DataType, OutputType>(
m_data);
165 if (!result) {
167 record_error(
"Operation " + std::string(
typeid(OpClass).
name()) +
" failed");
168 error<std::runtime_error>(
170 std::source_location::current(),
171 "Operation failed in fluent chain: {}", std::string(
typeid(OpClass).
name()));
172 }
173
174 auto next = FluentExecutor<Executor, OutputType>(
m_executor, std::move(*result));
176 next.m_operation_history.push_back(
typeid(OpClass).
name());
177 return next;
178 } catch (const std::exception& e) {
183 std::source_location::current(),
184 "Exception in fluent chain: " + std::string(e.what()));
185 }
186 }
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.