IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
DataItemMap.h
1 // DataItemMap.h:
3 // --------------
4 //
14 
15 #ifndef __IPSDKBASEDATA_DATAITEMMAP_H__
16 #define __IPSDKBASEDATA_DATAITEMMAP_H__
17 
18 // suppression warnings
19 // warning C4251: 'ipsdk::DataItemMap::_itemMap' : class 'std::map<_Kty,_Ty>' needs to have dll-interface to be used by clients of class 'ipsdk::DataItemMap'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
23 #include <IPSDKBaseData/DataItem/BaseDataItem.h>
24 #include <map>
25 
26 namespace ipsdk {
27 
30 
32 {
33  // declare serial class
35 
36 // predefined public types
37 public:
40  static const bool g_bIsColl = false;
41  static const bool g_bNode = true;
42  static const bool g_bLeaf = true;
43  static const eDataItemType::domain g_itemType = eDataItemType::eDIT_Map;
45 
47  typedef std::map<std::string, DataItemPtr> MapType;
48 
49 public:
52  DataItemMap();
53  ~DataItemMap();
55 
56 // methods
57 public:
59  eDataItemType getDataItemType() const;
60 
62  const MapType& getMap() const;
63 
65  ItemNames getItemNames() const;
66 
68  bool isEmpty() const;
69 
71  ipUInt32 getSize() const;
72 
74  bool existsItem(const std::string& itemName) const;
75 
80  const BaseDataItem& getItem(const std::string& itemName) const;
81  BaseDataItem& getItem(const std::string& itemName);
83 
88  DataItemConstPtr getItemPtr(const std::string& itemName) const;
89  DataItemPtr getItemPtr(const std::string& itemName);
91 
97  void insertItem(const std::string& itemName,
98  const DataItemPtr& pItem);
99 
103  void removeItem(const std::string& itemName);
104 
106  void clear();
107 
108 // attributes
109 protected:
112 };
113 
116 
117 inline eDataItemType
119 {
120  return g_itemType;
121 }
122 
123 inline const DataItemMap::MapType&
125 {
126  return _itemMap;
127 }
128 
131 
132 } // end of namespace ipsdk
133 
134 #pragma warning (pop)
135 
136 #endif // __IPSDKBASEDATA_DATAITEMMAP_H__
#define IPSDK_DECLARE_SERIAL_WITH_COPY(libraryName, className)
macro enabling serialization on class
Definition: SerializationHdrMacro.h:73
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
std::map< std::string, DataItemPtr > MapType
map type associated to object
Definition: DataItemMap.h:47
boost::shared_ptr< const BaseDataItem > DataItemConstPtr
shared pointer to const DataItem
Definition: DataItemTypes.h:149
Class used to store a variable collection of heterogeneous nodes.
Definition: DataItemMap.h:31
eDataItemType getDataItemType() const
retrieve data item type
Definition: DataItemMap.h:118
Definition: DataItemTypes.h:59
const MapType & getMap() const
retrieve map associated to object
Definition: DataItemMap.h:124
boost::shared_ptr< BaseDataItem > DataItemPtr
shared pointer to DataItem
Definition: DataItemTypes.h:146
std::set< std::string > ItemNames
collection of names or ids for items
Definition: DataItemTypes.h:143
MapType _itemMap
collection of named data items associated to object
Definition: DataItemMap.h:111
#define IPSDKBASEDATA_API
Import/Export macro for library IPSDKUtil.
Definition: IPSDKBaseDataExports.h:27
Base class for data items.
Definition: BaseDataItem.h:27
static const eDataItemType::domain g_itemType
flags indicating item type
Definition: DataItemMap.h:43
boost::enable_if< typename boost::mpl::and_< typename boost::is_same< boost::mpl::int_< AttributeType::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_DataItem > >::type, typename boost::is_same< boost::mpl::int_< LeafCollType::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_LeafColl > >::type >::type, RulePtr >::type isEmpty(const boost::shared_ptr< AttributeType > &pAttribute)
functions allowing to check that a leaf collection is empty
Definition: LeafCollSizeRuleOperators.h:65
eDataItemType
Enumerate describing data items type.
Definition: DataItemTypes.h:43
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53