10 #ifndef IWORKPROPERTYMAP_H_INCLUDED 11 #define IWORKPROPERTYMAP_H_INCLUDED 13 #include <unordered_map> 15 #include <boost/any.hpp> 30 typedef std::unordered_map<IWORKPropertyID_t, boost::any>
Map_t;
77 template<
class Property>
78 bool has(
bool lookInParent =
false)
const 81 if (
m_map.end() != it)
82 return !it->second.empty();
90 template<
class Property>
91 bool clears(
bool lookInParent =
false)
const 94 if (
m_map.end() != it)
95 return it->second.empty();
112 template<
class Property>
116 if (
m_map.end() != it)
118 if (!it->second.empty())
133 template<
class Property>
144 template<
class Property>
157 #endif // IWORKPROPERTYMAP_H_INCLUDED Definition: IWORKBezierElement.cpp:18
const IWORKPropertyMap * m_parent
Definition: IWORKPropertyMap.h:152
void setParent(const IWORKPropertyMap *parent)
Set a new parent for this map.
Definition: IWORKPropertyMap.cpp:47
Represents a (hierarchical) property map.
Definition: IWORKPropertyMap.h:24
void clear()
Clear property.
Definition: IWORKPropertyMap.h:145
void swap(IWORKPropertyMap &other)
Swap the content with another map.
Definition: IWORKPropertyMap.cpp:40
const IWORKPropertyInfo< Property >::ValueType & get(bool lookInParent=false) const
Retrieve the value of a property.
Definition: IWORKPropertyMap.h:113
Definition: IWORKPropertyMap.h:27
Definition: IWORKPropertyInfo.h:21
IWORKPropertyMap()
Construct an empty map.
Definition: IWORKPropertyMap.cpp:15
Map_t m_map
Definition: IWORKPropertyMap.h:151
std::unordered_map< IWORKPropertyID_t, boost::any > Map_t
Definition: IWORKPropertyMap.h:30
IWORKPropertyMap & operator=(const IWORKPropertyMap &other)
Assign the content from another map.
Definition: IWORKPropertyMap.cpp:33
bool has(bool lookInParent=false) const
Check for the presence of a property.
Definition: IWORKPropertyMap.h:78
bool clears(bool lookInParent=false) const
Definition: IWORKPropertyMap.h:91
void put(const typename IWORKPropertyInfo< Property >::ValueType &value)
Insert a new value for key key.
Definition: IWORKPropertyMap.h:134