MayaFlux 0.1.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 324 of file Region.hpp.

325 {
326 auto it = attributes.find(key);
327 if (it == attributes.end()) {
328 return std::nullopt;
329 }
330
331 return safe_any_cast<T>(it->second);
332 }
std::unordered_map< std::string, std::any > attributes
Flexible key-value store for region-specific attributes.
Definition Region.hpp:75

Referenced by MayaFlux::Yantra::infer_from_region(), and MayaFlux::Kakshya::RegionGroup::sort_by_attribute().

+ Here is the caller graph for this function: