LicenseSpring C++ SDK
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 
14 namespace LicenseSpring
15 {
20 {
21 public:
24 
31  DeviceVariable(const std::string &name, const std::string &value);
32 
41  DeviceVariable(int64_t id, const std::string &name, const std::string &value,
42  const std::string &dateTimeUpdated);
43 
46  bool isEmpty() const;
47 
51  int64_t id() const { return m_id; }
52 
55  const std::string &name() const { return m_name; }
56 
59  void setName(const std::string &name) { m_name = name; }
60 
63  const std::string &value() const { return m_value; }
64 
67  void setValue(const std::string &value) { m_value = value; }
68 
72  tm dateTimeUpdated() const;
73 
78  tm dateTimeUpdatedUtc() const;
79 
80 private:
81  int64_t m_id;
82  std::string m_name;
83  std::string m_value;
84  std::string m_dateTimeUpdated;
85 };
86 } // namespace LicenseSpring
87 
88 #ifdef _MSC_VER
89 #pragma warning(pop)
90 #endif
91 
92 #endif // LS_DEVICE_VARIABLE_H
const std::string & value() const
Getter method for device variable value.
void setName(const std::string &name)
Setter method for device variable name.
Class for storing key-value device variable.
const std::string & name() const
Getter method for device variable name.
void setValue(const std::string &value)
Setter method for device variable value.
#define LS_API
Definition: APIDef.h:23
int64_t id() const
Getter method for device variable id.