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