-
Notifications
You must be signed in to change notification settings - Fork 0
/
ZVV.h
52 lines (46 loc) · 1.12 KB
/
ZVV.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
#pragma once
#include <JsonListener.h>
#include <JsonStreamingParser.h>
const int Max_Number_Journeys = 10; //<- can be modified
//
// Class to hold ZVV reading
//
class ZVVReading
{
public:
// Data
int type;
String line;
int a_countdown;
int countdown;
String direction_to;
bool operator> (const ZVVReading &rhs)
{
return ((countdown << 8) + line) > ((rhs.countdown << 8) + rhs.line);
}
};
class ZVVClient: public JsonListener {
private:
String currentKey;
String currentParent[10];
int hierarchy_level = -1;
int count = -1;
public:
ZVVClient();
ZVVReading ZVVReadings[Max_Number_Journeys];
void doUpdate(String url);
void sortZVVreadings();
virtual void whitespace(char c);
virtual void startDocument();
virtual void key(String key);
virtual void value(String value);
virtual void endArray();
virtual void endObject();
virtual void endDocument();
virtual void startArray();
virtual void startObject();
int getType(int i);
String getLine(int i);
int getCountdown(int i);
String getDirection(int i);
};