![]() |
LicenseSpring C++ SDK 7.31.0
Easily add Software Licensing to your application
|
Class that encapsulates information about license feature. More...
#include <LicenseSpring/LicenseFeature.h>
Public Member Functions | |
LicenseFeature () | |
Constructs invalid license feature with no information. | |
LicenseFeature (const std::string &code, const std::string &name, LSFeatureType type) | |
Constructs license feature with given code, name and type. | |
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. | |
const std::string & | code () const |
Getter method for license feature code. | |
const std::string & | name () const |
Getter method for license feature name. | |
LSFeatureType | featureType () const |
Getter method for license feature type. | |
int32_t | maxConsumption () const |
Getter method for license feature maximum consumption. | |
int32_t | totalConsumption () const |
Getter method for license feature current total consumption. | |
int32_t | localConsumption () const |
Getter method for license feature local consumption. | |
int32_t | maxOverages () const |
Returns maximum overage allowed for the license feature. | |
bool | isOveragesAllowed () const |
Checks if overage is allowed for Consumption license feature. | |
ConsumptionPeriod | consumptionPeriod () const |
Returns period of time after which consumption is reset. | |
bool | isResetConsumptionEnabled () const |
Checks if consumption reset is allowed for Consumption license feature. | |
bool | isUnlimitedConsumptionAllowed () const |
Checks if unlimited consumption is allowed for Consumption license feature. | |
tm | expiryDate () const |
Getter method for license feature expiry date. | |
tm | expiryDateUtc () const |
Getter method for license feature expiry date in UTC. | |
const std::string & | metadata () const |
Getter method for license feature metadata. | |
bool | isExpired () const |
Checks if license feature expired. | |
bool | isFloating () const |
Checks if feature is a floating feature. | |
bool | isOfflineFloating () const |
Checks if feature is and offline server floating feature. | |
int32_t | floatingTimeout () const |
Getter for floating license timeout. | |
int32_t | floatingUsers () const |
Getter for maximum number of simultaneous users for this feature. | |
int32_t | floatingInUseCount () const |
Getter for current number of simultaneous users using this feature. | |
tm | floatingEndDateTime () const |
Getter method for floating license feature expiry date. | |
tm | floatingEndDateTimeUtc () const |
Getter method for license feature expiry date in UTC. | |
bool | floatingIsExpired () const |
Checks if floating license feature expired. | |
std::string | toString () const |
Helper method, compose license feature info into string. | |
Static Public Member Functions | |
static LSFeatureType | FeatureTypeFromString (const std::string &value) |
Helper method, converts string to LSFeatureType. | |
static std::string | FeatureTypeToString (LSFeatureType value) |
Helper method, converts LSFeatureType to string. | |
Class that encapsulates information about license feature.
Includes information for a license feature's typing, code, name, consumption values, and expiry dates.
Definition at line 20 of file LicenseFeature.h.
LicenseSpring::LicenseFeature::LicenseFeature | ( | ) |
Constructs invalid license feature with no information.
LicenseSpring::LicenseFeature::LicenseFeature | ( | const std::string & | code, |
const std::string & | name, | ||
LSFeatureType | type | ||
) |
Constructs license feature with given code, name and type.
code | The product feature code |
name | The name of the product feature on this license |
type | Either FeatureTypeNone, FeatureTypeActivation, or FeatureTypeConsumption |
LicenseSpring::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.
code | The product feature code |
name | The name of the product if feature is a floating feature.eature on this license |
type | Either FeatureTypeNone, FeatureTypeActivation, or FeatureTypeConsumption |
maxConsumption | The total amount of consumption allowed for this feature |
totalConsumption | The current amount of consumption used for this feature |
localConsumption | The current local consumption specific to this device |
expiryDate | The expiration date for the product feature on this license |
allowOverages | Is overage allowed for this license feature |
maxOverages | Maximum number of overages |
resetConsumption | Is consuption reset is enabled for this license feature |
allowUnlimitedConsumptions | Is unlimited consumption is enabled for this license feature |
consumptionPeriod | The period of consumption reset |
metadata | The product feature metadata |
isFloating | Is license feature a floating feature |
isOfflineFloating | Is license feature an offline server floating feature |
floatingTimeout | Time in minutes after which the feature will automatically release if it's not registered |
floatingUsers | Maximum number of simultaneous users for this feature |
floatingInUseCount | Current number of simultaneous users using this feature |
floatingStartDateTime | The date when the floating feature was registered |
floatingEndDateTime | The date when the floating feature is automatically released |
const std::string & LicenseSpring::LicenseFeature::code | ( | ) | const |
Getter method for license feature code.
const std::string & LicenseSpring::LicenseFeature::name | ( | ) | const |
Getter method for license feature name.
LSFeatureType LicenseSpring::LicenseFeature::featureType | ( | ) | const |
Getter method for license feature type.
int32_t LicenseSpring::LicenseFeature::maxConsumption | ( | ) | const |
Getter method for license feature maximum consumption.
Meaningful only for consumption feature type.
int32_t LicenseSpring::LicenseFeature::totalConsumption | ( | ) | const |
Getter method for license feature current total consumption.
Please note, it includes localConsumption. Meaningful only for consumption feature type.
int32_t LicenseSpring::LicenseFeature::localConsumption | ( | ) | const |
Getter method for license feature local consumption.
This is consumption that has not been synchronized with the backend yet.
Meaningful only for consumption feature type.
int32_t LicenseSpring::LicenseFeature::maxOverages | ( | ) | const |
Returns maximum overage allowed for the license feature.
Meaningful only for Consumption feature type, returns 0 in case of unlimited overages.
bool LicenseSpring::LicenseFeature::isOveragesAllowed | ( | ) | const |
Checks if overage is allowed for Consumption license feature.
Meaningful only for Consumption feature type.
ConsumptionPeriod LicenseSpring::LicenseFeature::consumptionPeriod | ( | ) | const |
Returns period of time after which consumption is reset.
Meaningful only for Consumption feature type.
bool LicenseSpring::LicenseFeature::isResetConsumptionEnabled | ( | ) | const |
Checks if consumption reset is allowed for Consumption license feature.
Meaningful only for Consumption feature type.
bool LicenseSpring::LicenseFeature::isUnlimitedConsumptionAllowed | ( | ) | const |
Checks if unlimited consumption is allowed for Consumption license feature.
Meaningful only for Consumption feature type.
tm LicenseSpring::LicenseFeature::expiryDate | ( | ) | const |
Getter method for license feature expiry date.
If expiry date has not been set this method returns maximum date (31.12.9999).
In this case it means that feature is perpetual and cannot expire.
tm LicenseSpring::LicenseFeature::expiryDateUtc | ( | ) | const |
Getter method for license feature expiry date in UTC.
Returns the same as expiryDate, but date time converted to UTC.
const std::string & LicenseSpring::LicenseFeature::metadata | ( | ) | const |
Getter method for license feature metadata.
bool LicenseSpring::LicenseFeature::isExpired | ( | ) | const |
Checks if license feature expired.
bool LicenseSpring::LicenseFeature::isFloating | ( | ) | const |
Checks if feature is a floating feature.
bool LicenseSpring::LicenseFeature::isOfflineFloating | ( | ) | const |
Checks if feature is and offline server floating feature.
int32_t LicenseSpring::LicenseFeature::floatingTimeout | ( | ) | const |
Getter for floating license timeout.
int32_t LicenseSpring::LicenseFeature::floatingUsers | ( | ) | const |
Getter for maximum number of simultaneous users for this feature.
int32_t LicenseSpring::LicenseFeature::floatingInUseCount | ( | ) | const |
Getter for current number of simultaneous users using this feature.
tm LicenseSpring::LicenseFeature::floatingEndDateTime | ( | ) | const |
Getter method for floating license feature expiry date.
If license feature is not registered, returns some previous point in time.
Otherwise, returns the time after which the floating feature is released.
Meaningful only for floating features.
tm LicenseSpring::LicenseFeature::floatingEndDateTimeUtc | ( | ) | const |
Getter method for license feature expiry date in UTC.
Returns the same as floatingExpiryDate, but date time converted to UTC.
Meaningful only for floating features.
bool LicenseSpring::LicenseFeature::floatingIsExpired | ( | ) | const |
Checks if floating license feature expired.
Meaningful only for floating features.
|
static |
Helper method, converts string to LSFeatureType.
If value == 'activation', returns FeatureTypeActivation.
If value == 'consumption', returns FeatureTypeConsumption, otherwise returns FeatureTypeNone.
Must be written as above, i.e. all lowercase.
value | String to convert. |
|
static |
Helper method, converts LSFeatureType to string.
String-value pairs same as FeatureTypeFromString().
FeatureTypeNone returns an empty string.
value | LSFeatureType to convert |
std::string LicenseSpring::LicenseFeature::toString | ( | ) | const |
Helper method, compose license feature info into string.
This is helper method, you should not rely on its output.