PicoScenes API Docs
 
Loading...
Searching...
No Matches
LicenseService.hxx
Go to the documentation of this file.
1//
2// Created by Zhiping Jiang on 2021/7/19.
3//
4
5#ifndef PICOSCENES_PLATFORM_LICENSESERVICE_HXX
6#define PICOSCENES_PLATFORM_LICENSESERVICE_HXX
7
8#include <memory>
9#include "LicenseModel.hxx"
10
11namespace License {
12
14 public:
15 static std::shared_ptr<LicenseService> getInstance();
16
17 [[nodiscard]] virtual bool isServiceActivated() const = 0;
18
19 [[nodiscard]] virtual std::string getLicenseName() const = 0;
20
21 [[nodiscard]] virtual bool hasFeature(const std::string& featureName) const = 0;
22
23 virtual const Feature& getFeature(const std::string& featureName) = 0;
24
25 virtual bool testFeatureValue(const std::string& featureName, std::optional<double> numericValue) = 0;
26
27 virtual bool testFeatureValue(const std::string& featureName, std::optional<std::string> stringValue) = 0;
28
29 virtual bool testFeatureValue(const std::string& featureName, std::optional<double> numericValue, std::optional<std::string> stringValue) = 0;
30
31 virtual void checkFeature(const std::string& featureName, std::optional<double> numericValue) = 0;
32
33 virtual void checkFeature(const std::string& featureName, std::optional<std::string> stringValue) = 0;
34
35 virtual void checkFeature(const std::string& featureName, std::optional<double> numericValue, std::optional<std::string> stringValue) = 0;
36
37 [[nodiscard]] virtual std::string printHumanReadableLicense() const = 0;
38
39 protected:
40 ~LicenseService() = default;
41 };
42}
43
44#endif //PICOSCENES_PLATFORM_LICENSESERVICE_HXX
virtual std::string getLicenseName() const =0
virtual void checkFeature(const std::string &featureName, std::optional< double > numericValue, std::optional< std::string > stringValue)=0
virtual void checkFeature(const std::string &featureName, std::optional< double > numericValue)=0
virtual std::string printHumanReadableLicense() const =0
virtual bool testFeatureValue(const std::string &featureName, std::optional< double > numericValue, std::optional< std::string > stringValue)=0
virtual bool testFeatureValue(const std::string &featureName, std::optional< std::string > stringValue)=0
virtual bool isServiceActivated() const =0
virtual bool testFeatureValue(const std::string &featureName, std::optional< double > numericValue)=0
virtual bool hasFeature(const std::string &featureName) const =0
static std::shared_ptr< LicenseService > getInstance()
virtual void checkFeature(const std::string &featureName, std::optional< std::string > stringValue)=0
virtual const Feature & getFeature(const std::string &featureName)=0