MayaFlux 0.4.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 194 of file ExecutionContext.hpp.

195 {
196 auto it = execution_metadata.find(key);
197
198 if (it == execution_metadata.end())
199 error<std::runtime_error>(Journal::Component::Yantra, Journal::Context::Runtime, std::source_location::current(), "ExecutionContext missing key: {}", key);
200
201 return safe_any_cast_or_throw<T>(it->second);
202 }
@ 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.