libhomegear-base  0.7
Base library for Homegear and Homegear family modules.
JsonPayload.h
Go to the documentation of this file.
1 /* Copyright 2013-2019 Homegear GmbH
2  *
3  * libhomegear-base is free software: you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public License as
5  * published by the Free Software Foundation, either version 3 of the
6  * License, or (at your option) any later version.
7  *
8  * libhomegear-base is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with libhomegear-base. If not, see
15  * <http://www.gnu.org/licenses/>.
16  *
17  * In addition, as a special exception, the copyright holders give
18  * permission to link the code of portions of this program with the
19  * OpenSSL library under certain conditions as described in each
20  * individual source file, and distribute linked combinations
21  * including the two.
22  * You must obey the GNU Lesser General Public License in all respects
23  * for all of the code used other than OpenSSL. If you modify
24  * file(s) with this exception, you may extend this exception to your
25  * version of the file(s), but you are not obligated to do so. If you
26  * do not wish to do so, delete this exception statement from your
27  * version. If you delete this exception statement from all source
28  * files in the program, then also delete it here.
29 */
30 
31 #ifndef JSONPAYLOAD_H_
32 #define JSONPAYLOAD_H_
33 
34 #include <string>
35 #include <vector>
36 #include <memory>
37 
38 namespace rapidxml
39 {
40 class xml_node;
41 }
42 
43 using namespace rapidxml;
44 
45 namespace BaseLib
46 {
47 
48 class SharedObjects;
49 
50 namespace DeviceDescription
51 {
52 
54 
58 typedef std::shared_ptr<JsonPayload> PJsonPayload;
59 
63 typedef std::vector<PJsonPayload> JsonPayloads;
64 
69 {
70 public:
73  virtual ~JsonPayload() {}
74 
75  std::string key;
76  std::string subkey;
77  std::string subsubkey;
78  std::vector<std::string> keyPath;
79  std::string parameterId;
80  bool constValueBooleanSet = false;
81  bool constValueBoolean = false;
82  bool constValueIntegerSet = false;
83  int32_t constValueInteger = -1;
84  bool constValueDecimalSet = false;
85  double constValueDecimal = -1;
86  bool constValueStringSet = false;
87  std::string constValueString;
88 protected:
89  BaseLib::SharedObjects* _bl = nullptr;
90 };
91 }
92 }
93 
94 #endif
This is the base library main class.
Definition: BaseLib.h:95
std::string parameterId
Definition: JsonPayload.h:79
Definition: BaseLib.cpp:34
std::string subkey
Definition: JsonPayload.h:76
std::string constValueString
Definition: JsonPayload.h:87
std::vector< PJsonPayload > JsonPayloads
Helper type for JsonPayload pointer arrays.
Definition: JsonPayload.h:63
std::shared_ptr< JsonPayload > PJsonPayload
Helper type for JsonPayload pointers.
Definition: JsonPayload.h:53
Class describing JSON payloads.
Definition: JsonPayload.h:68
virtual ~JsonPayload()
Definition: JsonPayload.h:73
std::string key
Definition: JsonPayload.h:75
Class representing a node of XML document.
Definition: rapidxml.h:539
std::vector< std::string > keyPath
Definition: JsonPayload.h:78
Definition: BinaryPayload.h:38
std::string subsubkey
Definition: JsonPayload.h:77