OSSIA
Open Scenario System for Interactive Application
any_map.hpp File Reference

Go to the source code of this file.

Namespaces

 ossia
 

Typedefs

using ossia::any_map = string_map< ossia::any >
 A container to store any kind of data indexed by a string.
 
using ossia::extended_attributes = any_map
 

Functions

template<typename T >
auto ossia::get_attribute (const any_map &e, std::string_view name)
 get_attribute Get an attribute of an any_map. More...
 
template<typename T >
std::optional< T > ossia::get_optional_attribute (const any_map &e, std::string_view name)
 get_optional_attribute Maybe get an attribute of an any_map. More...
 
void ossia::unset_attribute (any_map &e, std::string_view str)
 Remove an attribute.
 
template<typename T >
void ossia::set_attribute (any_map &e, std::string_view str, const T &val)
 Sets an attribute in an any_map.
 
bool ossia::has_attribute (const any_map &e, std::string_view str) noexcept
 Checks if an attribute is present.
 
void ossia::set_attribute (any_map &e, std::string_view str)
 Sets a bool-like attribute. It should be checked for with has_attribute.
 
template<typename T >
void ossia::set_attribute (any_map &e, std::string_view str, T &&val)
 Sets an attribute in an any_map.
 
void ossia::set_attribute (any_map &e, std::string_view str, std::nullopt_t)
 Removes an attribute in an any_map.
 
template<typename T >
void ossia::set_optional_attribute (any_map &e, std::string_view str, const std::optional< T > &opt)
 Sets an attribute if opt has a value, else remove the attribute.
 
template<typename T >
void ossia::set_optional_attribute (any_map &e, std::string_view str, std::optional< T > &&opt)