| LicenseSpring C++ SDK 7.32.0 Easily add Software Licensing to your application

Loading...
Searching...
No Matches
LicenseFeature.h
Go to the documentation of this file.
1#ifndef LS_LICENSE_FEATURE_H
2#define LS_LICENSE_FEATURE_H
3
4#ifdef _MSC_VER
5#pragma once
6#pragma warning( push )
7#pragma warning( disable : 4251 )
8#endif
9
10#include <string>
11#include <ctime>
12#include "PODTypes.h"
13#include "APIDef.h"
14#include "ConsumptionPeriod.h"
15
16 namespace LicenseSpring
17{
20 class LS_API LicenseFeature
21 {
22 public:
24 LicenseFeature();
25
30 LicenseFeature( const std::string& code, const std::string& name, LSFeatureType type );
31
53 LicenseFeature( const std::string& code, const std::string& name, LSFeatureType type,
54 int32_t maxConsumption, int32_t totalConsumption, int32_t localConsumption,
55 const tm& expiryDate, bool allowOverages, int32_t maxOverages,
56 bool resetConsumption, bool allowUnlimitedConsumptions, ConsumptionPeriod consumptionPeriod, const std::string& metadata,
57 bool isFloating, bool isOfflineFloating, int32_t floatingTimeout, int32_t floatingUsers,
58 int32_t floatingInUseCount, const tm& floatingStartDateTime, const tm& floatingEndDateTime );
59
62 const std::string& code() const;
63
66 const std::string& name() const;
67
70 LSFeatureType featureType() const;
71
75 int32_t maxConsumption() const;
76
80 int32_t totalConsumption() const;
81
86 int32_t localConsumption() const;
87
90 int32_t maxOverages() const;
91
94 bool isOveragesAllowed() const;
95
98 ConsumptionPeriod consumptionPeriod() const;
99
102 bool isResetConsumptionEnabled() const;
103
106 bool isUnlimitedConsumptionAllowed() const;
107
112 tm expiryDate() const;
113
117 tm expiryDateUtc() const;
118
121 const std::string& metadata() const;
122
125 bool isExpired() const;
126
129 bool isFloating() const;
130
133 bool isOfflineFloating() const;
134
137 int32_t floatingTimeout() const;
138
141 int32_t floatingUsers() const;
142
145 int32_t floatingInUseCount() const;
146
152 tm floatingEndDateTime() const;
153
158 tm floatingEndDateTimeUtc() const;
159
163 bool floatingIsExpired() const;
164
171 static LSFeatureType FeatureTypeFromString( const std::string& value );
172
178 static std::string FeatureTypeToString( LSFeatureType value );
179
183 std::string toString() const;
184
185 private:
186 std::string m_code;
187 std::string m_name;
188 LSFeatureType m_featureType;
189 int32_t m_maxConsumption;
190 int32_t m_totalConsumption;
191 int32_t m_localConsumption;
192 int32_t m_maxOverages;
193 bool m_allowOverages;
194 bool m_allowUnlimitedConsumptions;
195 bool m_resetConsumption;
196 ConsumptionPeriod m_consumptionPeriod;
197 tm m_expiryDate;
198 std::string m_metadata;
199 bool m_isFloating;
200 bool m_isOfflineFloating;
201 int32_t m_floatingTimeout;
202 int32_t m_floatingUsers;
203 int32_t m_floatingInUseCount;
204 tm m_floatingStartDateTime;
205 tm m_floatingEndDateTime;
206 };
207}
208
209#ifdef _MSC_VER
210#pragma warning( pop )
211#endif
212
213#endif // LS_LICENSE_FEATURE_H
APIDef.h
LS_API
#define LS_API
Macros that expands to dllexport, dllimport or nothing on non Windows platforms or in case of static ...
Definition APIDef.h:22
ConsumptionPeriod.h
PODTypes.h
LSFeatureType
LSFeatureType
Product feature type.
Definition PODTypes.h:19
LicenseSpring::ConsumptionPeriod
Class used for encapsulating LSConsumptionPeriod and converting cosumption period to/from string.
Definition ConsumptionPeriod.h:11
LicenseSpring::LicenseFeature
Class that encapsulates information about license feature.
Definition LicenseFeature.h:21
LicenseSpring::LicenseFeature::FeatureTypeToString
static std::string FeatureTypeToString(LSFeatureType value)
Helper method, converts LSFeatureType to string.
LicenseSpring::LicenseFeature::isUnlimitedConsumptionAllowed
bool isUnlimitedConsumptionAllowed() const
Checks if unlimited consumption is allowed for Consumption license feature.
LicenseSpring::LicenseFeature::floatingEndDateTime
tm floatingEndDateTime() const
Getter method for floating license feature expiry date.
LicenseSpring::LicenseFeature::LicenseFeature
LicenseFeature(const std::string &code, const std::string &name, LSFeatureType type, int32_t maxConsumption, int32_t totalConsumption, int32_t localConsumption, const tm &expiryDate, bool allowOverages, int32_t maxOverages, bool resetConsumption, bool allowUnlimitedConsumptions, ConsumptionPeriod consumptionPeriod, const std::string &metadata, bool isFloating, bool isOfflineFloating, int32_t floatingTimeout, int32_t floatingUsers, int32_t floatingInUseCount, const tm &floatingStartDateTime, const tm &floatingEndDateTime)
Constructs license feature with all of provided info.
LicenseSpring::LicenseFeature::LicenseFeature
LicenseFeature()
Constructs invalid license feature with no information.
LicenseSpring::LicenseFeature::featureType
LSFeatureType featureType() const
Getter method for license feature type.
LicenseSpring::LicenseFeature::floatingInUseCount
int32_t floatingInUseCount() const
Getter for current number of simultaneous users using this feature.
LicenseSpring::LicenseFeature::isOfflineFloating
bool isOfflineFloating() const
Checks if feature is and offline server floating feature.
LicenseSpring::LicenseFeature::name
const std::string & name() const
Getter method for license feature name.
LicenseSpring::LicenseFeature::isExpired
bool isExpired() const
Checks if license feature expired.
LicenseSpring::LicenseFeature::floatingTimeout
int32_t floatingTimeout() const
Getter for floating license timeout.
LicenseSpring::LicenseFeature::metadata
const std::string & metadata() const
Getter method for license feature metadata.
LicenseSpring::LicenseFeature::FeatureTypeFromString
static LSFeatureType FeatureTypeFromString(const std::string &value)
Helper method, converts string to LSFeatureType.
LicenseSpring::LicenseFeature::isResetConsumptionEnabled
bool isResetConsumptionEnabled() const
Checks if consumption reset is allowed for Consumption license feature.
LicenseSpring::LicenseFeature::isOveragesAllowed
bool isOveragesAllowed() const
Checks if overage is allowed for Consumption license feature.
LicenseSpring::LicenseFeature::toString
std::string toString() const
Helper method, compose license feature info into string.
LicenseSpring::LicenseFeature::floatingUsers
int32_t floatingUsers() const
Getter for maximum number of simultaneous users for this feature.
LicenseSpring::LicenseFeature::consumptionPeriod
ConsumptionPeriod consumptionPeriod() const
Returns period of time after which consumption is reset.
LicenseSpring::LicenseFeature::floatingIsExpired
bool floatingIsExpired() const
Checks if floating license feature expired.
LicenseSpring::LicenseFeature::LicenseFeature
LicenseFeature(const std::string &code, const std::string &name, LSFeatureType type)
Constructs license feature with given code, name and type.
LicenseSpring::LicenseFeature::totalConsumption
int32_t totalConsumption() const
Getter method for license feature current total consumption.
LicenseSpring::LicenseFeature::isFloating
bool isFloating() const
Checks if feature is a floating feature.
LicenseSpring::LicenseFeature::floatingEndDateTimeUtc
tm floatingEndDateTimeUtc() const
Getter method for license feature expiry date in UTC.
LicenseSpring::LicenseFeature::localConsumption
int32_t localConsumption() const
Getter method for license feature local consumption.
LicenseSpring::LicenseFeature::expiryDateUtc
tm expiryDateUtc() const
Getter method for license feature expiry date in UTC.
LicenseSpring::LicenseFeature::maxOverages
int32_t maxOverages() const
Returns maximum overage allowed for the license feature.
LicenseSpring::LicenseFeature::maxConsumption
int32_t maxConsumption() const
Getter method for license feature maximum consumption.
LicenseSpring::LicenseFeature::expiryDate
tm expiryDate() const
Getter method for license feature expiry date.
LicenseSpring::LicenseFeature::code
const std::string & code() const
Getter method for license feature code.
LicenseSpring
Definition BaseManager.h:16