KPN Things Device SDK
senml_base_parser.h
Go to the documentation of this file.
1/* _ __ ____ _ _
2 * | |/ / | _ \ | \ | |
3 * | ' / | |_) | | \| |
4 * | . \ | __/ | |\ |
5 * |_|\_\ |_| |_| \_|
6 *
7 * (c) 2020 KPN
8 * License: MIT License.
9 * Author: Joseph Verburg, Jan Bogaerts
10 *
11 * base class for all parsers header
12 */
13
14#ifndef THINGSML_SENML_BASE_PARSER
15#define THINGSML_SENML_BASE_PARSER
16
17#include "record/senml_record.h"
18#include "senml_pack.h"
19
25
26 public:
28
29 protected:
30 SenMLBasePack *root; // the root document for which we are parsing. Used to search the up all the actuators.
32 SenMLBasePack *curPack; // used while searching, to store the current pack to use. init to root pack by default.
33 // Make it protected, so child parsers can easily access it without too much fuzz
34 String curRecName; // keeps a ref of the record name, for raising events for unknown records
35 String curPackName; // name of hte current pack to send the actuator to.
36
37 // looks up the pack object that has to contain the next field. This is in order
38 // to support multiple packs (gateway functionality)
39 void setCurrentPack(String &name);
40
41 void setCurrentRecord(int thingsmlIndex);
42
43 // look up a record with the spedified name in the current pack
44 void setCurrentRecord(String &name);
45};
46
47#endif // THINGSML_SENML_BASE_PARSER
Definition: senml_basepack.h:24
Definition: senml_base_parser.h:24
void setCurrentRecord(int thingsmlIndex)
Definition: senml_base_parser.cpp:60
String curRecName
Definition: senml_base_parser.h:34
SenMLBasePack * curPack
Definition: senml_base_parser.h:32
String curPackName
Definition: senml_base_parser.h:35
SenMLRecord * curRec
Definition: senml_base_parser.h:31
void setCurrentPack(String &name)
Definition: senml_base_parser.cpp:19
SenMLBasePack * root
Definition: senml_base_parser.h:27
SenMLBaseParser(SenMLBasePack *root)
Definition: senml_base_parser.h:27
Definition: senml_record.h:33
#define String
Definition: defaults.h:47