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

◆ get()

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

Retrieve metadata value using safe casting.

Uses safe_any_cast internally, allowing numeric conversions and providing detailed error reporting.

Template Parameters
TExpected type
Parameters
keyMetadata key
Returns
CastResult containing the value or error details

Definition at line 150 of file ExecutionContext.hpp.

151 {
152 auto it = execution_metadata.find(key);
153
154 if (it == execution_metadata.end()) {
155 CastResult<T> result;
156 result.error = "ExecutionContext missing key: " + key;
157 return result;
158 }
159
160 return safe_any_cast<T>(it->second);
161 }
std::unordered_map< std::string, std::any > execution_metadata
Arbitrary metadata parameters used by operations.