Licme
Loading...
Searching...
No Matches
license_manager.h
1#pragma once
2
3#include <string>
4#include <memory>
5
6namespace licme
7{
8
9/* forward declarations */
10namespace helpers
11{
12class AbstractStateMachine;
13}
14namespace manager
15{
16class Configuration;
17}
18namespace manager
19{
20namespace states
21{
22class Context;
23}
24} // namespace manager
25
26namespace manager
27{
37class LicenseManager
38{
39public:
40 LicenseManager() = delete;
57 LicenseManager(const LicenseManager&) = delete;
58 LicenseManager(LicenseManager&&) = delete;
59
64
78 void Validate(std::string_view strFeature, bool bTryRenew = true);
79
87 std::string GetProperty(std::string_view strFeature, std::string_view strProperty) const;
88
92 void ReleaseAll();
93
97 void Renew();
98
108 static void ValidateProductFeature(const std::string& strProductName, const std::string& strFeature, bool bTryRenew = true);
109
110private:
111 void ValidateCapability(std::string_view strCapability);
112
113 std::unique_ptr<licme::helpers::AbstractStateMachine> statemachine;
114 std::unique_ptr<states::Context> context;
115};
116
117} // namespace manager
118} // namespace licme
This class represents the licensee's environment.
Definition configuration.h:37
void ReleaseAll()
deactivates all licensed features
void Renew()
renews the current volume
~LicenseManager()
Destroy the License Manager.
LicenseManager(manager::Configuration configuration)
Construct a new License Manager.
void Validate(std::string_view strFeature, bool bTryRenew=true)
validates a licensed feature
static void ValidateProductFeature(const std::string &strProductName, const std::string &strFeature, bool bTryRenew=true)
tries to validate the given feature for the given product
std::string GetProperty(std::string_view strFeature, std::string_view strProperty) const
returns properties of a feature