-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStatusData.h
116 lines (112 loc) · 2.74 KB
/
StatusData.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#ifndef STATUSDATA_H
#define STATUSDATA_H
#include "BaseData.h"
class XdpMarketStatus : public XdpBaseData
{
public:
XdpMarketStatus() {}
XdpMarketStatus(char *buffer, const uint16_t length, const uint16_t offset) : XdpBaseData(buffer, length, offset) {}
uint16_t stateLevcel()
{
uint16_t val;
memcpy(&val, mBuffer + mOffset, sizeof(uint16_t));
return val;
}
uint8_t market()
{
uint8_t val;
memcpy(&val, mBuffer + mOffset + 2, sizeof(uint8_t));
return val;
}
uint8_t instrument()
{
uint8_t val;
memcpy(&val, mBuffer + mOffset + 3, sizeof(uint8_t));
return val;
}
uint32_t orderbookID()
{
uint32_t val;
memcpy(&val, mBuffer + mOffset + 4, sizeof(uint32_t));
return val;
}
uint16_t commodityCode()
{
uint16_t val;
memcpy(&val, mBuffer + mOffset + 8, sizeof(uint16_t));
return val;
}
std::string actualStartDate()
{
std::string val(mBuffer + mOffset + 12, 8);
return val;
}
std::string actualStartTime()
{
std::string val(mBuffer + mOffset + 20, 6);
return val;
}
std::string plannedStartDate()
{
std::string val(mBuffer + mOffset + 26, 8);
return val;
}
std::string plannedStartTime()
{
std::string val(mBuffer + mOffset + 34, 6);
return val;
}
uint16_t secondsToStateChange()
{
uint16_t val;
memcpy(&val, mBuffer + mOffset + 40, sizeof(uint16_t));
return val;
}
uint16_t state()
{
uint16_t val;
memcpy(&val, mBuffer + mOffset + 42, sizeof(uint16_t));
return val;
}
uint8_t piority()
{
uint8_t val;
memcpy(&val, mBuffer + mOffset + 44, sizeof(uint8_t));
return val;
}
};
class XdpSeriesStatus : public XdpBaseData
{
public:
XdpSeriesStatus() {}
XdpSeriesStatus(char *buffer, const uint16_t length, const uint16_t offset) : XdpBaseData(buffer, length, offset) {}
uint32_t orderbookID()
{
uint32_t val;
memcpy(&val, mBuffer + mOffset, sizeof(uint32_t));
return val;
}
std::string suspended()
{
std::string val(mBuffer + mOffset + 4, 1);
return val;
}
};
class XdpCommodityStatus : public XdpBaseData
{
public:
XdpCommodityStatus() {}
XdpCommodityStatus(char *buffer, const uint16_t length, const uint16_t offset) : XdpBaseData(buffer, length, offset) {}
uint16_t commodityCode()
{
uint16_t val;
memcpy(&val, mBuffer + mOffset, sizeof(uint16_t));
return val;
}
std::string suspended()
{
std::string val(mBuffer + mOffset + 2, 1);
return val;
}
};
#endif