IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
LocalProcessingPolicy.h
1 // LocalProcessingPolicy.h:
3 // ------------------------
4 //
14 
15 #ifndef __IPSDKCORE_LOCALPROCESSINGPOLICY_H__
16 #define __IPSDKCORE_LOCALPROCESSINGPOLICY_H__
17 
18 // suppression of warnings
19 // warning C4251: 'ipsdk::core::LocalProcessingPolicy::_diskImagePath' : class 'boost::filesystem::path' nécessite une interface DLL pour être utilisé(e) par les clients de class 'ipsdk::core::LocalProcessingPolicy'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
24 #include <IPSDKSerialization/Engine/BaseSerializationObject.h>
25 
26 namespace ipsdk {
27 namespace core {
28 
31 
33 {
34  // declare serial class
36 
37 public:
43 
44 // methods
45 public:
49  static ipUInt64 getDefaultNbMaxThreads();
50 
54  static ipUInt64 getDefaultMinMemSzPerThread();
55 
59  static ipUInt64 getDefaultMaxMemSzPerThread();
60 
64  static boost::filesystem::path getDefaultAllocatedDiskImagePath();
65 
67  bool isInit() const;
68 
70  void init(const ipUInt32 nbMaxThreads,
71  const ipUInt64 minMemSzPerThread,
72  const ipUInt64 maxMemSzPerThread,
73  const boost::filesystem::path& diskImagePath = "");
74 
76  void initDefault();
77 
82  ipUInt32 getNbMaxThreads() const;
83 
85  // on local computer
89 
95 
98  const boost::filesystem::path& getAllocatedDiskImagePath(void) const;
99 
102  void setNbMaxThreads(const ipUInt32 nbmaxThreads);
103 
106  void setMinMemSzPerThread(const ipUInt64 minMemSzPerThread);
107 
110  void setMaxMemSzPerThread(const ipUInt64 maxMemSzPerThread);
111 
114  void setAllocatedDiskImagePath(const boost::filesystem::path& dirPath);
115 
117  BoolResult save(const boost::filesystem::path& dirPath) const;
118 
120  BoolResult save() const;
121 
123  void clear();
124 
125 protected:
127  void checkValues();
128 
129 // attributes
130 protected:
134 
139 
144 
146  boost::filesystem::path _diskImagePath;
147 
149  bool _bInit;
150 };
151 
154 
155 inline bool
157 {
158  return _bInit;
159 }
160 
163 
164 } // end of namespace core
165 } // end of namespace ipsdk
166 
167 #pragma warning (pop)
168 
169 #endif // __IPSDKCORE_LOCALPROCESSINGPOLICY_H__
#define IPSDK_DECLARE_SERIAL_WITH_COPY(libraryName, className)
macro enabling serialization on class
Definition: SerializationHdrMacro.h:73
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
bool isInit() const
retrieve object initialization flag
Definition: LocalProcessingPolicy.h:156
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
IPSDKCORE_API ipUInt64 getMaxMemSzPerThread()
retrieve maximum physical memory (RAM) used by each thread on local computer
IPSDKCORE_API void setNbMaxThreads(const ipUInt32 nbMaxThreads)
modify the maximum number of usable thread for processings on local computer
ipUInt64 _minMemSzPerThread
Definition: LocalProcessingPolicy.h:143
ipUInt64 _maxMemSzPerThread
Definition: LocalProcessingPolicy.h:138
Definition of import/export macro for library.
IPSDKCORE_API void setAllocatedDiskImagePath(const boost::filesystem::path &dirPath)
modify the path to the directory where the automatically disk images are created
boost::filesystem::path _diskImagePath
Directory where automatically allocated disk images are created.
Definition: LocalProcessingPolicy.h:146
#define IPSDKCORE_API
Import/Export macro for library IPSDKCore.
Definition: IPSDKCoreExports.h:27
bool _bInit
object initialization flag
Definition: LocalProcessingPolicy.h:149
IPSDKCORE_API void setMinMemSzPerThread(const ipUInt64 minMemSzPerThread)
modify the minimum physical memory (RAM) used by each thread on local computer
IPSDKCORE_API const boost::filesystem::path & getAllocatedDiskImagePath()
return the path to the directory where the automatically disk images are created
ipUInt32 _nbMaxThreads
Definition: LocalProcessingPolicy.h:133
IPSDKCORE_API ipUInt32 getNbMaxThreads()
retrieve maximum number of usable thread for processings on local computer
Class allowing to describe processing policy for local machine.
Definition: LocalProcessingPolicy.h:32
IPSDKCORE_API void setMaxMemSzPerThread(const ipUInt64 maxMemSzPerThread)
modify the maximum physical memory (RAM) used by each thread on local computer
IPSDKCORE_API ipUInt64 getMinMemSzPerThread()
retrieve minimum physical memory (RAM) used by each thread on local computer
Base class for serializable class.
Definition: BaseSerializationObject.h:33
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53