Represents a (hierarchical) property map. More...
#include <KEYPropertyMap.h>
Public Member Functions | |
KEYPropertyMap () | |
Construct an empty map. More... | |
KEYPropertyMap (const KEYPropertyMap *parent) | |
Construct an empty map with parent parent . More... | |
KEYPropertyMap (const KEYPropertyMap &other) | |
Construct a map as a copy of existing one. More... | |
KEYPropertyMap & | operator= (const KEYPropertyMap &other) |
Assign the content from another map. More... | |
void | swap (KEYPropertyMap &other) |
Swap the content with another map. More... | |
void | setParent (const KEYPropertyMap *parent) |
Set a new parent for this map. More... | |
boost::any | get (const std::string &key, bool lookInParent=false) const |
Retrieve value associated with key . More... | |
void | set (const std::string &key, const boost::any &value) |
Set a new value for key . More... | |
Private Types | |
typedef boost::unordered_map < std::string, boost::any > | Map_t |
Private Attributes | |
Map_t | m_map |
const KEYPropertyMap * | m_parent |
Represents a (hierarchical) property map.
|
private |
libetonyek::KEYPropertyMap::KEYPropertyMap | ( | ) |
Construct an empty map.
|
explicit |
Construct an empty map with parent parent
.
libetonyek::KEYPropertyMap::KEYPropertyMap | ( | const KEYPropertyMap & | other | ) |
Construct a map as a copy of existing one.
boost::any libetonyek::KEYPropertyMap::get | ( | const std::string & | key, |
bool | lookInParent = false |
||
) | const |
Retrieve value associated with key
.
If the value is not found in this map and lookInParent
is true
, the parent map is searched (transitively).
Referenced by get(), and libetonyek::KEYStyleBase::lookup().
KEYPropertyMap & libetonyek::KEYPropertyMap::operator= | ( | const KEYPropertyMap & | other | ) |
Assign the content from another map.
void libetonyek::KEYPropertyMap::set | ( | const std::string & | key, |
const boost::any & | value | ||
) |
Set a new value for key .
Referenced by libetonyek::KEY2StyleParser::parsePropertyImpl().
void libetonyek::KEYPropertyMap::setParent | ( | const KEYPropertyMap * | parent | ) |
Set a new parent for this map.
Referenced by libetonyek::KEYStyleBase::link().
void libetonyek::KEYPropertyMap::swap | ( | KEYPropertyMap & | other | ) |
|
private |
Referenced by get(), setParent(), and swap().