/src/MapServer/src/flatgeobuf/header_generated.h
Line | Count | Source |
1 | | // automatically generated by the FlatBuffers compiler, do not modify |
2 | | |
3 | | |
4 | | #ifndef FLATBUFFERS_GENERATED_HEADER_FLATGEOBUF_H_ |
5 | | #define FLATBUFFERS_GENERATED_HEADER_FLATGEOBUF_H_ |
6 | | |
7 | | #include "flatbuffers/flatbuffers.h" |
8 | | |
9 | | // Ensure the included flatbuffers.h is the same version as when this file was |
10 | | // generated, otherwise it may not be compatible. |
11 | | static_assert(FLATBUFFERS_VERSION_MAJOR == 2 && |
12 | | FLATBUFFERS_VERSION_MINOR == 0 && |
13 | | FLATBUFFERS_VERSION_REVISION == 6, |
14 | | "Non-compatible flatbuffers version included"); |
15 | | |
16 | | namespace mapserver { |
17 | | namespace FlatGeobuf { |
18 | | |
19 | | struct Column; |
20 | | struct ColumnBuilder; |
21 | | |
22 | | struct Crs; |
23 | | struct CrsBuilder; |
24 | | |
25 | | struct Header; |
26 | | struct HeaderBuilder; |
27 | | |
28 | | enum class GeometryType : uint8_t { |
29 | | Unknown = 0, |
30 | | Point = 1, |
31 | | LineString = 2, |
32 | | Polygon = 3, |
33 | | MultiPoint = 4, |
34 | | MultiLineString = 5, |
35 | | MultiPolygon = 6, |
36 | | GeometryCollection = 7, |
37 | | CircularString = 8, |
38 | | CompoundCurve = 9, |
39 | | CurvePolygon = 10, |
40 | | MultiCurve = 11, |
41 | | MultiSurface = 12, |
42 | | Curve = 13, |
43 | | Surface = 14, |
44 | | PolyhedralSurface = 15, |
45 | | TIN = 16, |
46 | | Triangle = 17, |
47 | | MIN = Unknown, |
48 | | MAX = Triangle |
49 | | }; |
50 | | |
51 | 0 | inline const GeometryType (&EnumValuesGeometryType())[18] { |
52 | 0 | static const GeometryType values[] = { |
53 | 0 | GeometryType::Unknown, |
54 | 0 | GeometryType::Point, |
55 | 0 | GeometryType::LineString, |
56 | 0 | GeometryType::Polygon, |
57 | 0 | GeometryType::MultiPoint, |
58 | 0 | GeometryType::MultiLineString, |
59 | 0 | GeometryType::MultiPolygon, |
60 | 0 | GeometryType::GeometryCollection, |
61 | 0 | GeometryType::CircularString, |
62 | 0 | GeometryType::CompoundCurve, |
63 | 0 | GeometryType::CurvePolygon, |
64 | 0 | GeometryType::MultiCurve, |
65 | 0 | GeometryType::MultiSurface, |
66 | 0 | GeometryType::Curve, |
67 | 0 | GeometryType::Surface, |
68 | 0 | GeometryType::PolyhedralSurface, |
69 | 0 | GeometryType::TIN, |
70 | 0 | GeometryType::Triangle |
71 | 0 | }; |
72 | 0 | return values; |
73 | 0 | } |
74 | | |
75 | 0 | inline const char * const *EnumNamesGeometryType() { |
76 | 0 | static const char * const names[19] = { |
77 | 0 | "Unknown", |
78 | 0 | "Point", |
79 | 0 | "LineString", |
80 | 0 | "Polygon", |
81 | 0 | "MultiPoint", |
82 | 0 | "MultiLineString", |
83 | 0 | "MultiPolygon", |
84 | 0 | "GeometryCollection", |
85 | 0 | "CircularString", |
86 | 0 | "CompoundCurve", |
87 | 0 | "CurvePolygon", |
88 | 0 | "MultiCurve", |
89 | 0 | "MultiSurface", |
90 | 0 | "Curve", |
91 | 0 | "Surface", |
92 | 0 | "PolyhedralSurface", |
93 | 0 | "TIN", |
94 | 0 | "Triangle", |
95 | 0 | nullptr |
96 | 0 | }; |
97 | 0 | return names; |
98 | 0 | } |
99 | | |
100 | 0 | inline const char *EnumNameGeometryType(GeometryType e) { |
101 | 0 | if (flatbuffers::IsOutRange(e, GeometryType::Unknown, GeometryType::Triangle)) return ""; |
102 | 0 | const size_t index = static_cast<size_t>(e); |
103 | 0 | return EnumNamesGeometryType()[index]; |
104 | 0 | } |
105 | | |
106 | | enum class ColumnType : uint8_t { |
107 | | Byte = 0, |
108 | | UByte = 1, |
109 | | Bool = 2, |
110 | | Short = 3, |
111 | | UShort = 4, |
112 | | Int = 5, |
113 | | UInt = 6, |
114 | | Long = 7, |
115 | | ULong = 8, |
116 | | Float = 9, |
117 | | Double = 10, |
118 | | String = 11, |
119 | | Json = 12, |
120 | | DateTime = 13, |
121 | | Binary = 14, |
122 | | MIN = Byte, |
123 | | MAX = Binary |
124 | | }; |
125 | | |
126 | 0 | inline const ColumnType (&EnumValuesColumnType())[15] { |
127 | 0 | static const ColumnType values[] = { |
128 | 0 | ColumnType::Byte, |
129 | 0 | ColumnType::UByte, |
130 | 0 | ColumnType::Bool, |
131 | 0 | ColumnType::Short, |
132 | 0 | ColumnType::UShort, |
133 | 0 | ColumnType::Int, |
134 | 0 | ColumnType::UInt, |
135 | 0 | ColumnType::Long, |
136 | 0 | ColumnType::ULong, |
137 | 0 | ColumnType::Float, |
138 | 0 | ColumnType::Double, |
139 | 0 | ColumnType::String, |
140 | 0 | ColumnType::Json, |
141 | 0 | ColumnType::DateTime, |
142 | 0 | ColumnType::Binary |
143 | 0 | }; |
144 | 0 | return values; |
145 | 0 | } |
146 | | |
147 | 0 | inline const char * const *EnumNamesColumnType() { |
148 | 0 | static const char * const names[16] = { |
149 | 0 | "Byte", |
150 | 0 | "UByte", |
151 | 0 | "Bool", |
152 | 0 | "Short", |
153 | 0 | "UShort", |
154 | 0 | "Int", |
155 | 0 | "UInt", |
156 | 0 | "Long", |
157 | 0 | "ULong", |
158 | 0 | "Float", |
159 | 0 | "Double", |
160 | 0 | "String", |
161 | 0 | "Json", |
162 | 0 | "DateTime", |
163 | 0 | "Binary", |
164 | 0 | nullptr |
165 | 0 | }; |
166 | 0 | return names; |
167 | 0 | } |
168 | | |
169 | 0 | inline const char *EnumNameColumnType(ColumnType e) { |
170 | 0 | if (flatbuffers::IsOutRange(e, ColumnType::Byte, ColumnType::Binary)) return ""; |
171 | 0 | const size_t index = static_cast<size_t>(e); |
172 | 0 | return EnumNamesColumnType()[index]; |
173 | 0 | } |
174 | | |
175 | | struct Column FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
176 | | typedef ColumnBuilder Builder; |
177 | | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
178 | | VT_NAME = 4, |
179 | | VT_TYPE = 6, |
180 | | VT_TITLE = 8, |
181 | | VT_DESCRIPTION = 10, |
182 | | VT_WIDTH = 12, |
183 | | VT_PRECISION = 14, |
184 | | VT_SCALE = 16, |
185 | | VT_NULLABLE = 18, |
186 | | VT_UNIQUE = 20, |
187 | | VT_PRIMARY_KEY = 22, |
188 | | VT_METADATA = 24 |
189 | | }; |
190 | 0 | const flatbuffers::String *name() const { |
191 | 0 | return GetPointer<const flatbuffers::String *>(VT_NAME); |
192 | 0 | } |
193 | 0 | FlatGeobuf::ColumnType type() const { |
194 | 0 | return static_cast<FlatGeobuf::ColumnType>(GetField<uint8_t>(VT_TYPE, 0)); |
195 | 0 | } |
196 | 0 | const flatbuffers::String *title() const { |
197 | 0 | return GetPointer<const flatbuffers::String *>(VT_TITLE); |
198 | 0 | } |
199 | 0 | const flatbuffers::String *description() const { |
200 | 0 | return GetPointer<const flatbuffers::String *>(VT_DESCRIPTION); |
201 | 0 | } |
202 | 0 | int32_t width() const { |
203 | 0 | return GetField<int32_t>(VT_WIDTH, -1); |
204 | 0 | } |
205 | 0 | int32_t precision() const { |
206 | 0 | return GetField<int32_t>(VT_PRECISION, -1); |
207 | 0 | } |
208 | 0 | int32_t scale() const { |
209 | 0 | return GetField<int32_t>(VT_SCALE, -1); |
210 | 0 | } |
211 | 0 | bool nullable() const { |
212 | 0 | return GetField<uint8_t>(VT_NULLABLE, 1) != 0; |
213 | 0 | } |
214 | 0 | bool unique() const { |
215 | 0 | return GetField<uint8_t>(VT_UNIQUE, 0) != 0; |
216 | 0 | } |
217 | 0 | bool primary_key() const { |
218 | 0 | return GetField<uint8_t>(VT_PRIMARY_KEY, 0) != 0; |
219 | 0 | } |
220 | 0 | const flatbuffers::String *metadata() const { |
221 | 0 | return GetPointer<const flatbuffers::String *>(VT_METADATA); |
222 | 0 | } |
223 | 0 | bool Verify(flatbuffers::Verifier &verifier) const { |
224 | 0 | return VerifyTableStart(verifier) && |
225 | 0 | VerifyOffsetRequired(verifier, VT_NAME) && |
226 | 0 | verifier.VerifyString(name()) && |
227 | 0 | VerifyField<uint8_t>(verifier, VT_TYPE, 1) && |
228 | 0 | VerifyOffset(verifier, VT_TITLE) && |
229 | 0 | verifier.VerifyString(title()) && |
230 | 0 | VerifyOffset(verifier, VT_DESCRIPTION) && |
231 | 0 | verifier.VerifyString(description()) && |
232 | 0 | VerifyField<int32_t>(verifier, VT_WIDTH, 4) && |
233 | 0 | VerifyField<int32_t>(verifier, VT_PRECISION, 4) && |
234 | 0 | VerifyField<int32_t>(verifier, VT_SCALE, 4) && |
235 | 0 | VerifyField<uint8_t>(verifier, VT_NULLABLE, 1) && |
236 | 0 | VerifyField<uint8_t>(verifier, VT_UNIQUE, 1) && |
237 | 0 | VerifyField<uint8_t>(verifier, VT_PRIMARY_KEY, 1) && |
238 | 0 | VerifyOffset(verifier, VT_METADATA) && |
239 | 0 | verifier.VerifyString(metadata()) && |
240 | 0 | verifier.EndTable(); |
241 | 0 | } |
242 | | }; |
243 | | |
244 | | struct ColumnBuilder { |
245 | | typedef Column Table; |
246 | | flatbuffers::FlatBufferBuilder &fbb_; |
247 | | flatbuffers::uoffset_t start_; |
248 | 0 | void add_name(flatbuffers::Offset<flatbuffers::String> name) { |
249 | 0 | fbb_.AddOffset(Column::VT_NAME, name); |
250 | 0 | } |
251 | 0 | void add_type(FlatGeobuf::ColumnType type) { |
252 | 0 | fbb_.AddElement<uint8_t>(Column::VT_TYPE, static_cast<uint8_t>(type), 0); |
253 | 0 | } |
254 | 0 | void add_title(flatbuffers::Offset<flatbuffers::String> title) { |
255 | 0 | fbb_.AddOffset(Column::VT_TITLE, title); |
256 | 0 | } |
257 | 0 | void add_description(flatbuffers::Offset<flatbuffers::String> description) { |
258 | 0 | fbb_.AddOffset(Column::VT_DESCRIPTION, description); |
259 | 0 | } |
260 | 0 | void add_width(int32_t width) { |
261 | 0 | fbb_.AddElement<int32_t>(Column::VT_WIDTH, width, -1); |
262 | 0 | } |
263 | 0 | void add_precision(int32_t precision) { |
264 | 0 | fbb_.AddElement<int32_t>(Column::VT_PRECISION, precision, -1); |
265 | 0 | } |
266 | 0 | void add_scale(int32_t scale) { |
267 | 0 | fbb_.AddElement<int32_t>(Column::VT_SCALE, scale, -1); |
268 | 0 | } |
269 | 0 | void add_nullable(bool nullable) { |
270 | 0 | fbb_.AddElement<uint8_t>(Column::VT_NULLABLE, static_cast<uint8_t>(nullable), 1); |
271 | 0 | } |
272 | 0 | void add_unique(bool unique) { |
273 | 0 | fbb_.AddElement<uint8_t>(Column::VT_UNIQUE, static_cast<uint8_t>(unique), 0); |
274 | 0 | } |
275 | 0 | void add_primary_key(bool primary_key) { |
276 | 0 | fbb_.AddElement<uint8_t>(Column::VT_PRIMARY_KEY, static_cast<uint8_t>(primary_key), 0); |
277 | 0 | } |
278 | 0 | void add_metadata(flatbuffers::Offset<flatbuffers::String> metadata) { |
279 | 0 | fbb_.AddOffset(Column::VT_METADATA, metadata); |
280 | 0 | } |
281 | | explicit ColumnBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
282 | 0 | : fbb_(_fbb) { |
283 | 0 | start_ = fbb_.StartTable(); |
284 | 0 | } |
285 | 0 | flatbuffers::Offset<Column> Finish() { |
286 | 0 | const auto end = fbb_.EndTable(start_); |
287 | 0 | auto o = flatbuffers::Offset<Column>(end); |
288 | 0 | fbb_.Required(o, Column::VT_NAME); |
289 | 0 | return o; |
290 | 0 | } |
291 | | }; |
292 | | |
293 | | inline flatbuffers::Offset<Column> CreateColumn( |
294 | | flatbuffers::FlatBufferBuilder &_fbb, |
295 | | flatbuffers::Offset<flatbuffers::String> name = 0, |
296 | | FlatGeobuf::ColumnType type = FlatGeobuf::ColumnType::Byte, |
297 | | flatbuffers::Offset<flatbuffers::String> title = 0, |
298 | | flatbuffers::Offset<flatbuffers::String> description = 0, |
299 | | int32_t width = -1, |
300 | | int32_t precision = -1, |
301 | | int32_t scale = -1, |
302 | | bool nullable = true, |
303 | | bool unique = false, |
304 | | bool primary_key = false, |
305 | 0 | flatbuffers::Offset<flatbuffers::String> metadata = 0) { |
306 | 0 | ColumnBuilder builder_(_fbb); |
307 | 0 | builder_.add_metadata(metadata); |
308 | 0 | builder_.add_scale(scale); |
309 | 0 | builder_.add_precision(precision); |
310 | 0 | builder_.add_width(width); |
311 | 0 | builder_.add_description(description); |
312 | 0 | builder_.add_title(title); |
313 | 0 | builder_.add_name(name); |
314 | 0 | builder_.add_primary_key(primary_key); |
315 | 0 | builder_.add_unique(unique); |
316 | 0 | builder_.add_nullable(nullable); |
317 | 0 | builder_.add_type(type); |
318 | 0 | return builder_.Finish(); |
319 | 0 | } |
320 | | |
321 | | inline flatbuffers::Offset<Column> CreateColumnDirect( |
322 | | flatbuffers::FlatBufferBuilder &_fbb, |
323 | | const char *name = nullptr, |
324 | | FlatGeobuf::ColumnType type = FlatGeobuf::ColumnType::Byte, |
325 | | const char *title = nullptr, |
326 | | const char *description = nullptr, |
327 | | int32_t width = -1, |
328 | | int32_t precision = -1, |
329 | | int32_t scale = -1, |
330 | | bool nullable = true, |
331 | | bool unique = false, |
332 | | bool primary_key = false, |
333 | 0 | const char *metadata = nullptr) { |
334 | 0 | auto name__ = name ? _fbb.CreateString(name) : 0; |
335 | 0 | auto title__ = title ? _fbb.CreateString(title) : 0; |
336 | 0 | auto description__ = description ? _fbb.CreateString(description) : 0; |
337 | 0 | auto metadata__ = metadata ? _fbb.CreateString(metadata) : 0; |
338 | 0 | return FlatGeobuf::CreateColumn( |
339 | 0 | _fbb, |
340 | 0 | name__, |
341 | 0 | type, |
342 | 0 | title__, |
343 | 0 | description__, |
344 | 0 | width, |
345 | 0 | precision, |
346 | 0 | scale, |
347 | 0 | nullable, |
348 | 0 | unique, |
349 | 0 | primary_key, |
350 | 0 | metadata__); |
351 | 0 | } |
352 | | |
353 | | struct Crs FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
354 | | typedef CrsBuilder Builder; |
355 | | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
356 | | VT_ORG = 4, |
357 | | VT_CODE = 6, |
358 | | VT_NAME = 8, |
359 | | VT_DESCRIPTION = 10, |
360 | | VT_WKT = 12, |
361 | | VT_CODE_STRING = 14 |
362 | | }; |
363 | 0 | const flatbuffers::String *org() const { |
364 | 0 | return GetPointer<const flatbuffers::String *>(VT_ORG); |
365 | 0 | } |
366 | 0 | int32_t code() const { |
367 | 0 | return GetField<int32_t>(VT_CODE, 0); |
368 | 0 | } |
369 | 0 | const flatbuffers::String *name() const { |
370 | 0 | return GetPointer<const flatbuffers::String *>(VT_NAME); |
371 | 0 | } |
372 | 0 | const flatbuffers::String *description() const { |
373 | 0 | return GetPointer<const flatbuffers::String *>(VT_DESCRIPTION); |
374 | 0 | } |
375 | 0 | const flatbuffers::String *wkt() const { |
376 | 0 | return GetPointer<const flatbuffers::String *>(VT_WKT); |
377 | 0 | } |
378 | 0 | const flatbuffers::String *code_string() const { |
379 | 0 | return GetPointer<const flatbuffers::String *>(VT_CODE_STRING); |
380 | 0 | } |
381 | 0 | bool Verify(flatbuffers::Verifier &verifier) const { |
382 | 0 | return VerifyTableStart(verifier) && |
383 | 0 | VerifyOffset(verifier, VT_ORG) && |
384 | 0 | verifier.VerifyString(org()) && |
385 | 0 | VerifyField<int32_t>(verifier, VT_CODE, 4) && |
386 | 0 | VerifyOffset(verifier, VT_NAME) && |
387 | 0 | verifier.VerifyString(name()) && |
388 | 0 | VerifyOffset(verifier, VT_DESCRIPTION) && |
389 | 0 | verifier.VerifyString(description()) && |
390 | 0 | VerifyOffset(verifier, VT_WKT) && |
391 | 0 | verifier.VerifyString(wkt()) && |
392 | 0 | VerifyOffset(verifier, VT_CODE_STRING) && |
393 | 0 | verifier.VerifyString(code_string()) && |
394 | 0 | verifier.EndTable(); |
395 | 0 | } |
396 | | }; |
397 | | |
398 | | struct CrsBuilder { |
399 | | typedef Crs Table; |
400 | | flatbuffers::FlatBufferBuilder &fbb_; |
401 | | flatbuffers::uoffset_t start_; |
402 | 0 | void add_org(flatbuffers::Offset<flatbuffers::String> org) { |
403 | 0 | fbb_.AddOffset(Crs::VT_ORG, org); |
404 | 0 | } |
405 | 0 | void add_code(int32_t code) { |
406 | 0 | fbb_.AddElement<int32_t>(Crs::VT_CODE, code, 0); |
407 | 0 | } |
408 | 0 | void add_name(flatbuffers::Offset<flatbuffers::String> name) { |
409 | 0 | fbb_.AddOffset(Crs::VT_NAME, name); |
410 | 0 | } |
411 | 0 | void add_description(flatbuffers::Offset<flatbuffers::String> description) { |
412 | 0 | fbb_.AddOffset(Crs::VT_DESCRIPTION, description); |
413 | 0 | } |
414 | 0 | void add_wkt(flatbuffers::Offset<flatbuffers::String> wkt) { |
415 | 0 | fbb_.AddOffset(Crs::VT_WKT, wkt); |
416 | 0 | } |
417 | 0 | void add_code_string(flatbuffers::Offset<flatbuffers::String> code_string) { |
418 | 0 | fbb_.AddOffset(Crs::VT_CODE_STRING, code_string); |
419 | 0 | } |
420 | | explicit CrsBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
421 | 0 | : fbb_(_fbb) { |
422 | 0 | start_ = fbb_.StartTable(); |
423 | 0 | } |
424 | 0 | flatbuffers::Offset<Crs> Finish() { |
425 | 0 | const auto end = fbb_.EndTable(start_); |
426 | 0 | auto o = flatbuffers::Offset<Crs>(end); |
427 | 0 | return o; |
428 | 0 | } |
429 | | }; |
430 | | |
431 | | inline flatbuffers::Offset<Crs> CreateCrs( |
432 | | flatbuffers::FlatBufferBuilder &_fbb, |
433 | | flatbuffers::Offset<flatbuffers::String> org = 0, |
434 | | int32_t code = 0, |
435 | | flatbuffers::Offset<flatbuffers::String> name = 0, |
436 | | flatbuffers::Offset<flatbuffers::String> description = 0, |
437 | | flatbuffers::Offset<flatbuffers::String> wkt = 0, |
438 | 0 | flatbuffers::Offset<flatbuffers::String> code_string = 0) { |
439 | 0 | CrsBuilder builder_(_fbb); |
440 | 0 | builder_.add_code_string(code_string); |
441 | 0 | builder_.add_wkt(wkt); |
442 | 0 | builder_.add_description(description); |
443 | 0 | builder_.add_name(name); |
444 | 0 | builder_.add_code(code); |
445 | 0 | builder_.add_org(org); |
446 | 0 | return builder_.Finish(); |
447 | 0 | } |
448 | | |
449 | | inline flatbuffers::Offset<Crs> CreateCrsDirect( |
450 | | flatbuffers::FlatBufferBuilder &_fbb, |
451 | | const char *org = nullptr, |
452 | | int32_t code = 0, |
453 | | const char *name = nullptr, |
454 | | const char *description = nullptr, |
455 | | const char *wkt = nullptr, |
456 | 0 | const char *code_string = nullptr) { |
457 | 0 | auto org__ = org ? _fbb.CreateString(org) : 0; |
458 | 0 | auto name__ = name ? _fbb.CreateString(name) : 0; |
459 | 0 | auto description__ = description ? _fbb.CreateString(description) : 0; |
460 | 0 | auto wkt__ = wkt ? _fbb.CreateString(wkt) : 0; |
461 | 0 | auto code_string__ = code_string ? _fbb.CreateString(code_string) : 0; |
462 | 0 | return FlatGeobuf::CreateCrs( |
463 | 0 | _fbb, |
464 | 0 | org__, |
465 | 0 | code, |
466 | 0 | name__, |
467 | 0 | description__, |
468 | 0 | wkt__, |
469 | 0 | code_string__); |
470 | 0 | } |
471 | | |
472 | | struct Header FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
473 | | typedef HeaderBuilder Builder; |
474 | | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
475 | | VT_NAME = 4, |
476 | | VT_ENVELOPE = 6, |
477 | | VT_GEOMETRY_TYPE = 8, |
478 | | VT_HAS_Z = 10, |
479 | | VT_HAS_M = 12, |
480 | | VT_HAS_T = 14, |
481 | | VT_HAS_TM = 16, |
482 | | VT_COLUMNS = 18, |
483 | | VT_FEATURES_COUNT = 20, |
484 | | VT_INDEX_NODE_SIZE = 22, |
485 | | VT_CRS = 24, |
486 | | VT_TITLE = 26, |
487 | | VT_DESCRIPTION = 28, |
488 | | VT_METADATA = 30 |
489 | | }; |
490 | 0 | const flatbuffers::String *name() const { |
491 | 0 | return GetPointer<const flatbuffers::String *>(VT_NAME); |
492 | 0 | } |
493 | 0 | const flatbuffers::Vector<double> *envelope() const { |
494 | 0 | return GetPointer<const flatbuffers::Vector<double> *>(VT_ENVELOPE); |
495 | 0 | } |
496 | 0 | FlatGeobuf::GeometryType geometry_type() const { |
497 | 0 | return static_cast<FlatGeobuf::GeometryType>(GetField<uint8_t>(VT_GEOMETRY_TYPE, 0)); |
498 | 0 | } |
499 | 0 | bool has_z() const { |
500 | 0 | return GetField<uint8_t>(VT_HAS_Z, 0) != 0; |
501 | 0 | } |
502 | 0 | bool has_m() const { |
503 | 0 | return GetField<uint8_t>(VT_HAS_M, 0) != 0; |
504 | 0 | } |
505 | 0 | bool has_t() const { |
506 | 0 | return GetField<uint8_t>(VT_HAS_T, 0) != 0; |
507 | 0 | } |
508 | 0 | bool has_tm() const { |
509 | 0 | return GetField<uint8_t>(VT_HAS_TM, 0) != 0; |
510 | 0 | } |
511 | 0 | const flatbuffers::Vector<flatbuffers::Offset<FlatGeobuf::Column>> *columns() const { |
512 | 0 | return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<FlatGeobuf::Column>> *>(VT_COLUMNS); |
513 | 0 | } |
514 | 0 | uint64_t features_count() const { |
515 | 0 | return GetField<uint64_t>(VT_FEATURES_COUNT, 0); |
516 | 0 | } |
517 | 0 | uint16_t index_node_size() const { |
518 | 0 | return GetField<uint16_t>(VT_INDEX_NODE_SIZE, 16); |
519 | 0 | } |
520 | 0 | const FlatGeobuf::Crs *crs() const { |
521 | 0 | return GetPointer<const FlatGeobuf::Crs *>(VT_CRS); |
522 | 0 | } |
523 | 0 | const flatbuffers::String *title() const { |
524 | 0 | return GetPointer<const flatbuffers::String *>(VT_TITLE); |
525 | 0 | } |
526 | 0 | const flatbuffers::String *description() const { |
527 | 0 | return GetPointer<const flatbuffers::String *>(VT_DESCRIPTION); |
528 | 0 | } |
529 | 0 | const flatbuffers::String *metadata() const { |
530 | 0 | return GetPointer<const flatbuffers::String *>(VT_METADATA); |
531 | 0 | } |
532 | 0 | bool Verify(flatbuffers::Verifier &verifier) const { |
533 | 0 | return VerifyTableStart(verifier) && |
534 | 0 | VerifyOffset(verifier, VT_NAME) && |
535 | 0 | verifier.VerifyString(name()) && |
536 | 0 | VerifyOffset(verifier, VT_ENVELOPE) && |
537 | 0 | verifier.VerifyVector(envelope()) && |
538 | 0 | VerifyField<uint8_t>(verifier, VT_GEOMETRY_TYPE, 1) && |
539 | 0 | VerifyField<uint8_t>(verifier, VT_HAS_Z, 1) && |
540 | 0 | VerifyField<uint8_t>(verifier, VT_HAS_M, 1) && |
541 | 0 | VerifyField<uint8_t>(verifier, VT_HAS_T, 1) && |
542 | 0 | VerifyField<uint8_t>(verifier, VT_HAS_TM, 1) && |
543 | 0 | VerifyOffset(verifier, VT_COLUMNS) && |
544 | 0 | verifier.VerifyVector(columns()) && |
545 | 0 | verifier.VerifyVectorOfTables(columns()) && |
546 | 0 | VerifyField<uint64_t>(verifier, VT_FEATURES_COUNT, 8) && |
547 | 0 | VerifyField<uint16_t>(verifier, VT_INDEX_NODE_SIZE, 2) && |
548 | 0 | VerifyOffset(verifier, VT_CRS) && |
549 | 0 | verifier.VerifyTable(crs()) && |
550 | 0 | VerifyOffset(verifier, VT_TITLE) && |
551 | 0 | verifier.VerifyString(title()) && |
552 | 0 | VerifyOffset(verifier, VT_DESCRIPTION) && |
553 | 0 | verifier.VerifyString(description()) && |
554 | 0 | VerifyOffset(verifier, VT_METADATA) && |
555 | 0 | verifier.VerifyString(metadata()) && |
556 | 0 | verifier.EndTable(); |
557 | 0 | } |
558 | | }; |
559 | | |
560 | | struct HeaderBuilder { |
561 | | typedef Header Table; |
562 | | flatbuffers::FlatBufferBuilder &fbb_; |
563 | | flatbuffers::uoffset_t start_; |
564 | 0 | void add_name(flatbuffers::Offset<flatbuffers::String> name) { |
565 | 0 | fbb_.AddOffset(Header::VT_NAME, name); |
566 | 0 | } |
567 | 0 | void add_envelope(flatbuffers::Offset<flatbuffers::Vector<double>> envelope) { |
568 | 0 | fbb_.AddOffset(Header::VT_ENVELOPE, envelope); |
569 | 0 | } |
570 | 0 | void add_geometry_type(FlatGeobuf::GeometryType geometry_type) { |
571 | 0 | fbb_.AddElement<uint8_t>(Header::VT_GEOMETRY_TYPE, static_cast<uint8_t>(geometry_type), 0); |
572 | 0 | } |
573 | 0 | void add_has_z(bool has_z) { |
574 | 0 | fbb_.AddElement<uint8_t>(Header::VT_HAS_Z, static_cast<uint8_t>(has_z), 0); |
575 | 0 | } |
576 | 0 | void add_has_m(bool has_m) { |
577 | 0 | fbb_.AddElement<uint8_t>(Header::VT_HAS_M, static_cast<uint8_t>(has_m), 0); |
578 | 0 | } |
579 | 0 | void add_has_t(bool has_t) { |
580 | 0 | fbb_.AddElement<uint8_t>(Header::VT_HAS_T, static_cast<uint8_t>(has_t), 0); |
581 | 0 | } |
582 | 0 | void add_has_tm(bool has_tm) { |
583 | 0 | fbb_.AddElement<uint8_t>(Header::VT_HAS_TM, static_cast<uint8_t>(has_tm), 0); |
584 | 0 | } |
585 | 0 | void add_columns(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<FlatGeobuf::Column>>> columns) { |
586 | 0 | fbb_.AddOffset(Header::VT_COLUMNS, columns); |
587 | 0 | } |
588 | 0 | void add_features_count(uint64_t features_count) { |
589 | 0 | fbb_.AddElement<uint64_t>(Header::VT_FEATURES_COUNT, features_count, 0); |
590 | 0 | } |
591 | 0 | void add_index_node_size(uint16_t index_node_size) { |
592 | 0 | fbb_.AddElement<uint16_t>(Header::VT_INDEX_NODE_SIZE, index_node_size, 16); |
593 | 0 | } |
594 | 0 | void add_crs(flatbuffers::Offset<FlatGeobuf::Crs> crs) { |
595 | 0 | fbb_.AddOffset(Header::VT_CRS, crs); |
596 | 0 | } |
597 | 0 | void add_title(flatbuffers::Offset<flatbuffers::String> title) { |
598 | 0 | fbb_.AddOffset(Header::VT_TITLE, title); |
599 | 0 | } |
600 | 0 | void add_description(flatbuffers::Offset<flatbuffers::String> description) { |
601 | 0 | fbb_.AddOffset(Header::VT_DESCRIPTION, description); |
602 | 0 | } |
603 | 0 | void add_metadata(flatbuffers::Offset<flatbuffers::String> metadata) { |
604 | 0 | fbb_.AddOffset(Header::VT_METADATA, metadata); |
605 | 0 | } |
606 | | explicit HeaderBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
607 | 0 | : fbb_(_fbb) { |
608 | 0 | start_ = fbb_.StartTable(); |
609 | 0 | } |
610 | 0 | flatbuffers::Offset<Header> Finish() { |
611 | 0 | const auto end = fbb_.EndTable(start_); |
612 | 0 | auto o = flatbuffers::Offset<Header>(end); |
613 | 0 | return o; |
614 | 0 | } |
615 | | }; |
616 | | |
617 | | inline flatbuffers::Offset<Header> CreateHeader( |
618 | | flatbuffers::FlatBufferBuilder &_fbb, |
619 | | flatbuffers::Offset<flatbuffers::String> name = 0, |
620 | | flatbuffers::Offset<flatbuffers::Vector<double>> envelope = 0, |
621 | | FlatGeobuf::GeometryType geometry_type = FlatGeobuf::GeometryType::Unknown, |
622 | | bool has_z = false, |
623 | | bool has_m = false, |
624 | | bool has_t = false, |
625 | | bool has_tm = false, |
626 | | flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<FlatGeobuf::Column>>> columns = 0, |
627 | | uint64_t features_count = 0, |
628 | | uint16_t index_node_size = 16, |
629 | | flatbuffers::Offset<FlatGeobuf::Crs> crs = 0, |
630 | | flatbuffers::Offset<flatbuffers::String> title = 0, |
631 | | flatbuffers::Offset<flatbuffers::String> description = 0, |
632 | 0 | flatbuffers::Offset<flatbuffers::String> metadata = 0) { |
633 | 0 | HeaderBuilder builder_(_fbb); |
634 | 0 | builder_.add_features_count(features_count); |
635 | 0 | builder_.add_metadata(metadata); |
636 | 0 | builder_.add_description(description); |
637 | 0 | builder_.add_title(title); |
638 | 0 | builder_.add_crs(crs); |
639 | 0 | builder_.add_columns(columns); |
640 | 0 | builder_.add_envelope(envelope); |
641 | 0 | builder_.add_name(name); |
642 | 0 | builder_.add_index_node_size(index_node_size); |
643 | 0 | builder_.add_has_tm(has_tm); |
644 | 0 | builder_.add_has_t(has_t); |
645 | 0 | builder_.add_has_m(has_m); |
646 | 0 | builder_.add_has_z(has_z); |
647 | 0 | builder_.add_geometry_type(geometry_type); |
648 | 0 | return builder_.Finish(); |
649 | 0 | } |
650 | | |
651 | | inline flatbuffers::Offset<Header> CreateHeaderDirect( |
652 | | flatbuffers::FlatBufferBuilder &_fbb, |
653 | | const char *name = nullptr, |
654 | | const std::vector<double> *envelope = nullptr, |
655 | | FlatGeobuf::GeometryType geometry_type = FlatGeobuf::GeometryType::Unknown, |
656 | | bool has_z = false, |
657 | | bool has_m = false, |
658 | | bool has_t = false, |
659 | | bool has_tm = false, |
660 | | const std::vector<flatbuffers::Offset<FlatGeobuf::Column>> *columns = nullptr, |
661 | | uint64_t features_count = 0, |
662 | | uint16_t index_node_size = 16, |
663 | | flatbuffers::Offset<FlatGeobuf::Crs> crs = 0, |
664 | | const char *title = nullptr, |
665 | | const char *description = nullptr, |
666 | 0 | const char *metadata = nullptr) { |
667 | 0 | auto name__ = name ? _fbb.CreateString(name) : 0; |
668 | 0 | auto envelope__ = envelope ? _fbb.CreateVector<double>(*envelope) : 0; |
669 | 0 | auto columns__ = columns ? _fbb.CreateVector<flatbuffers::Offset<FlatGeobuf::Column>>(*columns) : 0; |
670 | 0 | auto title__ = title ? _fbb.CreateString(title) : 0; |
671 | 0 | auto description__ = description ? _fbb.CreateString(description) : 0; |
672 | 0 | auto metadata__ = metadata ? _fbb.CreateString(metadata) : 0; |
673 | 0 | return FlatGeobuf::CreateHeader( |
674 | 0 | _fbb, |
675 | 0 | name__, |
676 | 0 | envelope__, |
677 | 0 | geometry_type, |
678 | 0 | has_z, |
679 | 0 | has_m, |
680 | 0 | has_t, |
681 | 0 | has_tm, |
682 | 0 | columns__, |
683 | 0 | features_count, |
684 | 0 | index_node_size, |
685 | 0 | crs, |
686 | 0 | title__, |
687 | 0 | description__, |
688 | 0 | metadata__); |
689 | 0 | } |
690 | | |
691 | 0 | inline const FlatGeobuf::Header *GetHeader(const void *buf) { |
692 | 0 | return flatbuffers::GetRoot<FlatGeobuf::Header>(buf); |
693 | 0 | } |
694 | | |
695 | 0 | inline const FlatGeobuf::Header *GetSizePrefixedHeader(const void *buf) { |
696 | 0 | return flatbuffers::GetSizePrefixedRoot<FlatGeobuf::Header>(buf); |
697 | 0 | } |
698 | | |
699 | | inline bool VerifyHeaderBuffer( |
700 | 0 | flatbuffers::Verifier &verifier) { |
701 | 0 | return verifier.VerifyBuffer<FlatGeobuf::Header>(nullptr); |
702 | 0 | } |
703 | | |
704 | | inline bool VerifySizePrefixedHeaderBuffer( |
705 | 0 | flatbuffers::Verifier &verifier) { |
706 | 0 | return verifier.VerifySizePrefixedBuffer<FlatGeobuf::Header>(nullptr); |
707 | 0 | } |
708 | | |
709 | | inline void FinishHeaderBuffer( |
710 | | flatbuffers::FlatBufferBuilder &fbb, |
711 | 0 | flatbuffers::Offset<FlatGeobuf::Header> root) { |
712 | 0 | fbb.Finish(root); |
713 | 0 | } |
714 | | |
715 | | inline void FinishSizePrefixedHeaderBuffer( |
716 | | flatbuffers::FlatBufferBuilder &fbb, |
717 | 0 | flatbuffers::Offset<FlatGeobuf::Header> root) { |
718 | 0 | fbb.FinishSizePrefixed(root); |
719 | 0 | } |
720 | | |
721 | | } // namespace FlatGeobuf |
722 | | } |
723 | | |
724 | | #endif // FLATBUFFERS_GENERATED_HEADER_FLATGEOBUF_H_ |