-
Notifications
You must be signed in to change notification settings - Fork 1
/
trigger_generated.h
204 lines (181 loc) · 6.29 KB
/
trigger_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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
// automatically generated by the FlatBuffers compiler, do not modify
#ifndef FLATBUFFERS_GENERATED_TRIGGER_H_
#define FLATBUFFERS_GENERATED_TRIGGER_H_
#include "flatbuffers/flatbuffers.h"
struct Trigger;
struct TriggerBuilder;
struct TriggerPacket;
struct TriggerPacketBuilder;
enum TriggerSource {
TriggerSource_TimestampReset = 0,
TriggerSource_ExternalSignalRisingEdge = 1,
TriggerSource_ExternalSignalFallingEdge = 2,
TriggerSource_ExternalSignalPulse = 3,
TriggerSource_ExternalGeneratorRisingEdge = 4,
TriggerSource_ExternalGeneratorFallingEdge = 5,
TriggerSource_FrameBegin = 6,
TriggerSource_FrameEnd = 7,
TriggerSource_ExposureBegin = 8,
TriggerSource_ExposureEnd = 9,
TriggerSource_MIN = TriggerSource_TimestampReset,
TriggerSource_MAX = TriggerSource_ExposureEnd
};
inline const TriggerSource (&EnumValuesTriggerSource())[10] {
static const TriggerSource values[] = {
TriggerSource_TimestampReset,
TriggerSource_ExternalSignalRisingEdge,
TriggerSource_ExternalSignalFallingEdge,
TriggerSource_ExternalSignalPulse,
TriggerSource_ExternalGeneratorRisingEdge,
TriggerSource_ExternalGeneratorFallingEdge,
TriggerSource_FrameBegin,
TriggerSource_FrameEnd,
TriggerSource_ExposureBegin,
TriggerSource_ExposureEnd
};
return values;
}
inline const char * const *EnumNamesTriggerSource() {
static const char * const names[11] = {
"TimestampReset",
"ExternalSignalRisingEdge",
"ExternalSignalFallingEdge",
"ExternalSignalPulse",
"ExternalGeneratorRisingEdge",
"ExternalGeneratorFallingEdge",
"FrameBegin",
"FrameEnd",
"ExposureBegin",
"ExposureEnd",
nullptr
};
return names;
}
inline const char *EnumNameTriggerSource(TriggerSource e) {
if (flatbuffers::IsOutRange(e, TriggerSource_TimestampReset, TriggerSource_ExposureEnd)) return "";
const size_t index = static_cast<size_t>(e);
return EnumNamesTriggerSource()[index];
}
struct Trigger FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef TriggerBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_T = 4,
VT_SOURCE = 6
};
int64_t t() const {
return GetField<int64_t>(VT_T, 0);
}
TriggerSource source() const {
return static_cast<TriggerSource>(GetField<int8_t>(VT_SOURCE, 0));
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<int64_t>(verifier, VT_T) &&
VerifyField<int8_t>(verifier, VT_SOURCE) &&
verifier.EndTable();
}
};
struct TriggerBuilder {
typedef Trigger Table;
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_t(int64_t t) {
fbb_.AddElement<int64_t>(Trigger::VT_T, t, 0);
}
void add_source(TriggerSource source) {
fbb_.AddElement<int8_t>(Trigger::VT_SOURCE, static_cast<int8_t>(source), 0);
}
explicit TriggerBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
TriggerBuilder &operator=(const TriggerBuilder &);
flatbuffers::Offset<Trigger> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<Trigger>(end);
return o;
}
};
inline flatbuffers::Offset<Trigger> CreateTrigger(
flatbuffers::FlatBufferBuilder &_fbb,
int64_t t = 0,
TriggerSource source = TriggerSource_TimestampReset) {
TriggerBuilder builder_(_fbb);
builder_.add_t(t);
builder_.add_source(source);
return builder_.Finish();
}
struct TriggerPacket FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
typedef TriggerPacketBuilder Builder;
enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
VT_ELEMENTS = 4
};
const flatbuffers::Vector<flatbuffers::Offset<Trigger>> *elements() const {
return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<Trigger>> *>(VT_ELEMENTS);
}
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyOffset(verifier, VT_ELEMENTS) &&
verifier.VerifyVector(elements()) &&
verifier.VerifyVectorOfTables(elements()) &&
verifier.EndTable();
}
};
struct TriggerPacketBuilder {
typedef TriggerPacket Table;
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_elements(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Trigger>>> elements) {
fbb_.AddOffset(TriggerPacket::VT_ELEMENTS, elements);
}
explicit TriggerPacketBuilder(flatbuffers::FlatBufferBuilder &_fbb)
: fbb_(_fbb) {
start_ = fbb_.StartTable();
}
TriggerPacketBuilder &operator=(const TriggerPacketBuilder &);
flatbuffers::Offset<TriggerPacket> Finish() {
const auto end = fbb_.EndTable(start_);
auto o = flatbuffers::Offset<TriggerPacket>(end);
return o;
}
};
inline flatbuffers::Offset<TriggerPacket> CreateTriggerPacket(
flatbuffers::FlatBufferBuilder &_fbb,
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<Trigger>>> elements = 0) {
TriggerPacketBuilder builder_(_fbb);
builder_.add_elements(elements);
return builder_.Finish();
}
inline flatbuffers::Offset<TriggerPacket> CreateTriggerPacketDirect(
flatbuffers::FlatBufferBuilder &_fbb,
const std::vector<flatbuffers::Offset<Trigger>> *elements = nullptr) {
auto elements__ = elements ? _fbb.CreateVector<flatbuffers::Offset<Trigger>>(*elements) : 0;
return CreateTriggerPacket(
_fbb,
elements__);
}
inline const TriggerPacket *GetTriggerPacket(const void *buf) {
return flatbuffers::GetRoot<TriggerPacket>(buf);
}
inline const TriggerPacket *GetSizePrefixedTriggerPacket(const void *buf) {
return flatbuffers::GetSizePrefixedRoot<TriggerPacket>(buf);
}
inline bool VerifyTriggerPacketBuffer(
flatbuffers::Verifier &verifier) {
return verifier.VerifyBuffer<TriggerPacket>(nullptr);
}
inline bool VerifySizePrefixedTriggerPacketBuffer(
flatbuffers::Verifier &verifier) {
return verifier.VerifySizePrefixedBuffer<TriggerPacket>(nullptr);
}
inline void FinishTriggerPacketBuffer(
flatbuffers::FlatBufferBuilder &fbb,
flatbuffers::Offset<TriggerPacket> root) {
fbb.Finish(root);
}
inline void FinishSizePrefixedTriggerPacketBuffer(
flatbuffers::FlatBufferBuilder &fbb,
flatbuffers::Offset<TriggerPacket> root) {
fbb.FinishSizePrefixed(root);
}
#endif // FLATBUFFERS_GENERATED_TRIGGER_H_