#include <bsapi.h>
Public Member Functions | |
| virtual void BSAPI_METHOD | RegisterLicenseFile (const char *pFile)=0 |
| Register license file to use with license manager. | |
| virtual unsigned int BSAPI_METHOD | GetLicense (unsigned int appId)=0 |
| Get license from server. | |
| virtual bool BSAPI_METHOD | CheckLicense (unsigned int licenseId, bool forceReCheck=false)=0 |
| Check license for its validity. | |
| virtual long_long BSAPI_METHOD | GetSecsToExpire (unsigned int interfaceId)=0 |
| Gets the number of seconds to the license expiration for the given interface ID. | |
| virtual int BSAPI_METHOD | GetNLicenses (unsigned int interfaceId)=0 |
| Gets the total number of licenses for the given interface ID. | |
| virtual int BSAPI_METHOD | GetNUsedLicenses (unsigned int interfaceId)=0 |
| Gets the number of used licenses for the given interface ID. | |
| virtual bool BSAPI_METHOD | ReleaseLicense (unsigned int licenseId)=0 |
| Return license to server for its future reuse. | |
| virtual void BSAPI_METHOD | SetErrorHandler (SErrorCallbackI *pErrorHandler)=0 |
| Set error handler. | |
License manager is primarily used for controlling access to other library objects but it may be used for custom application license management too. To use licensed objects within library it is necessary to get instance of license manager by calling BSAPIGetLicenseManager(). Before creation of desired licensed instance by BSAPICreateInstance() it is needed to pass a name of license file to the instance of license manager by RegisterLicenseFile().
gender_identification.cpp, keyword_spotting.cpp, language_identification.cpp, and speaker_identification.cpp.
| virtual bool BSAPI_METHOD SLicenseManagerI::CheckLicense | ( | unsigned int | licenseId, | |
| bool | forceReCheck = false | |||
| ) | [pure virtual] |
Check license for its validity.
Based on license identifier obtained by previous calling of GetLicense() method checks if the license is still valid. By default result depends on the last license check being done regularly in background but it is also possible to force immediate check on server however it might be more time consuming.
| licenseId | license identifier | |
| forceReCheck |
|
| virtual unsigned int BSAPI_METHOD SLicenseManagerI::GetLicense | ( | unsigned int | appId | ) | [pure virtual] |
Get license from server.
Based on application identifier and license data stored in license file method asks the server for license and returns its identifier.
| appId | application identifier |
| virtual int BSAPI_METHOD SLicenseManagerI::GetNLicenses | ( | unsigned int | interfaceId | ) | [pure virtual] |
Gets the total number of licenses for the given interface ID.
| interfaceId | interface identifier |
| virtual int BSAPI_METHOD SLicenseManagerI::GetNUsedLicenses | ( | unsigned int | interfaceId | ) | [pure virtual] |
Gets the number of used licenses for the given interface ID.
| interfaceId | interface identifier |
| virtual long_long BSAPI_METHOD SLicenseManagerI::GetSecsToExpire | ( | unsigned int | interfaceId | ) | [pure virtual] |
Gets the number of seconds to the license expiration for the given interface ID.
| interfaceId | interface identifier |
| virtual void BSAPI_METHOD SLicenseManagerI::RegisterLicenseFile | ( | const char * | pFile | ) | [pure virtual] |
Register license file to use with license manager.
Data needed for successful licensing process (e.g. licensing server address) are stored in a file. This method associates the file with license manager.
| pFile | license file |
| virtual bool BSAPI_METHOD SLicenseManagerI::ReleaseLicense | ( | unsigned int | licenseId | ) | [pure virtual] |
Return license to server for its future reuse.
Contacts server to return license obtained by previous call of GetLicense(). License is then free for use by other users.
| licenseId | license identifier |
| virtual void BSAPI_METHOD SLicenseManagerI::SetErrorHandler | ( | SErrorCallbackI * | pErrorHandler | ) | [pure virtual] |
Set error handler.
Some functions of this class signalize success by true and failure by false. But it is usually necessary to know a cause of an error in detail. The default behaviour of this class is to send an error code and text message to a callback to allow to log the error or to display the error to a user when the error happened. The error handler also receives warnings and log messages. If the error handler is not set, the messages are printed to the standard output. All error, warning and log codes send by SLicenseManagerI can be found in Error, warning and log codes for SLicenseManagerI.
| pErrorHandler | pointer to instance of error handler |
1.4.7