MayaFlux 1.0.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 259 of file ExecutionContext.hpp.

260 {
261 auto it = execution_metadata.find(key);
262
263 if (it == execution_metadata.end())
264 error<std::runtime_error>(Journal::Component::Yantra, Journal::Context::Runtime, std::source_location::current(), "ExecutionContext missing key: {}", key);
265
266 return safe_any_cast_or_throw<T>(it->second);
267 }
@ 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.