KEYPropertyMap.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  * This file is part of the libetonyek project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #ifndef KEYPROPERTYMAP_H_INCLUDED
11 #define KEYPROPERTYMAP_H_INCLUDED
12 
13 #include <boost/any.hpp>
14 #include <boost/unordered_map.hpp>
15 
16 namespace libetonyek
17 {
18 
22 {
23  typedef boost::unordered_map<std::string, boost::any> Map_t;
24 
25 public:
29 
34  explicit KEYPropertyMap(const KEYPropertyMap *parent);
35 
40  KEYPropertyMap(const KEYPropertyMap &other);
41 
48 
53  void swap(KEYPropertyMap &other);
54 
59  void setParent(const KEYPropertyMap *parent);
60 
71  boost::any get(const std::string &key, bool lookInParent = false) const;
72 
78  void set(const std::string &key, const boost::any &value);
79 
80 private:
83 };
84 
85 }
86 
87 #endif // KEYPROPERTYMAP_H_INCLUDED
88 
89 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Represents a (hierarchical) property map.
Definition: KEYPropertyMap.h:21
void setParent(const KEYPropertyMap *parent)
Set a new parent for this map.
Definition: KEYPropertyMap.cpp:47
Definition: KEY2Token.h:886
boost::unordered_map< std::string, boost::any > Map_t
Definition: KEYPropertyMap.h:23
Map_t m_map
Definition: KEYPropertyMap.h:81
const KEYPropertyMap * m_parent
Definition: KEYPropertyMap.h:82
void set(const std::string &key, const boost::any &value)
Set a new value for key .
Definition: KEYPropertyMap.cpp:64
void swap(KEYPropertyMap &other)
Swap the content with another map.
Definition: KEYPropertyMap.cpp:40
Definition: KEY1Token.h:121
Definition: KEY1Token.h:75
KEYPropertyMap()
Construct an empty map.
Definition: KEYPropertyMap.cpp:15
KEYPropertyMap & operator=(const KEYPropertyMap &other)
Assign the content from another map.
Definition: KEYPropertyMap.cpp:33

Generated for libetonyek by doxygen 1.8.5