IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
DataItemLeafColl.h
1 // DataItemLeafColl.h:
3 // -------------------
4 //
14 
15 #ifndef __IPSDKBASEDATA_DATAITEMLEAFCOLL_H__
16 #define __IPSDKBASEDATA_DATAITEMLEAFCOLL_H__
17 
18 // suppression of warnings
19 // warning C4251: 'ipsdk::DataItemLeafColl<T>::_coll' : class 'std::vector<_Ty,_Ax>' needs to have dll-interface to be used by clients of class 'ipsdk::DataItemLeafColl<T>'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
23 #include <IPSDKBaseData/DataItem/LeafColl/BaseDataItemLeafColl.h>
25 
26 namespace ipsdk {
27 
30 
31 template <typename T>
32 class IPSDKBASEDATA_API DataItemLeafColl : public BaseDataItemLeafColl
33 {
34  // declare serial class
35  IPSDK_DECLARE_SERIAL_WITH_COPY(IPSDKBaseData, DataItemLeafColl);
36 
37 // predefined public types
38 public:
40  typedef T ValueType;
41 
43  static const eDataItemValueType::domain g_dataItemValueType = DataItemValueType2Enum<T>::g_enumValue;
44 
46  typedef std::vector<T> CollType;
47 
48 public:
54 
55 // methods
56 public:
59  {
60  return g_dataItemValueType;
61  }
62 
65  const CollType& getColl() const
66  {
67  return _coll;
68  }
70  {
71  return _coll;
72  }
74 
76  bool isEmpty() const
77  {
78  return _coll.empty();
79  }
80 
82  ipUInt32 getSize() const
83  {
84  return static_cast<ipUInt32>(_coll.size());
85  }
86 
88  void push_back(const ValueType& value)
89  {
90  _coll.push_back(value);
91  }
92 
94  void clear()
95  {
96  return _coll.clear();
97  }
98 
99 // attributes
100 protected:
103 };
104 
107 
108 } // end of namespace ipsdk
109 
110 #endif // __IPSDKBASEDATA_DATAITEMLEAFCOLL_H__
Template class for collection of data item leafs.
Definition: DataItemTypes.h:31
#define IPSDK_DECLARE_SERIAL_WITH_COPY(libraryName, className)
macro enabling serialization on class
Definition: SerializationHdrMacro.h:73
CollType _coll
collection of data associated to object
Definition: DataItemLeafColl.h:102
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
void push_back(const ValueType &value)
push back a new element into collection
Definition: DataItemLeafColl.h:88
ipUInt32 getSize() const
retrieve collection size
Definition: DataItemLeafColl.h:82
Header part of macros set for class serialization.
void clear()
remove all items from collection
Definition: DataItemLeafColl.h:94
eDataItemValueType getDataItemValueType() const
retrieve data item value type
Definition: DataItemLeafColl.h:58
CollType & getColl()
get data item collection associated to object
Definition: DataItemLeafColl.h:69
eDataItemValueType
Enumerate describing data items value type.
Definition: DataItemTypes.h:70
std::vector< T > CollType
collection type associated to object
Definition: DataItemLeafColl.h:46
T ValueType
value type associated to object
Definition: DataItemLeafColl.h:40
const CollType & getColl() const
get data item collection associated to object
Definition: DataItemLeafColl.h:65
structure used to retrieve enumerate value from data item value type
Definition: DataItemTypes.h:184
#define IPSDKBASEDATA_API
Import/Export macro for library IPSDKUtil.
Definition: IPSDKBaseDataExports.h:27
bool isEmpty() const
check whether collection is empty
Definition: DataItemLeafColl.h:76
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53