IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ElementsSplitInfo.h
1 // ElementsSplitInfo.h:
3 // --------------------
4 //
14 
15 #ifndef __IPSDKBASEPROCESSING_ELEMENTSSPLITINFO_H__
16 #define __IPSDKBASEPROCESSING_ELEMENTSSPLITINFO_H__
17 
18 // suppression warnings
19 // warning C4275: non dll-interface class 'boost::noncopyable_::noncopyable' used as base for dll-interface class 'ipsdk::processor::ElementsSplitInfo'
20 // warning C4251: 'ipsdk::processor::ElementsSplitInfo::_pendingElements' : class 'std::map<_Kty,_Ty>' needs to have dll-interface to be used by clients
21 #pragma warning (push)
22 #pragma warning (disable : 4275 4251)
23 
27 #include <boost/noncopyable.hpp>
28 
29 namespace ipsdk {
30 namespace processor {
31 
34 
35 class IPSDKBASEPROCESSING_API ElementsSplitInfo : public boost::noncopyable
36 {
37 public:
43 
44 // methods
45 public:
47  bool isInit() const;
48 
59  void init(const ElementsLocationInfo& elementsLocationInfo,
60  const ipUInt64 nbMinEltsPerSplit,
61  const ipUInt64 nbMaxEltsPerSplit,
62  const ipUInt64 minMemSzPerSplit,
63  const ipUInt64 maxMemSzPerSplit,
64  const ipUInt64 nbMaxAskedThreads);
65 
69  ipUInt64 getNbMinEltsPerSplit() const;
70 
74  ipUInt64 getNbMaxEltsPerSplit() const;
75 
79  ipUInt64 getMinMemSzPerSplit() const;
80 
84  ipUInt64 getMaxMemSzPerSplit() const;
85 
89  bool hasPendingData() const;
90 
95  bool hasRemainingData() const;
96 
101  bool hasSocketGuid(const Guid& socketGuid) const;
102 
107  ipUInt64 getRemainingDataMemorySize() const;
108 
113  ipUInt64 getRemainingDataMemorySize(const Guid& socketGuid) const;
114 
119  ipUInt64 getAcquiredDataMemorySize(const Guid& socketGuid) const;
120 
125  core::QueryResult acquiredNextRange(ElementsRange& acquiredElementsRange,
126  ipUInt64& acquiredDataMemorySize);
127 
132  core::QueryResult acquiredNextRange(const Guid& socketGuid,
133  ElementsRange& acquiredElementsRange,
134  ipUInt64& acquiredDataMemorySize);
135 
138  core::QueryResult stealNextLocalRange(const Guid& socketGuid,
139  ElementsRange& acquiredElementsRange,
140  ipUInt64& acquiredDataMemorySize);
141 
145  core::QueryResult forceNextRangeAcquisition(ElementsRange& acquiredElementsRange,
146  ipUInt64& acquiredDataMemorySize);
147 
151  void markHasReleased(const Guid& socketGuid,
152  const ElementsRange& elementsRange);
153 
157  const ElementsLocation& getProcessedElements() const;
158 
162  ipUInt64 getNbProcessedElements() const;
163 
167  ipUInt64 getNbNotReleased() const;
168 
172  ipUInt64 getNbPendingElements() const;
173 
177  RemoteDataSize getNotReleasedDataSizes() const;
178 
180  void clear();
181 
182 protected:
188  core::QueryResult acquiredNextRange(const Guid& socketGuidOwner,
189  const Guid& socketGuidProcessor,
190  ElementsRange& acquiredElementsRange,
191  ipUInt64& acquiredDataMemorySize);
192 
193 
194 // attributes
195 protected:
198 
201 
204 
207 
210 
213 
217 
221 
224 
226  bool _bInit;
227 };
228 
231 
232 inline bool
234 {
235  return _bInit;
236 }
237 
240 
241 } // end of namespace processor
242 } // end of namespace ipsdk
243 
244 #pragma warning (pop)
245 
246 #endif // __IPSDKBASEPROCESSING_ELEMENTSSPLITINFO_H__
bool _bInit
flag indicating whether object has been initialized
Definition: ElementsSplitInfo.h:226
Class allowing to encapsulate a typed process result associated to a string description.
Definition: ProcessingResult.h:28
Predefined types for elements informations management.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
#define IPSDKBASEPROCESSING_API
Import/Export macro for library IPSDKBaseProcessing.
Definition: IPSDKBaseProcessingExports.h:27
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
ElementsLocation _pendingElements
collection of pending elements for processing
Definition: ElementsSplitInfo.h:212
RemoteDataSize _acquiredDataSizes
Definition: ElementsSplitInfo.h:220
std::map< ElementsRange, ElementLocationInfo > ElementsLocation
collection associating a elements range to a socket guid set
Definition: ElementsInfoTypes.h:43
ElementsLocation _acquiredElements
Definition: ElementsSplitInfo.h:216
std::map< Guid, ipUInt64 > RemoteDataSize
collection of guid associated to a data size
Definition: ElementsInfoTypes.h:46
ElementsLocation _processedElements
collection of processed elements
Definition: ElementsSplitInfo.h:223
ipUInt64 _minMemSzPerSplit
minimum data size for a split operation
Definition: ElementsSplitInfo.h:203
ipUInt64 _nbMaxEltsPerSplit
maximum number of elements for a split operation
Definition: ElementsSplitInfo.h:200
Class encapsulating an auto initialized uuid.
Definition: Guid.h:27
Predefined types for action provider management.
bool isInit() const
check for object initialization
Definition: ElementsSplitInfo.h:233
ipUInt64 _nbMinEltsPerSplit
minimum number of elements for a split operation
Definition: ElementsSplitInfo.h:197
ipUInt64 _maxMemSzPerSplit
maximum data size for a split operation
Definition: ElementsSplitInfo.h:206
ipUInt64 _remainingDataMemorySize
remaining data memory size associated to not processed elements
Definition: ElementsSplitInfo.h:209
Class allowing to store information about elements range (start offset and number of elements) ...
Definition: ElementsRange.h:27
Definition of import/export macro for library.
Class allowing to store elements split informations.
Definition: ElementsSplitInfo.h:35
Class allowing to store elements location informations.
Definition: ElementsLocationInfo.h:32