LicenseSpring C++ SDK 7.31.0
Easily add Software Licensing to your application
DeviceVariable.h
Go to the documentation of this file.
1#ifndef LS_DEVICE_VARIABLE_H
2#define LS_DEVICE_VARIABLE_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 "APIDef.h"
13
14namespace LicenseSpring
15{
19 {
20 public:
23
29 DeviceVariable( const std::string& name, const std::string& value );
30
38 DeviceVariable( int64_t id, const std::string& name, const std::string& value,
39 const std::string& dateTimeUpdated );
40
43 bool isEmpty() const;
44
48 int64_t id() const { return m_id; }
49
52 const std::string& name() const { return m_name; }
53
56 void setName( const std::string& name ) { m_name = name; }
57
60 const std::string& value() const { return m_value; }
61
64 void setValue( const std::string& value ) { m_value = value; }
65
69 tm dateTimeUpdated() const;
70
75
76 private:
77 int64_t m_id;
78 std::string m_name;
79 std::string m_value;
80 std::string m_dateTimeUpdated;
81 };
82}
83
84#ifdef _MSC_VER
85#pragma warning( pop )
86#endif
87
88#endif // LS_DEVICE_VARIABLE_H
#define LS_API
Macros that expands to dllexport, dllimport or nothing on non Windows platforms or in case of static ...
Definition: APIDef.h:22
Class for storing key-value device variable.
int64_t id() const
Getter method for device variable id.
void setName(const std::string &name)
Setter method for device variable name.
DeviceVariable(const std::string &name, const std::string &value)
Constructs device variable with given name (key) and value.
bool isEmpty() const
Check if variable is considered empty.
const std::string & value() const
Getter method for device variable value.
DeviceVariable()
Default constructor, creates empty device variable.
const std::string & name() const
Getter method for device variable name.
tm dateTimeUpdatedUtc() const
Getter method for device variable date time in UTC when it was updated on the backend.
tm dateTimeUpdated() const
Getter method for device variable date time when it was updated on the backend.
DeviceVariable(int64_t id, const std::string &name, const std::string &value, const std::string &dateTimeUpdated)
Constructs device variable with given data.
void setValue(const std::string &value)
Setter method for device variable value.