IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
LicenseManager.h
1 // LicenseManager.h:
3 // -----------------
4 //
14 
15 #ifndef __IPSDKLICENSING_LICENSEMANAGER_H__
16 #define __IPSDKLICENSING_LICENSEMANAGER_H__
17 
18 // suppression of warnings
19 // warning C4251: 'ipsdk::lic::LicenseManager::_preInitParamsStr' : class 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>' nécessite une interface DLL pour être utilisé(e) par les clients de class 'ipsdk::lic::LicenseManager'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
24 #include <IPSDKLicensing/IPSDKMajorVersion.h>
26 #include <IPSDKHardware/Network/MacAddress.h>
27 #include <IPSDKUtil/BaseTypes.h>
28 #include <IPSDKUtil/Tools/ProcessingResult.h>
29 #include <IPSDKUtil/Tools/Chrono.h>
30 
31 #include <set>
32 #include <string>
33 
34 #include <boost/filesystem/path.hpp>
35 
36 namespace ipsdk {
37 namespace lic {
38 
41 
43 {
44 public:
46  static LicenseManager& getInstance();
47 
48 protected:
52  ~LicenseManager();
54 
55 // methods
56 public:
62  BoolResult init(const boost::filesystem::path& filePath, const std::string& preInitParamStr = "");
63 
66  bool isInit() const;
67 
70  bool isLicenseExpiryDateDefined() const;
71 
75  boost::gregorian::date getLicenseDateFrom() const;
76 
80  boost::gregorian::date getLicenseDateTo() const;
81 
84  bool isLicenseMACAddressDefined() const;
85 
89  ipsdk::hard::MacAddress getLicenseMacAddress(const ipUInt64 addrIdx) const;
90 
94  std::vector<ipsdk::hard::MacAddress> getLicenseMacAddresses() const;
95 
98  IPSDKMajorVersion getLicenseIPSDKMajorVersion() const;
99 
102  std::set<eLicenseFeature> getSupportedFeatures() const;
103 
107  bool isFeatureSupported(const eLicenseFeature& feature) const;
108 
111  void removeFeature(const eLicenseFeature& feature);
112 
116  ipInt32 nbDaysToExpiration() const;
117 
121  bool are3dProcessesSupported() const;
122 
126  bool areModulesHiddenInExplorer() const;
127 
132  bool isFreeTrial() const;
133 
139  ipInt32 getNbDaysForFreeTrialExpiration() const;
140 
145  bool hasFreeTrialExpired() const;
146 
148  bool needToCheckLicenseValidity() const;
149 
153  BoolResult checkLicenseValidity();
154 
158  BoolResult checkDongle();
159 
160 // attributes
161 protected:
163  std::string _preInitParamsStr;
164 
167 };
168 
171 
172 } // end of namespace lic
173 } // end of namespace ipsdk
174 
175 #pragma warning (pop)
176 
177 #endif // __IPSDKLICENSING_LICENSEMANAGER_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
uint64_t ipUInt64
Base types definition.
Definition: BaseTypes.h:55
int32_t ipInt32
Base types definition.
Definition: BaseTypes.h:52
std::string _preInitParamsStr
pre-initialiation parameter
Definition: LicenseManager.h:163
#define IPSDKLICENSING_API
Import/Export macro for library IPSDKLicensing.
Definition: IPSDKLicensingExports.h:25
Base types for multiplatform compatibility.
Chrono _chronoValidity
Chrono to allow to check the license validity.
Definition: LicenseManager.h:166
class storing the pair (IPSDKFirstMajorVersion, IPSDKSecondMajorVersion)
Definition: IPSDKMajorVersion.h:28
Chronometer class for library processing time evaluation.
Definition: Chrono.h:33
Structure encapsulating a network adapter mac address.
Definition: MacAddress.h:33
eLicenseFeature
Definition: LicenseFeatureTypes.h:31
Definition of import/export macro for library.
singleton class used to read data contained in a IPSDK license file, and check its validity ...
Definition: LicenseManager.h:42