![]() |
LicenseSpring C++ SDK
7.27.0
Easily add Software Licensing to your application
|
Class for storing key-value device variable. More...
#include <LicenseSpring/DeviceVariable.h>
Public Member Functions | |
| DeviceVariable () | |
| Default constructor, creates empty device variable. More... | |
| DeviceVariable (const std::string &name, const std::string &value) | |
| Constructs device variable with given name (key) and value. More... | |
| DeviceVariable (int64_t id, const std::string &name, const std::string &value, const std::string &dateTimeUpdated) | |
| Constructs device variable with given data. More... | |
| bool | isEmpty () const |
| Check if variable is considered empty. More... | |
| int64_t | id () const |
| Getter method for device variable id. More... | |
| const std::string & | name () const |
| Getter method for device variable name. More... | |
| void | setName (const std::string &name) |
| Setter method for device variable name. More... | |
| const std::string & | value () const |
| Getter method for device variable value. More... | |
| void | setValue (const std::string &value) |
| Setter method for device variable value. More... | |
| tm | dateTimeUpdated () const |
| Getter method for device variable date time when it was updated on the backend. More... | |
| tm | dateTimeUpdatedUtc () const |
| Getter method for device variable date time in UTC when it was updated on the backend. More... | |
Class for storing key-value device variable.
This class is in use for passing device variables to the backend (see License::sendDeviceVariables)
Definition at line 18 of file DeviceVariable.h.
| LicenseSpring::DeviceVariable::DeviceVariable | ( | ) |
Default constructor, creates empty device variable.
| LicenseSpring::DeviceVariable::DeviceVariable | ( | const std::string & | name, |
| const std::string & | value | ||
| ) |
Constructs device variable with given name (key) and value.
To correctly send strings that contain Unicode characters, make sure the string is encoded in UTF-8,
for example: std::wstring_convert<std::codecvt_utf8<wchar_t>>().to_bytes( L"示例文本" )
| name | Name (key) of key-value data field for device variable |
| value | Value of key-value data field for device variable |
| LicenseSpring::DeviceVariable::DeviceVariable | ( | int64_t | id, |
| const std::string & | name, | ||
| const std::string & | value, | ||
| const std::string & | dateTimeUpdated | ||
| ) |
Constructs device variable with given data.
To correctly send strings that contain Unicode characters, make sure the string is encoded in UTF-8,
for example: std::wstring_convert<std::codecvt_utf8<wchar_t>>().to_bytes( L"示例文本" )
| id | Device variable identifier |
| name | Name (key) of key-value data field for device variable |
| value | Value of key-value data field for device variable |
| dateTimeUpdated | Date of last update |
| bool LicenseSpring::DeviceVariable::isEmpty | ( | ) | const |
Check if variable is considered empty.
|
inline |
Getter method for device variable id.
This value is available after getting device variables data from the backend.
Definition at line 48 of file DeviceVariable.h.
|
inline |
Getter method for device variable name.
Definition at line 52 of file DeviceVariable.h.
|
inline |
Setter method for device variable name.
| name | DeviceVariable name. |
Definition at line 56 of file DeviceVariable.h.
|
inline |
Getter method for device variable value.
Definition at line 60 of file DeviceVariable.h.
|
inline |
Setter method for device variable value.
| value | DeviceVariable value. |
Definition at line 64 of file DeviceVariable.h.
| tm LicenseSpring::DeviceVariable::dateTimeUpdated | ( | ) | const |
Getter method for device variable date time when it was updated on the backend.
This value is available after getting device variables data from the backend.
| tm LicenseSpring::DeviceVariable::dateTimeUpdatedUtc | ( | ) | const |
Getter method for device variable date time in UTC when it was updated on the backend.
This value is available after getting device variables data from the backend.