libetonyek::KEYPropertyMap Class Reference

Represents a (hierarchical) property map. More...

#include <KEYPropertyMap.h>

List of all members.

Public Member Functions

 KEYPropertyMap ()
 Construct an empty map.
 KEYPropertyMap (const KEYPropertyMap *parent)
 Construct an empty map with parent parent.
 KEYPropertyMap (const KEYPropertyMap &other)
 Construct a map as a copy of existing one.
KEYPropertyMapoperator= (const KEYPropertyMap &other)
 Assign the content from another map.
void swap (KEYPropertyMap &other)
 Swap the content with another map.
void setParent (const KEYPropertyMap *parent)
 Set a new parent for this map.
boost::any get (const std::string &key, bool lookInParent=false) const
 Retrieve value associated with key.
void set (const std::string &key, const boost::any &value)
 Set a new value for key .

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

Construct an empty map.

Construct an empty map with parent parent.

  • [in] parent the parent of this map

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

Set a new parent for this map.

  • [in] parent the new parent

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

Swap the content with another map.

  • [inout] the other map

Referenced by operator=().


Member Data Documentation

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


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