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())
119 return boost::any_cast<const typename IWORKPropertyInfo<Property>::ValueType &>(it->second);
133 template<
class Property>
144 template<
class Property>
Definition IWORKPropertyMap.h:27
Represents a (hierarchical) property map.
Definition IWORKPropertyMap.h:25
bool has(bool lookInParent=false) const
Check for the presence of a property.
Definition IWORKPropertyMap.h:78
std::unordered_map< IWORKPropertyID_t, boost::any > Map_t
Definition IWORKPropertyMap.h:30
Map_t m_map
Definition IWORKPropertyMap.h:151
IWORKPropertyMap & operator=(const IWORKPropertyMap &other)
Assign the content from another map.
Definition IWORKPropertyMap.cpp:33
void put(const typename IWORKPropertyInfo< Property >::ValueType &value)
Insert a new value for key key.
Definition IWORKPropertyMap.h:134
const IWORKPropertyMap * m_parent
Definition IWORKPropertyMap.h:152
void setParent(const IWORKPropertyMap *parent)
Set a new parent for this map.
Definition IWORKPropertyMap.cpp:47
IWORKPropertyMap()
Construct an empty map.
Definition IWORKPropertyMap.cpp:15
void clear()
Clear property.
Definition IWORKPropertyMap.h:145
const IWORKPropertyInfo< Property >::ValueType & get(bool lookInParent=false) const
Retrieve the value of a property.
Definition IWORKPropertyMap.h:113
bool clears(bool lookInParent=false) const
Definition IWORKPropertyMap.h:91
void swap(IWORKPropertyMap &other)
Swap the content with another map.
Definition IWORKPropertyMap.cpp:40
@ value
Definition IWORKToken.h:631
Definition IWORKBezierElement.cpp:21
Definition IWORKPropertyInfo.h:22