The chain keeps its data, container and type. The operation's output metadata is merged into the chain's, and its output data is stored in the metadata under the operation's type name.
247 {
248 using OutputType = typename detail::datum_data<typename OpClass::output_type>::type;
249
251 error<std::runtime_error>(
253 std::source_location::current(),
254 "Cannot continue chain after failed operation");
255 }
256
257 const std::string key =
typeid(OpClass).
name();
258 try {
259 auto result =
m_executor->template execute<OpClass, DataType, OutputType>(
m_data);
260 if (!result) {
263 error<std::runtime_error>(
265 std::source_location::current(),
266 "Operation failed in fluent chain: {}", key);
267 }
268
269 auto next = FluentExecutor<Executor, DataType>(
m_executor,
absorbed(std::move(*result), key));
271 next.m_operation_history.push_back(key);
272 return next;
273 } catch (const std::exception& e) {
278 std::source_location::current(),
279 "Exception in fluent chain: " + std::string(e.what()));
280 }
281 }
void record_error(const std::string &err)
std::shared_ptr< Executor > m_executor
Datum< DataType > absorbed(Datum< OutputType > &&result, const std::string &key) const
The current Datum with result's metadata merged in and its data stored under key.
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.