61 typedef std::map<int32_t, std::map<int32_t, PDeviceInfo>>
DeviceStates;
66 virtual bool init() = 0;
102 virtual void removeLicense(int32_t familyId, int32_t deviceId);
111 virtual std::string
getLicenseKey(int32_t familyId, int32_t deviceId);
139 uint64_t
getMapKey(int32_t familyId, int32_t deviceId);
141 virtual void removeDevice(int32_t familyId, int32_t deviceId);
144 virtual void saveVariable(uint64_t index, int32_t intValue);
145 virtual void saveVariable(uint64_t index, int64_t intValue);
146 virtual void saveVariable(uint64_t index, std::string& stringValue);
147 virtual void saveVariable(uint64_t index, std::vector<uint8_t>& binaryValue);
bool _disposed
Definition: Licensing.h:132
BaseLib::SharedObjects * _bl
Definition: Licensing.h:131
This is the base library main class.
Definition: BaseLib.h:95
virtual void addDevice(int32_t familyId, int32_t deviceId, bool state, std::string licenseKey)
Definition: Licensing.cpp:353
std::map< uint64_t, uint32_t > _variableDatabaseIds
Definition: Licensing.h:134
uint64_t getMapKey(int32_t familyId, int32_t deviceId)
Definition: Licensing.cpp:348
Definition: BaseLib.cpp:34
std::map< uint64_t, LicenseData > _licenseData
Definition: Licensing.h:135
struct BaseLib::Licensing::Licensing::DeviceInfo __attribute__((aligned(64)))
virtual void dispose()
Definition: Licensing.cpp:48
DeviceStates _devices
Definition: Licensing.h:137
virtual int64_t getTrialStartTime(int32_t familyId, int32_t deviceId)
Returns the start time of a trial version.
Definition: Licensing.cpp:109
virtual void saveVariable(uint64_t index, int32_t intValue)
Definition: Licensing.cpp:149
virtual void decryptScript(const std::vector< char > &input, std::string &output)=0
std::string activationKey
Definition: Licensing.h:128
std::string licenseKey
Definition: Licensing.h:57
std::mutex _devicesMutex
Definition: Licensing.h:136
Licensing(BaseLib::SharedObjects *bl)
Definition: Licensing.cpp:39
std::shared_ptr< DeviceInfo > PDeviceInfo
Definition: Licensing.h:60
std::string licenseKey
Definition: Licensing.h:127
virtual void loadVariables()
Definition: Licensing.cpp:66
Definition: Licensing.h:125
virtual bool getDeviceState(int32_t familyId, int32_t deviceId)
Returns the activation status of a device or family.
Definition: Licensing.cpp:319
virtual int32_t checkLicense(int32_t familyId, int32_t deviceId, const std::string &licenseKey="")=0
Checks if a license key is valid.
int32_t familyId
Definition: Licensing.h:54
virtual void decryptDeviceDescription(const std::vector< char > &input, std::vector< char > &output)=0
int32_t deviceId
Definition: Licensing.h:55
virtual void removeDevice(int32_t familyId, int32_t deviceId)
Definition: Licensing.cpp:378
Definition: Licensing.h:48
virtual ~Licensing()
Definition: Licensing.cpp:44
virtual void removeLicense(int32_t familyId, int32_t deviceId)
Removes a license.
Definition: Licensing.cpp:131
Definition: Licensing.h:51
bool state
Definition: Licensing.h:56
virtual void updateDevice(int32_t familyId, int32_t deviceId, bool state, std::string licenseKey)
Definition: Licensing.cpp:373
virtual std::string getLicenseKey(int32_t familyId, int32_t deviceId)
Returns the license key stored in the database.
Definition: Licensing.cpp:90
int32_t moduleId
Definition: Licensing.h:53
virtual int32_t getModuleId()
Definition: Licensing.h:70
virtual DeviceStates getDeviceStates()
Returns a map with all unlicensed devices.
Definition: Licensing.cpp:303
int32_t _moduleId
Definition: Licensing.h:133
virtual void load()
Definition: Licensing.cpp:61
std::map< int32_t, std::map< int32_t, PDeviceInfo > > DeviceStates
Definition: Licensing.h:61