A data structure storing "any" by name, to reduce coupling. More...
#include <osvr/Util/AnyMap.h>
Public Member Functions | |
| bool | contains (std::string const &key) const |
| Do we have data under this key? More... | |
| bool | contains (const char *key) const |
| boost::any | get (std::string const &key) const |
| Get the data for this key. More... | |
| boost::any | get (const char *key) const |
| void | erase (std::string const &key) |
| Clears the data for this key. More... | |
| void | erase (const char *key) |
| void | set (std::string const &key, boost::any const &value) |
| Set data for the given key. More... | |
| void | set (const char *key, boost::any const &value) |
| template<typename T > | |
| void | set (std::string const &key, T value) |
| template<typename T > | |
| void | set (const char *key, T value) |
| bool osvr::util::AnyMap::contains | ( | std::string const & | key | ) | const |
Do we have data under this key?
All the const char * overloads are in case we change the internal representation to something that works faster with string literals.
Definition at line 38 of file AnyMap.cpp.
| bool osvr::util::AnyMap::contains | ( | const char * | key | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 42 of file AnyMap.cpp.
| void osvr::util::AnyMap::set | ( | std::string const & | key, |
| boost::any const & | value | ||
| ) |
Set data for the given key.
Silently overwrites existing data at that key.
Definition at line 46 of file AnyMap.cpp.
| boost::any osvr::util::AnyMap::get | ( | std::string const & | key | ) | const |
Get the data for this key.
Returns an empty boost::any if the key doesn't exist.
Definition at line 54 of file AnyMap.cpp.
| boost::any osvr::util::AnyMap::get | ( | const char * | key | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 62 of file AnyMap.cpp.
| void osvr::util::AnyMap::erase | ( | std::string const & | key | ) |
Clears the data for this key.
If the key doesn't exist, this method does nothing
Definition at line 66 of file AnyMap.cpp.
| void osvr::util::AnyMap::erase | ( | const char * | key | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 73 of file AnyMap.cpp.