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

◆ get_attribute()

template<typename T >
std::optional< T > MayaFlux::Kakshya::Region::get_attribute ( const std::string &  key) const
inline

Get an attribute value by key, with type conversion support.

Template Parameters
TThe expected type.
Parameters
keyThe attribute key.
Returns
Optional value if present and convertible.

Definition at line 330 of file Region.hpp.

331 {
332 auto it = attributes.find(key);
333 if (it == attributes.end()) {
334 return std::nullopt;
335 }
336
337 return safe_any_cast<T>(it->second);
338 }
std::unordered_map< std::string, std::any > attributes
Flexible key-value store for region-specific attributes.
Definition Region.hpp:81

Referenced by MayaFlux::Yantra::infer_from_region().

+ Here is the caller graph for this function: