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

◆ get_or_throw()

template<typename T >
T MayaFlux::Yantra::ExecutionContext::get_or_throw ( const std::string &  key) const
inline

Retrieve metadata value or throw if unavailable.

Uses safe_any_cast_or_throw.

Template Parameters
TExpected type
Parameters
keyMetadata key
Returns
Retrieved value
Exceptions
std::runtime_errorif key missing or conversion fails

Definition at line 247 of file ExecutionContext.hpp.

248 {
249 auto it = execution_metadata.find(key);
250
251 if (it == execution_metadata.end())
252 error<std::runtime_error>(Journal::Component::Yantra, Journal::Context::Runtime, std::source_location::current(), "ExecutionContext missing key: {}", key);
253
254 return safe_any_cast_or_throw<T>(it->second);
255 }
@ Runtime
General runtime operations (default fallback)
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.
std::unordered_map< std::string, std::any > execution_metadata
Arbitrary metadata parameters used by operations.

References MayaFlux::Journal::Runtime, and MayaFlux::Journal::Yantra.