-
Notifications
You must be signed in to change notification settings - Fork 1
/
events_generated.h
132 lines (114 loc) · 3.78 KB
/
events_generated.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// automatically generated by the FlatBuffers compiler, do not modify
#ifndef FLATBUFFERS_GENERATED_EVENTS_H_
#define FLATBUFFERS_GENERATED_EVENTS_H_
#include "flatbuffers/flatbuffers.h"
struct Event;
struct EventPacket;
struct EventPacketBuilder;
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Event FLATBUFFERS_FINAL_CLASS {
private:
int64_t t_;
int16_t x_;
int16_t y_;
uint8_t on_;
int8_t padding0__; int16_t padding1__;
public:
Event() {
memset(static_cast<void *>(this), 0, sizeof(Event));
}
Event(int64_t _t, int16_t _x, int16_t _y, bool _on)
: t_(flatbuffers::EndianScalar(_t)),
x_(flatbuffers::EndianScalar(_x)),
y_(flatbuffers::EndianScalar(_y)),
on_(flatbuffers::EndianScalar(static_cast<uint8_t>(_on))),
padding0__(0),
padding1__(0) {
(void)padding0__; (void)padding1__;
}
int64_t t() const {
return flatbuffers::EndianScalar(t_);
}
int16_t x() const {
return flatbuffers::EndianScalar(x_);
}
int16_t y() const {
return flatbuffers::EndianScalar(y_);
}
bool on() const {
return flatbuffers::EndianScalar(on_) != 0;
}
};
FLATBUFFERS_STRUCT_END(Event, 16);
struct EventPacket FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef EventPacketBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_ELEMENTS = 4
};
const flatbuffers::Vector<const Event *> *elements() const {
return GetPointer<const flatbuffers::Vector<const Event *> *>(VT_ELEMENTS);
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyOffset(verifier, VT_ELEMENTS) &&
verifier.VerifyVector(elements()) &&
verifier.EndTable();
}
};
struct EventPacketBuilder {
typedef EventPacket Table;
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_elements(flatbuffers::Offset<flatbuffers::Vector<const Event *>> elements) {
fbb_.AddOffset(EventPacket::VT_ELEMENTS, elements);
}
explicit EventPacketBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
EventPacketBuilder &operator=(const EventPacketBuilder &);
flatbuffers::Offset<EventPacket> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<EventPacket>(end);
return o;
}
};
inline flatbuffers::Offset<EventPacket> CreateEventPacket(
flatbuffers::FlatBufferBuilder &_fbb,
flatbuffers::Offset<flatbuffers::Vector<const Event *>> elements = 0) {
EventPacketBuilder builder_(_fbb);
builder_.add_elements(elements);
return builder_.Finish();
}
inline flatbuffers::Offset<EventPacket> CreateEventPacketDirect(
flatbuffers::FlatBufferBuilder &_fbb,
const std::vector<Event> *elements = nullptr) {
auto elements__ = elements ? _fbb.CreateVectorOfStructs<Event>(*elements) : 0;
return CreateEventPacket(
_fbb,
elements__);
}
inline const EventPacket *GetEventPacket(const void *buf) {
return flatbuffers::GetRoot<EventPacket>(buf);
}
inline const EventPacket *GetSizePrefixedEventPacket(const void *buf) {
return flatbuffers::GetSizePrefixedRoot<EventPacket>(buf);
}
inline bool VerifyEventPacketBuffer(
flatbuffers::Verifier &verifier) {
return verifier.VerifyBuffer<EventPacket>(nullptr);
}
inline bool VerifySizePrefixedEventPacketBuffer(
flatbuffers::Verifier &verifier) {
return verifier.VerifySizePrefixedBuffer<EventPacket>(nullptr);
}
inline void FinishEventPacketBuffer(
flatbuffers::FlatBufferBuilder &fbb,
flatbuffers::Offset<EventPacket> root) {
fbb.Finish(root);
}
inline void FinishSizePrefixedEventPacketBuffer(
flatbuffers::FlatBufferBuilder &fbb,
flatbuffers::Offset<EventPacket> root) {
fbb.FinishSizePrefixed(root);
}
#endif // FLATBUFFERS_GENERATED_EVENTS_H_