-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProperty.h
74 lines (52 loc) · 1.45 KB
/
Property.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* Property.h
*
* Created on: 31 juil. 2015
* Author: horfee
*/
#ifndef PROPERTY_H_
#define PROPERTY_H_
#include <tuple>
#include <string>
#include "json/json.h"
using namespace std;
namespace alarmpi {
class Property {
public:
Property(string sName, string sDescription, string type, string sValue);
Property(string sName, string sDescription, string sValue);
Property(string sName, string sDescription, int iValue);
Property(string sName, string sDescription, float fValue);
Property(string sName, string sDescription, bool bValue);
virtual ~Property() {};
string getName() const;
string getDescription() const;
bool getBoolValue() const;
int getIntValue() const;
string getStringValue() const;
float getFloatValue() const;
string getType() const;
string getValueAsString() const;
void setName(string name);
void setDescription(string description);
void setBoolValue(bool value);
void setIntValue(int value);
void setStringValue(string value);
void setFloatValue(float value);
void setValue(std::string value);
virtual Json::Value toJSON() const;
virtual bool operator==(const std::string& name);
virtual bool operator==(const Property& property);
virtual bool operator!=(const std::string& name);
virtual bool operator!=(const Property& property);
private:
string name;
string description;
string type;
string sValue;
int iValue;
bool bValue;
float fValue;
};
} /* namespace alarmpi */
#endif /* PROPERTY_H_ */