IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ElementsLocationInfo.h
1 // ElementsLocationInfo.h:
3 // -----------------------
4 //
14 
15 #ifndef __IPSDKBASEPROCESSING_ELEMENTSLOCATIONINFO_H__
16 #define __IPSDKBASEPROCESSING_ELEMENTSLOCATIONINFO_H__
17 
18 // suppression warnings
19 // warning C4251: 'ipsdk::processor::ElementsLocationInfo::_elementsLocations' : class 'std::map<_Kty,_Ty>' needs to have dll-interface to be used
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
25 
26 namespace ipsdk {
27 namespace processor {
28 
31 
33 {
34 public:
38  ElementsLocationInfo(const ElementsLocationInfo& elementsLocationInfo);
39  ElementsLocationInfo& operator=(const ElementsLocationInfo& elementsLocationInfo);
42 
43 // methods
44 public:
46  ipUInt64 getStartOffset() const;
47 
49  ipUInt64 getNbElements() const;
50 
53  ipUInt64 insertNonLocalized(const ElementsRange& elementsRange,
54  const ipUInt64 dataMemorySize);
55 
58  ipUInt64 insertLocal(const ElementsRange& elementsRange,
59  const ipUInt64 dataMemorySize);
60 
64  ipUInt64 insertRemote(const ElementsRange& elementsRange,
65  const Guid& guid,
66  const ipUInt64 dataMemorySize);
67  ipUInt64 insertRemote(const ElementsRange& elementsRange,
68  const GuidSet& guidSet,
69  const ipUInt64 dataMemorySize);
71 
73  bool areDataLocalized() const;
74 
76  bool hasLocalData() const;
77 
79  bool hasRemoteData() const;
80 
82  bool hasRemoteData(const Guid& socketGuid) const;
83 
85  const GuidSet& getRemoteLocations() const;
86 
89  ipUInt64 getFullDataMemorySize() const;
90 
92  const ElementsLocation& getElementsLocation() const;
93 
94  //------------------------------------------------------------------
97  //------------------------------------------------------------------
98 
100  bool contains(const ipUInt64 elementIdx) const;
101 
103  bool contains(const ElementsRange& elementsRange) const;
104 
114  const GuidSet& getDataLocations(const ipUInt64 elementIdx) const;
115 
121  ipUInt64 getDataMemorySize(const ipUInt64 elementIdx) const;
122 
128  ipUInt64 getDataMemorySize(const ElementsRange& elementsRange) const;
129 
133  bool areDataLocalized(const ipUInt64 elementIdx) const;
134 
138  bool hasLocalData(const ipUInt64 elementIdx) const;
139 
143  bool hasRemoteData(const ipUInt64 elementIdx) const;
145 
147  ipUInt64 getMinNbElements() const;
148 
150  ipUInt64 getMaxNbElements() const;
151 
154  ipUInt64 merge(const ElementsLocationInfo& elementsLocationInfo);
155 
157  void clearDataLocalization();
158 
160  void clear();
161 
162 protected:
165  ipUInt64 insertElements(const ElementsRange& elementsRange,
166  const GuidSet& guidSet,
167  const ipUInt64 dataMemorySize,
168  const bool bAllowExtension);
169 
170 // attributes
171 protected:
175 
178 
181 
184 
187 
190 
193 };
194 
197 
198 inline ipUInt64
200 {
201  return _startOffset;
202 }
203 
204 inline ipUInt64
206 {
207  return _nbElements;
208 }
209 
210 inline bool
212 {
213  return (_bHasLocalData == true) || (_bHasRemoteData == true);
214 }
215 
216 inline bool
218 {
219  return _bHasLocalData;
220 }
221 
222 inline bool
224 {
225  return _bHasRemoteData;
226 }
227 
228 inline ipUInt64
230 {
231  return _fullDataMemorySize;
232 }
233 
234 inline const GuidSet&
236 {
237  return _remoteLocations;
238 }
239 
240 inline const ElementsLocation&
242 {
243  return _elementsLocations;
244 }
245 
248 
249 } // end of namespace processor
250 } // end of namespace ipsdk
251 
252 #pragma warning (pop)
253 
254 #endif // __IPSDKBASEPROCESSING_ELEMENTSLOCATIONINFO_H__
bool hasRemoteData() const
check whether some data are remote data
Definition: ElementsLocationInfo.h:223
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
bool _bHasRemoteData
flag indicating whether some data are remote data
Definition: ElementsLocationInfo.h:186
ipUInt64 getNbElements() const
retrieve number of elements associated to object
Definition: ElementsLocationInfo.h:205
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
std::map< ElementsRange, ElementLocationInfo > ElementsLocation
collection associating a elements range to a socket guid set
Definition: ElementsInfoTypes.h:43
ipUInt64 _fullDataMemorySize
full data memory size associated to elements
Definition: ElementsLocationInfo.h:192
const GuidSet & getRemoteLocations() const
retrieve global guid set associated to remote data
Definition: ElementsLocationInfo.h:235
ipUInt64 _startOffset
current start offset for data
Definition: ElementsLocationInfo.h:177
bool _bHasLocalData
flag indicating whether some data are local data
Definition: ElementsLocationInfo.h:183
ipUInt64 _nbElements
number of elements into collection
Definition: ElementsLocationInfo.h:180
Class encapsulating an auto initialized uuid.
Definition: Guid.h:27
bool hasLocalData() const
check whether some data are local data
Definition: ElementsLocationInfo.h:217
bool areDataLocalized() const
check whether data are localized
Definition: ElementsLocationInfo.h:211
GuidSet _remoteLocations
global guid set associated to remote data locations
Definition: ElementsLocationInfo.h:189
ipUInt64 getFullDataMemorySize() const
Definition: ElementsLocationInfo.h:229
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.
ipUInt64 getStartOffset() const
retrieve start offset associated to object
Definition: ElementsLocationInfo.h:199
ElementsLocation _elementsLocations
Definition: ElementsLocationInfo.h:174
std::set< Guid > GuidSet
collection of unique ordered guid
Definition: GuidTypes.h:27
IPSDKGEOMETRY_API BoundingBox2d< T > merge(const BoundingBox2d< T > &bBox0, const BoundingBox2d< T > &bBox1)
compute bounding box including two bounding boxes
const ElementsLocation & getElementsLocation() const
retrieve locations associated to elements
Definition: ElementsLocationInfo.h:241
Class allowing to store elements location informations.
Definition: ElementsLocationInfo.h:32