IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseDataPartition.h
1 // BaseDataPartition.h:
3 // --------------------
4 //
14 
15 #ifndef __IPSDKMATH_BASEDATAPARTITION_H__
16 #define __IPSDKMATH_BASEDATAPARTITION_H__
17 
18 // suppression warnings
19 // warning C4251: 'ipsdk::math::BaseDataPartition::_indexesColl' : class 'std::set<ipsdk::math::BaseDataPartition::Indexes,std::less<_Kty>,std::allocator<_Kty>>' needs to have dll-interface to be used by clients of class 'ipsdk::math::BaseDataPartition'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
25 #include <IPSDKUtil/Tools/ProcessingResult.h>
26 #include <IPSDKSerialization/Engine/BaseSerializationObject.h>
27 #include <set>
28 
29 namespace ipsdk {
30 namespace math {
31 
34 
36 {
37  // declare serial class
39 
40 public:
44  virtual ~BaseDataPartition() = 0;
46 
47 // methods
48 public:
50  virtual eDataPartitionType getDataPartitionType() const = 0;
51 
53  bool isInit() const;
54 
59  BoolResult init(const ipUInt32 subSetRequestedSize,
60  const DataSet& fullDataSet);
61 
64  ipUInt32 getSubSetRequestedSize() const;
65 
71  BoolResult createSubSet(const DataSet& fullDataSet,
72  DataSet& subDataSet);
73 
75  void clear();
76 
77 protected:
80  virtual BoolResult initDerived(const DataSet& fullDataSet,
81  const ipUInt32 subSetRequestedSize) = 0;
82 
84  virtual void clearDerived() = 0;
85 
87  typedef std::set<ipUInt32> Indexes;
88 
90  virtual Indexes randomSubSet(const ipUInt32 subSetRequestedSize) = 0;
91 
92 // attributes
93 private:
95  typedef std::set<Indexes> IndexesColl;
96 
98  IndexesColl _indexesColl;
99 
101  ipUInt32 _subSetRequestedSize;
102 
104  bool _bInit;
105 };
106 
109 
110 inline bool
112 {
113  return _bInit;
114 }
115 
118 
119 } // end of namespace math
120 } // end of namespace ipsdk
121 
122 #pragma warning (pop)
123 
124 #endif // __IPSDKMATH_BASEDATAPARTITION_H__
Definition of import/export macro for library.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
std::vector< DataType > DataSet
collection of data associated to estimation
Definition: EstimationTypes.h:67
#define IPSDK_DECLARE_ABSTRACT_SERIAL_WITHOUT_COPY(libraryName, className)
macro enabling serialization on abstract class
Definition: SerializationHdrMacro.h:97
#define IPSDKMATH_API
Import/Export macro for library IPSDKMath.
Definition: IPSDKMathExports.h:27
bool isInit() const
check for object initialization
Definition: BaseDataPartition.h:111
Predefined types for parametric estimation from data set.
Base class for data partitioning.
Definition: BaseDataPartition.h:35
std::set< ipUInt32 > Indexes
collection of unique indexes
Definition: BaseDataPartition.h:87
Base class for serializable class.
Definition: BaseSerializationObject.h:33
eDataPartitionType
data partition type
Definition: DataPartitionTypes.h:33
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53