libetonyek::KEYPropertyMap Class Reference

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...
 
KEYPropertyMapoperator= (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 KEYPropertyMapm_parent
 

Detailed Description

Represents a (hierarchical) property map.

Member Typedef Documentation

typedef boost::unordered_map<std::string, boost::any> libetonyek::KEYPropertyMap::Map_t
private

Constructor & Destructor Documentation

libetonyek::KEYPropertyMap::KEYPropertyMap ( )

Construct an empty map.

libetonyek::KEYPropertyMap::KEYPropertyMap ( const KEYPropertyMap parent)
explicit

Construct an empty map with parent parent.

  • [in] parent the parent of this map
libetonyek::KEYPropertyMap::KEYPropertyMap ( const KEYPropertyMap other)

Construct a map as a copy of existing one.

  • [in] other the original

Member Function Documentation

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).

  • [in] key the search key
  • [in] lookInParent should the parent map be searched if the key is not found in this map?
    Returns
    the found value or empty value

Referenced by get(), and libetonyek::KEYStyleBase::lookup().

KEYPropertyMap & libetonyek::KEYPropertyMap::operator= ( const KEYPropertyMap other)

Assign the content from another map.

  • [in] other the source map
    Returns
    this map
void libetonyek::KEYPropertyMap::set ( const std::string &  key,
const boost::any &  value 
)

Set a new value for key .

  • [in] key the key
  • [in] value the value to set

Referenced by libetonyek::KEY2StyleParser::parsePropertyImpl().

void libetonyek::KEYPropertyMap::setParent ( const KEYPropertyMap parent)

Set a new parent for this map.

  • [in] parent the new parent

Referenced by libetonyek::KEYStyleBase::link().

void libetonyek::KEYPropertyMap::swap ( KEYPropertyMap other)

Swap the content with another map.

  • [inout] the other map

Referenced by operator=().

Member Data Documentation

Map_t libetonyek::KEYPropertyMap::m_map
private

Referenced by get(), set(), and swap().

const KEYPropertyMap* libetonyek::KEYPropertyMap::m_parent
private

Referenced by get(), setParent(), and swap().


The documentation for this class was generated from the following files:

Generated for libetonyek by doxygen 1.8.5