IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseDataParser.h
1 // BaseDataParser.h:
3 // -----------------
4 //
14 
15 #ifndef __IPSDKBASEPROCESSING_BASEDATAPARSER_H__
16 #define __IPSDKBASEPROCESSING_BASEDATAPARSER_H__
17 
18 // suppression warnings
19 // warning C4275: non dll-interface class 'boost::noncopyable_::noncopyable' used as base for dll-interface class 'ipsdk::processor::BaseDataParser'
20 // warning C4251: 'ipsdk::processor::BaseDataParser::_attributeIO' : class 'ipsdk::eIOStatus' needs to have dll-interface to be used by clients of class 'ipsdk::processor::BaseDataParser'
21 #pragma warning (push)
22 #pragma warning (disable : 4275 4251)
23 
27 #include <IPSDKUtil/BaseTypes.h>
28 #include <boost/noncopyable.hpp>
29 
30 namespace ipsdk {
31 namespace processor {
32 
33 class BaseProcessingAlgorithm;
34 
37 
38 class IPSDKBASEPROCESSING_API BaseDataParser : public boost::noncopyable
39 {
40  // friend class for private members access
41  friend class BaseProcessingAlgorithm;
42 
43 public:
47  virtual ~BaseDataParser() = 0;
49 
50 // methods
51 public:
53  bool isInit() const;
54 
56  virtual eDataParserType getDataParserType() const = 0;
57 
58  //-----------------------------------------
61  //-----------------------------------------
62 
66  const eIOStatus& getAttributeIO() const;
67 
71  ipUInt64 getNbElements() const;
72 
76  ipUInt64 getNbDataByElement() const;
77 
81  ipUInt64 getNbMinInitData() const;
82 
86  ipUInt64 getNbMinFinalData() const;
87 
92  ipUInt64 getCurElementIdx() const;
94 
95  //-------------------------------------------
98  //-------------------------------------------
99 
103  ipReal64 getUnAlignedValue() const;
104 
108  void setUnAlignedValue(const ipReal64 unAlignedValue);
110 
114  bool areDataInit() const;
115 
119  ipUInt64 getNbInitData() const;
120 
124  ipUInt64 getNbMainData() const;
125 
129  ipUInt64 getNbFinalData() const;
130 
135  ipUInt64 getNbRealFinalData() const;
136 
138  void clear();
139 
140 protected:
154  void initBase(const eIOStatus& attributeIO,
155  const ipUInt64 nbElements,
156  const ipUInt64 nbDataByElement,
157  const ipUInt64 nbMinInitData,
158  const ipUInt64 nbMinFinalData,
159  const ipReal64 unAlignedDefaultValue);
160 
162  virtual void clearDerived() {}
163 
165  virtual void initDataDerived(const ipUInt64 nbInitData,
166  const ipUInt64 nbMainData,
167  const ipUInt64 nbFinalData,
168  const ipUInt64 nbRealFinalData,
169  const ipReal64 unAlignedValue) = 0;
170 
173  virtual void prepareDataDerived(const ipUInt64 elementIdx) = 0;
174 
176  virtual void updateToInitDataDerived() = 0;
177 
179  virtual void updateToMainDataDerived() = 0;
180 
182  virtual void updateToFinalDataDerived() = 0;
183 
185  virtual void syncOutFinalDataDerived() {}
186 
198  void initData(const ipUInt64 nbInitData,
199  const ipUInt64 nbMainData,
200  const ipUInt64 nbFinalData,
201  const ipUInt64 nbRealFinalData);
202 
208  void prepareData(const ipUInt64 elementIdx);
209 
210 private:
211  //-----------------------------------------------
214  //-----------------------------------------------
215 
219  void updateToInitData();
220 
224  void updateToMainData();
225 
229  void updateToFinalData();
230 
236  void syncOutFinalData();
238 
239 // attributes
240 private:
242  eIOStatus _attributeIO;
243 
245  ipUInt64 _nbElements;
246 
248  ipUInt64 _nbDataByElement;
249 
251  ipUInt64 _nbMinInitData;
252 
254  ipUInt64 _nbMinFinalData;
255 
257  ipUInt64 _curElementIdx;
258 
260  ipUInt64 _nbInitData;
261 
263  ipUInt64 _nbMainData;
264 
266  ipUInt64 _nbFinalData;
267 
269  ipUInt64 _nbRealFinalData;
270 
272  bool _bDataInit;
273 
275  ipReal64 _unAlignedValue;
276 
278  bool _bInit;
279 };
280 
283 
284 inline bool
286 {
287  return _bInit;
288 }
289 
292 
293 } // end of namespace processor
294 } // end of namespace ipsdk
295 
296 #pragma warning (pop)
297 
298 #endif // __IPSDKBASEPROCESSING_BASEDATAPARSER_H__
virtual void syncOutFinalDataDerived()
synchronize final output data after processing
Definition: BaseDataParser.h:185
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
#define IPSDKBASEPROCESSING_API
Import/Export macro for library IPSDKBaseProcessing.
Definition: IPSDKBaseProcessingExports.h:27
Base class for objects allowing to parse attribute data.
Definition: BaseDataParser.h:38
eIOStatus
Enumerate describing data input/output status.
Definition: DataStatusTypes.h:31
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
virtual void clearDerived()
clear object data in derived class
Definition: BaseDataParser.h:162
Predefined types for processing attributes managment.
Base types for multiplatform compatibility.
Definition of import/export macro for library.
bool isInit() const
retrieve object initialization flag
Definition: BaseDataParser.h:285
Predefined types for data parser management.
eDataParserType
Enumerate describing data parser type.
Definition: DataParserTypes.h:34
Base class for processing algorithm.
Definition: BaseProcessingAlgorithm.h:35