LCOV - code coverage report
Current view: top level - ogr/ogrsf_frmts/flatgeobuf - header_generated.h (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 289 289 100.0 %
Date: 2024-05-14 23:54:21 Functions: 77 77 100.0 %

          Line data    Source code
       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             : {
      53             :     static const GeometryType values[] = {GeometryType::Unknown,
      54             :                                           GeometryType::Point,
      55             :                                           GeometryType::LineString,
      56             :                                           GeometryType::Polygon,
      57             :                                           GeometryType::MultiPoint,
      58             :                                           GeometryType::MultiLineString,
      59             :                                           GeometryType::MultiPolygon,
      60             :                                           GeometryType::GeometryCollection,
      61             :                                           GeometryType::CircularString,
      62             :                                           GeometryType::CompoundCurve,
      63             :                                           GeometryType::CurvePolygon,
      64             :                                           GeometryType::MultiCurve,
      65             :                                           GeometryType::MultiSurface,
      66             :                                           GeometryType::Curve,
      67             :                                           GeometryType::Surface,
      68             :                                           GeometryType::PolyhedralSurface,
      69             :                                           GeometryType::TIN,
      70             :                                           GeometryType::Triangle};
      71             :     return values;
      72             : }
      73             : 
      74             : inline const char *const *EnumNamesGeometryType()
      75             : {
      76             :     static const char *const names[19] = {"Unknown",
      77             :                                           "Point",
      78             :                                           "LineString",
      79             :                                           "Polygon",
      80             :                                           "MultiPoint",
      81             :                                           "MultiLineString",
      82             :                                           "MultiPolygon",
      83             :                                           "GeometryCollection",
      84             :                                           "CircularString",
      85             :                                           "CompoundCurve",
      86             :                                           "CurvePolygon",
      87             :                                           "MultiCurve",
      88             :                                           "MultiSurface",
      89             :                                           "Curve",
      90             :                                           "Surface",
      91             :                                           "PolyhedralSurface",
      92             :                                           "TIN",
      93             :                                           "Triangle",
      94             :                                           nullptr};
      95             :     return names;
      96             : }
      97             : 
      98             : inline const char *EnumNameGeometryType(GeometryType e)
      99             : {
     100             :     if (flatbuffers::IsOutRange(e, GeometryType::Unknown,
     101             :                                 GeometryType::Triangle))
     102             :         return "";
     103             :     const size_t index = static_cast<size_t>(e);
     104             :     return EnumNamesGeometryType()[index];
     105             : }
     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             : {
     130             :     static const ColumnType values[] = {
     131             :         ColumnType::Byte,  ColumnType::UByte,    ColumnType::Bool,
     132             :         ColumnType::Short, ColumnType::UShort,   ColumnType::Int,
     133             :         ColumnType::UInt,  ColumnType::Long,     ColumnType::ULong,
     134             :         ColumnType::Float, ColumnType::Double,   ColumnType::String,
     135             :         ColumnType::Json,  ColumnType::DateTime, ColumnType::Binary};
     136             :     return values;
     137             : }
     138             : 
     139             : inline const char *const *EnumNamesColumnType()
     140             : {
     141             :     static const char *const names[16] = {
     142             :         "Byte", "UByte",    "Bool",   "Short", "UShort", "Int",
     143             :         "UInt", "Long",     "ULong",  "Float", "Double", "String",
     144             :         "Json", "DateTime", "Binary", nullptr};
     145             :     return names;
     146             : }
     147             : 
     148             : inline const char *EnumNameColumnType(ColumnType e)
     149             : {
     150             :     if (flatbuffers::IsOutRange(e, ColumnType::Byte, ColumnType::Binary))
     151             :         return "";
     152             :     const size_t index = static_cast<size_t>(e);
     153             :     return EnumNamesColumnType()[index];
     154             : }
     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      131325 :     const flatbuffers::String *name() const
     176             :     {
     177      131325 :         return GetPointer<const flatbuffers::String *>(VT_NAME);
     178             :     }
     179             : 
     180      198493 :     FlatGeobuf::ColumnType type() const
     181             :     {
     182             :         return static_cast<FlatGeobuf::ColumnType>(
     183      198493 :             GetField<uint8_t>(VT_TYPE, 0));
     184             :     }
     185             : 
     186      131326 :     const flatbuffers::String *title() const
     187             :     {
     188      131326 :         return GetPointer<const flatbuffers::String *>(VT_TITLE);
     189             :     }
     190             : 
     191      131326 :     const flatbuffers::String *description() const
     192             :     {
     193      131326 :         return GetPointer<const flatbuffers::String *>(VT_DESCRIPTION);
     194             :     }
     195             : 
     196       65663 :     int32_t width() const
     197             :     {
     198       65663 :         return GetField<int32_t>(VT_WIDTH, -1);
     199             :     }
     200             : 
     201       65663 :     int32_t precision() const
     202             :     {
     203       65663 :         return GetField<int32_t>(VT_PRECISION, -1);
     204             :     }
     205             : 
     206       65663 :     int32_t scale() const
     207             :     {
     208       65663 :         return GetField<int32_t>(VT_SCALE, -1);
     209             :     }
     210             : 
     211       65663 :     bool nullable() const
     212             :     {
     213       65663 :         return GetField<uint8_t>(VT_NULLABLE, 1) != 0;
     214             :     }
     215             : 
     216       65663 :     bool unique() const
     217             :     {
     218       65663 :         return GetField<uint8_t>(VT_UNIQUE, 0) != 0;
     219             :     }
     220             : 
     221             :     bool primary_key() const
     222             :     {
     223             :         return GetField<uint8_t>(VT_PRIMARY_KEY, 0) != 0;
     224             :     }
     225             : 
     226       65662 :     const flatbuffers::String *metadata() const
     227             :     {
     228       65662 :         return GetPointer<const flatbuffers::String *>(VT_METADATA);
     229             :     }
     230             : 
     231       65662 :     bool Verify(flatbuffers::Verifier &verifier) const
     232             :     {
     233       65662 :         return VerifyTableStart(verifier) &&
     234       65662 :                VerifyOffsetRequired(verifier, VT_NAME) &&
     235       65662 :                verifier.VerifyString(name()) &&
     236       65662 :                VerifyField<uint8_t>(verifier, VT_TYPE, 1) &&
     237       65662 :                VerifyOffset(verifier, VT_TITLE) &&
     238       65662 :                verifier.VerifyString(title()) &&
     239       65662 :                VerifyOffset(verifier, VT_DESCRIPTION) &&
     240       65662 :                verifier.VerifyString(description()) &&
     241       65662 :                VerifyField<int32_t>(verifier, VT_WIDTH, 4) &&
     242       65662 :                VerifyField<int32_t>(verifier, VT_PRECISION, 4) &&
     243       65662 :                VerifyField<int32_t>(verifier, VT_SCALE, 4) &&
     244       65662 :                VerifyField<uint8_t>(verifier, VT_NULLABLE, 1) &&
     245       65662 :                VerifyField<uint8_t>(verifier, VT_UNIQUE, 1) &&
     246       65662 :                VerifyField<uint8_t>(verifier, VT_PRIMARY_KEY, 1) &&
     247       65662 :                VerifyOffset(verifier, VT_METADATA) &&
     248      131324 :                verifier.VerifyString(metadata()) && verifier.EndTable();
     249             :     }
     250             : };
     251             : 
     252             : struct ColumnBuilder
     253             : {
     254             :     typedef Column Table;
     255             :     flatbuffers::FlatBufferBuilder &fbb_;
     256             :     flatbuffers::uoffset_t start_;
     257             : 
     258      131398 :     void add_name(flatbuffers::Offset<flatbuffers::String> name)
     259             :     {
     260      131398 :         fbb_.AddOffset(Column::VT_NAME, name);
     261      131398 :     }
     262             : 
     263      131398 :     void add_type(FlatGeobuf::ColumnType type)
     264             :     {
     265      131398 :         fbb_.AddElement<uint8_t>(Column::VT_TYPE, static_cast<uint8_t>(type),
     266             :                                  0);
     267      131398 :     }
     268             : 
     269      131398 :     void add_title(flatbuffers::Offset<flatbuffers::String> title)
     270             :     {
     271      131398 :         fbb_.AddOffset(Column::VT_TITLE, title);
     272      131398 :     }
     273             : 
     274      131398 :     void add_description(flatbuffers::Offset<flatbuffers::String> description)
     275             :     {
     276      131398 :         fbb_.AddOffset(Column::VT_DESCRIPTION, description);
     277      131398 :     }
     278             : 
     279      131398 :     void add_width(int32_t width)
     280             :     {
     281      131398 :         fbb_.AddElement<int32_t>(Column::VT_WIDTH, width, -1);
     282      131398 :     }
     283             : 
     284      131398 :     void add_precision(int32_t precision)
     285             :     {
     286      131398 :         fbb_.AddElement<int32_t>(Column::VT_PRECISION, precision, -1);
     287      131398 :     }
     288             : 
     289      131398 :     void add_scale(int32_t scale)
     290             :     {
     291      131398 :         fbb_.AddElement<int32_t>(Column::VT_SCALE, scale, -1);
     292      131398 :     }
     293             : 
     294      131398 :     void add_nullable(bool nullable)
     295             :     {
     296      131398 :         fbb_.AddElement<uint8_t>(Column::VT_NULLABLE,
     297             :                                  static_cast<uint8_t>(nullable), 1);
     298      131398 :     }
     299             : 
     300      131398 :     void add_unique(bool unique)
     301             :     {
     302      131398 :         fbb_.AddElement<uint8_t>(Column::VT_UNIQUE,
     303             :                                  static_cast<uint8_t>(unique), 0);
     304      131398 :     }
     305             : 
     306      131398 :     void add_primary_key(bool primary_key)
     307             :     {
     308      131398 :         fbb_.AddElement<uint8_t>(Column::VT_PRIMARY_KEY,
     309             :                                  static_cast<uint8_t>(primary_key), 0);
     310      131398 :     }
     311             : 
     312      131398 :     void add_metadata(flatbuffers::Offset<flatbuffers::String> metadata)
     313             :     {
     314      131398 :         fbb_.AddOffset(Column::VT_METADATA, metadata);
     315      131398 :     }
     316             : 
     317      131398 :     explicit ColumnBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb)
     318             :     {
     319      131398 :         start_ = fbb_.StartTable();
     320      131398 :     }
     321             : 
     322      131398 :     flatbuffers::Offset<Column> Finish()
     323             :     {
     324      131398 :         const auto end = fbb_.EndTable(start_);
     325      131398 :         auto o = flatbuffers::Offset<Column>(end);
     326      131398 :         fbb_.Required(o, Column::VT_NAME);
     327      131398 :         return o;
     328             :     }
     329             : };
     330             : 
     331             : inline flatbuffers::Offset<Column>
     332      131398 : 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             : {
     342      131398 :     ColumnBuilder builder_(_fbb);
     343      131398 :     builder_.add_metadata(metadata);
     344      131398 :     builder_.add_scale(scale);
     345      131398 :     builder_.add_precision(precision);
     346      131398 :     builder_.add_width(width);
     347      131398 :     builder_.add_description(description);
     348      131398 :     builder_.add_title(title);
     349      131398 :     builder_.add_name(name);
     350      131398 :     builder_.add_primary_key(primary_key);
     351      131398 :     builder_.add_unique(unique);
     352      131398 :     builder_.add_nullable(nullable);
     353      131398 :     builder_.add_type(type);
     354      262796 :     return builder_.Finish();
     355             : }
     356             : 
     357      131398 : 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             : {
     365      131398 :     auto name__ = name ? _fbb.CreateString(name) : 0;
     366      131398 :     auto title__ = title ? _fbb.CreateString(title) : 0;
     367      131398 :     auto description__ = description ? _fbb.CreateString(description) : 0;
     368      131398 :     auto metadata__ = metadata ? _fbb.CreateString(metadata) : 0;
     369             :     return FlatGeobuf::CreateColumn(_fbb, name__, type, title__, description__,
     370             :                                     width, precision, scale, nullable, unique,
     371      262796 :                                     primary_key, metadata__);
     372             : }
     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          30 :     const flatbuffers::String *org() const
     389             :     {
     390          30 :         return GetPointer<const flatbuffers::String *>(VT_ORG);
     391             :     }
     392             : 
     393          15 :     int32_t code() const
     394             :     {
     395          15 :         return GetField<int32_t>(VT_CODE, 0);
     396             :     }
     397             : 
     398          15 :     const flatbuffers::String *name() const
     399             :     {
     400          15 :         return GetPointer<const flatbuffers::String *>(VT_NAME);
     401             :     }
     402             : 
     403          15 :     const flatbuffers::String *description() const
     404             :     {
     405          15 :         return GetPointer<const flatbuffers::String *>(VT_DESCRIPTION);
     406             :     }
     407             : 
     408          30 :     const flatbuffers::String *wkt() const
     409             :     {
     410          30 :         return GetPointer<const flatbuffers::String *>(VT_WKT);
     411             :     }
     412             : 
     413          15 :     const flatbuffers::String *code_string() const
     414             :     {
     415          15 :         return GetPointer<const flatbuffers::String *>(VT_CODE_STRING);
     416             :     }
     417             : 
     418          15 :     bool Verify(flatbuffers::Verifier &verifier) const
     419             :     {
     420          30 :         return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_ORG) &&
     421          15 :                verifier.VerifyString(org()) &&
     422          15 :                VerifyField<int32_t>(verifier, VT_CODE, 4) &&
     423          15 :                VerifyOffset(verifier, VT_NAME) &&
     424          15 :                verifier.VerifyString(name()) &&
     425          15 :                VerifyOffset(verifier, VT_DESCRIPTION) &&
     426          15 :                verifier.VerifyString(description()) &&
     427          15 :                VerifyOffset(verifier, VT_WKT) && verifier.VerifyString(wkt()) &&
     428          15 :                VerifyOffset(verifier, VT_CODE_STRING) &&
     429          30 :                verifier.VerifyString(code_string()) && verifier.EndTable();
     430             :     }
     431             : };
     432             : 
     433             : struct CrsBuilder
     434             : {
     435             :     typedef Crs Table;
     436             :     flatbuffers::FlatBufferBuilder &fbb_;
     437             :     flatbuffers::uoffset_t start_;
     438             : 
     439          10 :     void add_org(flatbuffers::Offset<flatbuffers::String> org)
     440             :     {
     441          10 :         fbb_.AddOffset(Crs::VT_ORG, org);
     442          10 :     }
     443             : 
     444          10 :     void add_code(int32_t code)
     445             :     {
     446          10 :         fbb_.AddElement<int32_t>(Crs::VT_CODE, code, 0);
     447          10 :     }
     448             : 
     449          10 :     void add_name(flatbuffers::Offset<flatbuffers::String> name)
     450             :     {
     451          10 :         fbb_.AddOffset(Crs::VT_NAME, name);
     452          10 :     }
     453             : 
     454          10 :     void add_description(flatbuffers::Offset<flatbuffers::String> description)
     455             :     {
     456          10 :         fbb_.AddOffset(Crs::VT_DESCRIPTION, description);
     457          10 :     }
     458             : 
     459          10 :     void add_wkt(flatbuffers::Offset<flatbuffers::String> wkt)
     460             :     {
     461          10 :         fbb_.AddOffset(Crs::VT_WKT, wkt);
     462          10 :     }
     463             : 
     464          10 :     void add_code_string(flatbuffers::Offset<flatbuffers::String> code_string)
     465             :     {
     466          10 :         fbb_.AddOffset(Crs::VT_CODE_STRING, code_string);
     467          10 :     }
     468             : 
     469          10 :     explicit CrsBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb)
     470             :     {
     471          10 :         start_ = fbb_.StartTable();
     472          10 :     }
     473             : 
     474          10 :     flatbuffers::Offset<Crs> Finish()
     475             :     {
     476          10 :         const auto end = fbb_.EndTable(start_);
     477          10 :         auto o = flatbuffers::Offset<Crs>(end);
     478          10 :         return o;
     479             :     }
     480             : };
     481             : 
     482             : inline flatbuffers::Offset<Crs>
     483          10 : 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             : {
     490          10 :     CrsBuilder builder_(_fbb);
     491          10 :     builder_.add_code_string(code_string);
     492          10 :     builder_.add_wkt(wkt);
     493          10 :     builder_.add_description(description);
     494          10 :     builder_.add_name(name);
     495          10 :     builder_.add_code(code);
     496          10 :     builder_.add_org(org);
     497          20 :     return builder_.Finish();
     498             : }
     499             : 
     500             : inline flatbuffers::Offset<Crs>
     501          10 : 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             : {
     506          10 :     auto org__ = org ? _fbb.CreateString(org) : 0;
     507          10 :     auto name__ = name ? _fbb.CreateString(name) : 0;
     508          10 :     auto description__ = description ? _fbb.CreateString(description) : 0;
     509          10 :     auto wkt__ = wkt ? _fbb.CreateString(wkt) : 0;
     510          10 :     auto code_string__ = code_string ? _fbb.CreateString(code_string) : 0;
     511             :     return FlatGeobuf::CreateCrs(_fbb, org__, code, name__, description__,
     512          20 :                                  wkt__, code_string__);
     513             : }
     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         431 :     const flatbuffers::String *name() const
     538             :     {
     539         431 :         return GetPointer<const flatbuffers::String *>(VT_NAME);
     540             :     }
     541             : 
     542         289 :     const flatbuffers::Vector<double> *envelope() const
     543             :     {
     544         289 :         return GetPointer<const flatbuffers::Vector<double> *>(VT_ENVELOPE);
     545             :     }
     546             : 
     547         145 :     FlatGeobuf::GeometryType geometry_type() const
     548             :     {
     549             :         return static_cast<FlatGeobuf::GeometryType>(
     550         145 :             GetField<uint8_t>(VT_GEOMETRY_TYPE, 0));
     551             :     }
     552             : 
     553         145 :     bool has_z() const
     554             :     {
     555         145 :         return GetField<uint8_t>(VT_HAS_Z, 0) != 0;
     556             :     }
     557             : 
     558         145 :     bool has_m() const
     559             :     {
     560         145 :         return GetField<uint8_t>(VT_HAS_M, 0) != 0;
     561             :     }
     562             : 
     563         145 :     bool has_t() const
     564             :     {
     565         145 :         return GetField<uint8_t>(VT_HAS_T, 0) != 0;
     566             :     }
     567             : 
     568             :     bool has_tm() const
     569             :     {
     570             :         return GetField<uint8_t>(VT_HAS_TM, 0) != 0;
     571             :     }
     572             : 
     573             :     const flatbuffers::Vector<flatbuffers::Offset<FlatGeobuf::Column>> *
     574       67600 :     columns() const
     575             :     {
     576             :         return GetPointer<const flatbuffers::Vector<
     577       67600 :             flatbuffers::Offset<FlatGeobuf::Column>> *>(VT_COLUMNS);
     578             :     }
     579             : 
     580         634 :     uint64_t features_count() const
     581             :     {
     582         634 :         return GetField<uint64_t>(VT_FEATURES_COUNT, 0);
     583             :     }
     584             : 
     585         401 :     uint16_t index_node_size() const
     586             :     {
     587         401 :         return GetField<uint16_t>(VT_INDEX_NODE_SIZE, 16);
     588             :     }
     589             : 
     590         289 :     const FlatGeobuf::Crs *crs() const
     591             :     {
     592         289 :         return GetPointer<const FlatGeobuf::Crs *>(VT_CRS);
     593             :     }
     594             : 
     595         289 :     const flatbuffers::String *title() const
     596             :     {
     597         289 :         return GetPointer<const flatbuffers::String *>(VT_TITLE);
     598             :     }
     599             : 
     600         289 :     const flatbuffers::String *description() const
     601             :     {
     602         289 :         return GetPointer<const flatbuffers::String *>(VT_DESCRIPTION);
     603             :     }
     604             : 
     605         289 :     const flatbuffers::String *metadata() const
     606             :     {
     607         289 :         return GetPointer<const flatbuffers::String *>(VT_METADATA);
     608             :     }
     609             : 
     610         144 :     bool Verify(flatbuffers::Verifier &verifier) const
     611             :     {
     612         288 :         return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_NAME) &&
     613         144 :                verifier.VerifyString(name()) &&
     614         144 :                VerifyOffset(verifier, VT_ENVELOPE) &&
     615         144 :                verifier.VerifyVector(envelope()) &&
     616         144 :                VerifyField<uint8_t>(verifier, VT_GEOMETRY_TYPE, 1) &&
     617         144 :                VerifyField<uint8_t>(verifier, VT_HAS_Z, 1) &&
     618         144 :                VerifyField<uint8_t>(verifier, VT_HAS_M, 1) &&
     619         144 :                VerifyField<uint8_t>(verifier, VT_HAS_T, 1) &&
     620         144 :                VerifyField<uint8_t>(verifier, VT_HAS_TM, 1) &&
     621         144 :                VerifyOffset(verifier, VT_COLUMNS) &&
     622         144 :                verifier.VerifyVector(columns()) &&
     623         144 :                verifier.VerifyVectorOfTables(columns()) &&
     624         144 :                VerifyField<uint64_t>(verifier, VT_FEATURES_COUNT, 8) &&
     625         144 :                VerifyField<uint16_t>(verifier, VT_INDEX_NODE_SIZE, 2) &&
     626         144 :                VerifyOffset(verifier, VT_CRS) && verifier.VerifyTable(crs()) &&
     627         144 :                VerifyOffset(verifier, VT_TITLE) &&
     628         144 :                verifier.VerifyString(title()) &&
     629         144 :                VerifyOffset(verifier, VT_DESCRIPTION) &&
     630         144 :                verifier.VerifyString(description()) &&
     631         144 :                VerifyOffset(verifier, VT_METADATA) &&
     632         288 :                verifier.VerifyString(metadata()) && verifier.EndTable();
     633             :     }
     634             : };
     635             : 
     636             : struct HeaderBuilder
     637             : {
     638             :     typedef Header Table;
     639             :     flatbuffers::FlatBufferBuilder &fbb_;
     640             :     flatbuffers::uoffset_t start_;
     641             : 
     642         307 :     void add_name(flatbuffers::Offset<flatbuffers::String> name)
     643             :     {
     644         307 :         fbb_.AddOffset(Header::VT_NAME, name);
     645         307 :     }
     646             : 
     647         307 :     void add_envelope(flatbuffers::Offset<flatbuffers::Vector<double>> envelope)
     648             :     {
     649         307 :         fbb_.AddOffset(Header::VT_ENVELOPE, envelope);
     650         307 :     }
     651             : 
     652         307 :     void add_geometry_type(FlatGeobuf::GeometryType geometry_type)
     653             :     {
     654         307 :         fbb_.AddElement<uint8_t>(Header::VT_GEOMETRY_TYPE,
     655             :                                  static_cast<uint8_t>(geometry_type), 0);
     656         307 :     }
     657             : 
     658         307 :     void add_has_z(bool has_z)
     659             :     {
     660         307 :         fbb_.AddElement<uint8_t>(Header::VT_HAS_Z, static_cast<uint8_t>(has_z),
     661             :                                  0);
     662         307 :     }
     663             : 
     664         307 :     void add_has_m(bool has_m)
     665             :     {
     666         307 :         fbb_.AddElement<uint8_t>(Header::VT_HAS_M, static_cast<uint8_t>(has_m),
     667             :                                  0);
     668         307 :     }
     669             : 
     670         307 :     void add_has_t(bool has_t)
     671             :     {
     672         307 :         fbb_.AddElement<uint8_t>(Header::VT_HAS_T, static_cast<uint8_t>(has_t),
     673             :                                  0);
     674         307 :     }
     675             : 
     676         307 :     void add_has_tm(bool has_tm)
     677             :     {
     678         307 :         fbb_.AddElement<uint8_t>(Header::VT_HAS_TM,
     679             :                                  static_cast<uint8_t>(has_tm), 0);
     680         307 :     }
     681             : 
     682             :     void
     683         307 :     add_columns(flatbuffers::Offset<
     684             :                 flatbuffers::Vector<flatbuffers::Offset<FlatGeobuf::Column>>>
     685             :                     columns)
     686             :     {
     687         307 :         fbb_.AddOffset(Header::VT_COLUMNS, columns);
     688         307 :     }
     689             : 
     690         307 :     void add_features_count(uint64_t features_count)
     691             :     {
     692         307 :         fbb_.AddElement<uint64_t>(Header::VT_FEATURES_COUNT, features_count, 0);
     693         307 :     }
     694             : 
     695         307 :     void add_index_node_size(uint16_t index_node_size)
     696             :     {
     697         307 :         fbb_.AddElement<uint16_t>(Header::VT_INDEX_NODE_SIZE, index_node_size,
     698             :                                   16);
     699         307 :     }
     700             : 
     701         307 :     void add_crs(flatbuffers::Offset<FlatGeobuf::Crs> crs)
     702             :     {
     703         307 :         fbb_.AddOffset(Header::VT_CRS, crs);
     704         307 :     }
     705             : 
     706         307 :     void add_title(flatbuffers::Offset<flatbuffers::String> title)
     707             :     {
     708         307 :         fbb_.AddOffset(Header::VT_TITLE, title);
     709         307 :     }
     710             : 
     711         307 :     void add_description(flatbuffers::Offset<flatbuffers::String> description)
     712             :     {
     713         307 :         fbb_.AddOffset(Header::VT_DESCRIPTION, description);
     714         307 :     }
     715             : 
     716         307 :     void add_metadata(flatbuffers::Offset<flatbuffers::String> metadata)
     717             :     {
     718         307 :         fbb_.AddOffset(Header::VT_METADATA, metadata);
     719         307 :     }
     720             : 
     721         307 :     explicit HeaderBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb)
     722             :     {
     723         307 :         start_ = fbb_.StartTable();
     724         307 :     }
     725             : 
     726         307 :     flatbuffers::Offset<Header> Finish()
     727             :     {
     728         307 :         const auto end = fbb_.EndTable(start_);
     729         307 :         auto o = flatbuffers::Offset<Header>(end);
     730         307 :         return o;
     731             :     }
     732             : };
     733             : 
     734         307 : 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             : {
     750         307 :     HeaderBuilder builder_(_fbb);
     751         307 :     builder_.add_features_count(features_count);
     752         307 :     builder_.add_metadata(metadata);
     753         307 :     builder_.add_description(description);
     754         307 :     builder_.add_title(title);
     755         307 :     builder_.add_crs(crs);
     756         307 :     builder_.add_columns(columns);
     757         307 :     builder_.add_envelope(envelope);
     758         307 :     builder_.add_name(name);
     759         307 :     builder_.add_index_node_size(index_node_size);
     760         307 :     builder_.add_has_tm(has_tm);
     761         307 :     builder_.add_has_t(has_t);
     762         307 :     builder_.add_has_m(has_m);
     763         307 :     builder_.add_has_z(has_z);
     764         307 :     builder_.add_geometry_type(geometry_type);
     765         614 :     return builder_.Finish();
     766             : }
     767             : 
     768         307 : 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             : {
     780         307 :     auto name__ = name ? _fbb.CreateString(name) : 0;
     781         307 :     auto envelope__ = envelope ? _fbb.CreateVector<double>(*envelope) : 0;
     782             :     auto columns__ =
     783             :         columns ? _fbb.CreateVector<flatbuffers::Offset<FlatGeobuf::Column>>(
     784         307 :                       *columns)
     785         307 :                 : 0;
     786         307 :     auto title__ = title ? _fbb.CreateString(title) : 0;
     787         307 :     auto description__ = description ? _fbb.CreateString(description) : 0;
     788         307 :     auto metadata__ = metadata ? _fbb.CreateString(metadata) : 0;
     789             :     return FlatGeobuf::CreateHeader(_fbb, name__, envelope__, geometry_type,
     790             :                                     has_z, has_m, has_t, has_tm, columns__,
     791             :                                     features_count, index_node_size, crs,
     792         614 :                                     title__, description__, metadata__);
     793             : }
     794             : 
     795         145 : inline const FlatGeobuf::Header *GetHeader(const void *buf)
     796             : {
     797         145 :     return flatbuffers::GetRoot<FlatGeobuf::Header>(buf);
     798             : }
     799             : 
     800             : inline const FlatGeobuf::Header *GetSizePrefixedHeader(const void *buf)
     801             : {
     802             :     return flatbuffers::GetSizePrefixedRoot<FlatGeobuf::Header>(buf);
     803             : }
     804             : 
     805         144 : inline bool VerifyHeaderBuffer(flatbuffers::Verifier &verifier)
     806             : {
     807         144 :     return verifier.VerifyBuffer<FlatGeobuf::Header>(nullptr);
     808             : }
     809             : 
     810             : inline bool VerifySizePrefixedHeaderBuffer(flatbuffers::Verifier &verifier)
     811             : {
     812             :     return verifier.VerifySizePrefixedBuffer<FlatGeobuf::Header>(nullptr);
     813             : }
     814             : 
     815             : inline void FinishHeaderBuffer(flatbuffers::FlatBufferBuilder &fbb,
     816             :                                flatbuffers::Offset<FlatGeobuf::Header> root)
     817             : {
     818             :     fbb.Finish(root);
     819             : }
     820             : 
     821             : inline void
     822             : FinishSizePrefixedHeaderBuffer(flatbuffers::FlatBufferBuilder &fbb,
     823             :                                flatbuffers::Offset<FlatGeobuf::Header> root)
     824             : {
     825             :     fbb.FinishSizePrefixed(root);
     826             : }
     827             : 
     828             : }  // namespace FlatGeobuf
     829             : 
     830             : #endif  // FLATBUFFERS_GENERATED_HEADER_FLATGEOBUF_H_

Generated by: LCOV version 1.14