license.h

#include <primo/license/license.h>

Includes

  • primo/platform/reference.h

Classes

Name

Description

primo::license::LicenseInfo

Provides information about the current license state of the library.

Namespaces

  • primo

  • primo::license

  • primo::license::LicenseStatusFlags

Source

 1#ifndef ___PRIMO_LICENSE_H___
 2#define ___PRIMO_LICENSE_H___
 3
 4/** @file */
 5
 6#include <primo/platform/reference.h>
 7
 8namespace primo {
 9
10/**
11	Defines common license constants and interfaces used in Primo Software libraries.
12*/
13namespace license {
14
15/**
16	Defines the library license status.
17	When a license is set it may take some time until the license is resolved by the library.
18*/
19namespace LicenseStatusFlags
20{
21	/**
22		LicenseStatusFlags::Enum
23	*/
24	enum Enum
25	{
26		/**
27			The licensed state is permanent.
28			It can be changed only by calling Library::setLicense.
29
30			@remarks The Ready status does not imply that the library or any component is successfully licensed.
31
32			@see Library::setLicense
33		*/
34		Ready				= 0,
35
36		/**
37			The license is being validated and the current licensed state is temporary.
38		*/
39		ValidationInProgress	= 1,
40		
41		/**
42			This is a demo build that cannot be licensed.
43		*/
44		DemoBuild	= 2
45	};
46}
47
48/**
49	Provides information about the current license state of the library.
50
51	A LicenseInfo object is obtained by calling Library::createLicenseInfo()
52	The created object must be released when it is not needed anymore.
53
54	@see Library::createLicenseInfo
55*/
56class LicenseInfo : public primo::Reference
57{
58public:
59
60	/**
61		Gets the current license status.
62
63		@return A combination of flags defined in LicenseStatusFlags::Enum.
64		
65		@remarks Demo builds cannot be licensed. For demo builds, this method always returns LicenseStatusFlags::DemoBuild.
66		
67		@see LicenseStatusFlags
68	*/
69	virtual int32_t licenseStatus() = 0;
70
71	/**
72		Checks whether a product feature is licensed.     
73
74		@param product The product Id. If <b>NULL</b> the default library product is implied.
75
76		@param feature The feature Id. If <b>NULL</b> the default product feature is implied.
77
78		@return TRUE if the specified product feature is licensed, FALSE otherwise.
79
80		@remarks If a product is fully licensed then the function will always return TRUE for that product
81		regardless of the <i>feature</i> parameter.
82		
83		If a product is licensed for a limited set of features then the function will return TRUE for that product
84		only if the <i>feature</i> parameter specifies one of the licensed features or is <b>NULL</b>.
85	*/
86	virtual bool_t isLicensed(const char* product, const char* feature) = 0;
87
88protected:
89	~LicenseInfo() {}
90
91};
92
93
94}}
95
96#endif