39 return (m_contents.count(key) == 1);
46 void AnyMap::set(std::string
const &key, boost::any
const &value) {
47 m_contents.insert(std::make_pair(key, value));
50 void AnyMap::set(
const char *key, boost::any
const &value) {
51 set(std::string(key), value);
55 Contents::const_iterator location = m_contents.find(key);
56 if (location == m_contents.end()) {
59 return location->second;
63 return get(std::string(key));
67 Contents::iterator location = m_contents.find(key);
68 if (location != m_contents.end()) {
69 m_contents.erase(location);
void erase(std::string const &key)
Clears the data for this key.
void set(std::string const &key, boost::any const &value)
Set data for the given key.
Header declaring the osvr::util::AnyMap structure.
boost::any get(std::string const &key) const
Get the data for this key.
bool contains(std::string const &key) const
Do we have data under this key?