...

Text file src/github.com/google/flatbuffers/tests/cpp17/generated_cpp17/optional_scalars_generated.h

Documentation: github.com/google/flatbuffers/tests/cpp17/generated_cpp17

     1// automatically generated by the FlatBuffers compiler, do not modify
     2
     3
     4#ifndef FLATBUFFERS_GENERATED_OPTIONALSCALARS_OPTIONAL_SCALARS_H_
     5#define FLATBUFFERS_GENERATED_OPTIONALSCALARS_OPTIONAL_SCALARS_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.
    11static_assert(FLATBUFFERS_VERSION_MAJOR == 23 &&
    12              FLATBUFFERS_VERSION_MINOR == 5 &&
    13              FLATBUFFERS_VERSION_REVISION == 26,
    14             "Non-compatible flatbuffers version included");
    15
    16namespace optional_scalars {
    17
    18struct ScalarStuff;
    19struct ScalarStuffBuilder;
    20struct ScalarStuffT;
    21
    22inline const ::flatbuffers::TypeTable *ScalarStuffTypeTable();
    23
    24enum class OptionalByte : int8_t {
    25  None = 0,
    26  One = 1,
    27  Two = 2,
    28  MIN = None,
    29  MAX = Two
    30};
    31
    32inline const OptionalByte (&EnumValuesOptionalByte())[3] {
    33  static const OptionalByte values[] = {
    34    OptionalByte::None,
    35    OptionalByte::One,
    36    OptionalByte::Two
    37  };
    38  return values;
    39}
    40
    41inline const char * const *EnumNamesOptionalByte() {
    42  static const char * const names[4] = {
    43    "None",
    44    "One",
    45    "Two",
    46    nullptr
    47  };
    48  return names;
    49}
    50
    51inline const char *EnumNameOptionalByte(OptionalByte e) {
    52  if (::flatbuffers::IsOutRange(e, OptionalByte::None, OptionalByte::Two)) return "";
    53  const size_t index = static_cast<size_t>(e);
    54  return EnumNamesOptionalByte()[index];
    55}
    56
    57struct ScalarStuffT : public ::flatbuffers::NativeTable {
    58  typedef ScalarStuff TableType;
    59  int8_t just_i8 = 0;
    60  ::flatbuffers::Optional<int8_t> maybe_i8 = ::flatbuffers::nullopt;
    61  int8_t default_i8 = 42;
    62  uint8_t just_u8 = 0;
    63  ::flatbuffers::Optional<uint8_t> maybe_u8 = ::flatbuffers::nullopt;
    64  uint8_t default_u8 = 42;
    65  int16_t just_i16 = 0;
    66  ::flatbuffers::Optional<int16_t> maybe_i16 = ::flatbuffers::nullopt;
    67  int16_t default_i16 = 42;
    68  uint16_t just_u16 = 0;
    69  ::flatbuffers::Optional<uint16_t> maybe_u16 = ::flatbuffers::nullopt;
    70  uint16_t default_u16 = 42;
    71  int32_t just_i32 = 0;
    72  ::flatbuffers::Optional<int32_t> maybe_i32 = ::flatbuffers::nullopt;
    73  int32_t default_i32 = 42;
    74  uint32_t just_u32 = 0;
    75  ::flatbuffers::Optional<uint32_t> maybe_u32 = ::flatbuffers::nullopt;
    76  uint32_t default_u32 = 42;
    77  int64_t just_i64 = 0;
    78  ::flatbuffers::Optional<int64_t> maybe_i64 = ::flatbuffers::nullopt;
    79  int64_t default_i64 = 42LL;
    80  uint64_t just_u64 = 0;
    81  ::flatbuffers::Optional<uint64_t> maybe_u64 = ::flatbuffers::nullopt;
    82  uint64_t default_u64 = 42ULL;
    83  float just_f32 = 0.0f;
    84  ::flatbuffers::Optional<float> maybe_f32 = ::flatbuffers::nullopt;
    85  float default_f32 = 42.0f;
    86  double just_f64 = 0.0;
    87  ::flatbuffers::Optional<double> maybe_f64 = ::flatbuffers::nullopt;
    88  double default_f64 = 42.0;
    89  bool just_bool = false;
    90  ::flatbuffers::Optional<bool> maybe_bool = ::flatbuffers::nullopt;
    91  bool default_bool = true;
    92  optional_scalars::OptionalByte just_enum = optional_scalars::OptionalByte::None;
    93  ::flatbuffers::Optional<optional_scalars::OptionalByte> maybe_enum = ::flatbuffers::nullopt;
    94  optional_scalars::OptionalByte default_enum = optional_scalars::OptionalByte::One;
    95};
    96
    97struct ScalarStuff FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
    98  typedef ScalarStuffT NativeTableType;
    99  typedef ScalarStuffBuilder Builder;
   100  struct Traits;
   101  static const ::flatbuffers::TypeTable *MiniReflectTypeTable() {
   102    return ScalarStuffTypeTable();
   103  }
   104  enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
   105    VT_JUST_I8 = 4,
   106    VT_MAYBE_I8 = 6,
   107    VT_DEFAULT_I8 = 8,
   108    VT_JUST_U8 = 10,
   109    VT_MAYBE_U8 = 12,
   110    VT_DEFAULT_U8 = 14,
   111    VT_JUST_I16 = 16,
   112    VT_MAYBE_I16 = 18,
   113    VT_DEFAULT_I16 = 20,
   114    VT_JUST_U16 = 22,
   115    VT_MAYBE_U16 = 24,
   116    VT_DEFAULT_U16 = 26,
   117    VT_JUST_I32 = 28,
   118    VT_MAYBE_I32 = 30,
   119    VT_DEFAULT_I32 = 32,
   120    VT_JUST_U32 = 34,
   121    VT_MAYBE_U32 = 36,
   122    VT_DEFAULT_U32 = 38,
   123    VT_JUST_I64 = 40,
   124    VT_MAYBE_I64 = 42,
   125    VT_DEFAULT_I64 = 44,
   126    VT_JUST_U64 = 46,
   127    VT_MAYBE_U64 = 48,
   128    VT_DEFAULT_U64 = 50,
   129    VT_JUST_F32 = 52,
   130    VT_MAYBE_F32 = 54,
   131    VT_DEFAULT_F32 = 56,
   132    VT_JUST_F64 = 58,
   133    VT_MAYBE_F64 = 60,
   134    VT_DEFAULT_F64 = 62,
   135    VT_JUST_BOOL = 64,
   136    VT_MAYBE_BOOL = 66,
   137    VT_DEFAULT_BOOL = 68,
   138    VT_JUST_ENUM = 70,
   139    VT_MAYBE_ENUM = 72,
   140    VT_DEFAULT_ENUM = 74
   141  };
   142  int8_t just_i8() const {
   143    return GetField<int8_t>(VT_JUST_I8, 0);
   144  }
   145  bool mutate_just_i8(int8_t _just_i8 = 0) {
   146    return SetField<int8_t>(VT_JUST_I8, _just_i8, 0);
   147  }
   148  ::flatbuffers::Optional<int8_t> maybe_i8() const {
   149    return GetOptional<int8_t, int8_t>(VT_MAYBE_I8);
   150  }
   151  bool mutate_maybe_i8(int8_t _maybe_i8) {
   152    return SetField<int8_t>(VT_MAYBE_I8, _maybe_i8);
   153  }
   154  int8_t default_i8() const {
   155    return GetField<int8_t>(VT_DEFAULT_I8, 42);
   156  }
   157  bool mutate_default_i8(int8_t _default_i8 = 42) {
   158    return SetField<int8_t>(VT_DEFAULT_I8, _default_i8, 42);
   159  }
   160  uint8_t just_u8() const {
   161    return GetField<uint8_t>(VT_JUST_U8, 0);
   162  }
   163  bool mutate_just_u8(uint8_t _just_u8 = 0) {
   164    return SetField<uint8_t>(VT_JUST_U8, _just_u8, 0);
   165  }
   166  ::flatbuffers::Optional<uint8_t> maybe_u8() const {
   167    return GetOptional<uint8_t, uint8_t>(VT_MAYBE_U8);
   168  }
   169  bool mutate_maybe_u8(uint8_t _maybe_u8) {
   170    return SetField<uint8_t>(VT_MAYBE_U8, _maybe_u8);
   171  }
   172  uint8_t default_u8() const {
   173    return GetField<uint8_t>(VT_DEFAULT_U8, 42);
   174  }
   175  bool mutate_default_u8(uint8_t _default_u8 = 42) {
   176    return SetField<uint8_t>(VT_DEFAULT_U8, _default_u8, 42);
   177  }
   178  int16_t just_i16() const {
   179    return GetField<int16_t>(VT_JUST_I16, 0);
   180  }
   181  bool mutate_just_i16(int16_t _just_i16 = 0) {
   182    return SetField<int16_t>(VT_JUST_I16, _just_i16, 0);
   183  }
   184  ::flatbuffers::Optional<int16_t> maybe_i16() const {
   185    return GetOptional<int16_t, int16_t>(VT_MAYBE_I16);
   186  }
   187  bool mutate_maybe_i16(int16_t _maybe_i16) {
   188    return SetField<int16_t>(VT_MAYBE_I16, _maybe_i16);
   189  }
   190  int16_t default_i16() const {
   191    return GetField<int16_t>(VT_DEFAULT_I16, 42);
   192  }
   193  bool mutate_default_i16(int16_t _default_i16 = 42) {
   194    return SetField<int16_t>(VT_DEFAULT_I16, _default_i16, 42);
   195  }
   196  uint16_t just_u16() const {
   197    return GetField<uint16_t>(VT_JUST_U16, 0);
   198  }
   199  bool mutate_just_u16(uint16_t _just_u16 = 0) {
   200    return SetField<uint16_t>(VT_JUST_U16, _just_u16, 0);
   201  }
   202  ::flatbuffers::Optional<uint16_t> maybe_u16() const {
   203    return GetOptional<uint16_t, uint16_t>(VT_MAYBE_U16);
   204  }
   205  bool mutate_maybe_u16(uint16_t _maybe_u16) {
   206    return SetField<uint16_t>(VT_MAYBE_U16, _maybe_u16);
   207  }
   208  uint16_t default_u16() const {
   209    return GetField<uint16_t>(VT_DEFAULT_U16, 42);
   210  }
   211  bool mutate_default_u16(uint16_t _default_u16 = 42) {
   212    return SetField<uint16_t>(VT_DEFAULT_U16, _default_u16, 42);
   213  }
   214  int32_t just_i32() const {
   215    return GetField<int32_t>(VT_JUST_I32, 0);
   216  }
   217  bool mutate_just_i32(int32_t _just_i32 = 0) {
   218    return SetField<int32_t>(VT_JUST_I32, _just_i32, 0);
   219  }
   220  ::flatbuffers::Optional<int32_t> maybe_i32() const {
   221    return GetOptional<int32_t, int32_t>(VT_MAYBE_I32);
   222  }
   223  bool mutate_maybe_i32(int32_t _maybe_i32) {
   224    return SetField<int32_t>(VT_MAYBE_I32, _maybe_i32);
   225  }
   226  int32_t default_i32() const {
   227    return GetField<int32_t>(VT_DEFAULT_I32, 42);
   228  }
   229  bool mutate_default_i32(int32_t _default_i32 = 42) {
   230    return SetField<int32_t>(VT_DEFAULT_I32, _default_i32, 42);
   231  }
   232  uint32_t just_u32() const {
   233    return GetField<uint32_t>(VT_JUST_U32, 0);
   234  }
   235  bool mutate_just_u32(uint32_t _just_u32 = 0) {
   236    return SetField<uint32_t>(VT_JUST_U32, _just_u32, 0);
   237  }
   238  ::flatbuffers::Optional<uint32_t> maybe_u32() const {
   239    return GetOptional<uint32_t, uint32_t>(VT_MAYBE_U32);
   240  }
   241  bool mutate_maybe_u32(uint32_t _maybe_u32) {
   242    return SetField<uint32_t>(VT_MAYBE_U32, _maybe_u32);
   243  }
   244  uint32_t default_u32() const {
   245    return GetField<uint32_t>(VT_DEFAULT_U32, 42);
   246  }
   247  bool mutate_default_u32(uint32_t _default_u32 = 42) {
   248    return SetField<uint32_t>(VT_DEFAULT_U32, _default_u32, 42);
   249  }
   250  int64_t just_i64() const {
   251    return GetField<int64_t>(VT_JUST_I64, 0);
   252  }
   253  bool mutate_just_i64(int64_t _just_i64 = 0) {
   254    return SetField<int64_t>(VT_JUST_I64, _just_i64, 0);
   255  }
   256  ::flatbuffers::Optional<int64_t> maybe_i64() const {
   257    return GetOptional<int64_t, int64_t>(VT_MAYBE_I64);
   258  }
   259  bool mutate_maybe_i64(int64_t _maybe_i64) {
   260    return SetField<int64_t>(VT_MAYBE_I64, _maybe_i64);
   261  }
   262  int64_t default_i64() const {
   263    return GetField<int64_t>(VT_DEFAULT_I64, 42LL);
   264  }
   265  bool mutate_default_i64(int64_t _default_i64 = 42LL) {
   266    return SetField<int64_t>(VT_DEFAULT_I64, _default_i64, 42LL);
   267  }
   268  uint64_t just_u64() const {
   269    return GetField<uint64_t>(VT_JUST_U64, 0);
   270  }
   271  bool mutate_just_u64(uint64_t _just_u64 = 0) {
   272    return SetField<uint64_t>(VT_JUST_U64, _just_u64, 0);
   273  }
   274  ::flatbuffers::Optional<uint64_t> maybe_u64() const {
   275    return GetOptional<uint64_t, uint64_t>(VT_MAYBE_U64);
   276  }
   277  bool mutate_maybe_u64(uint64_t _maybe_u64) {
   278    return SetField<uint64_t>(VT_MAYBE_U64, _maybe_u64);
   279  }
   280  uint64_t default_u64() const {
   281    return GetField<uint64_t>(VT_DEFAULT_U64, 42ULL);
   282  }
   283  bool mutate_default_u64(uint64_t _default_u64 = 42ULL) {
   284    return SetField<uint64_t>(VT_DEFAULT_U64, _default_u64, 42ULL);
   285  }
   286  float just_f32() const {
   287    return GetField<float>(VT_JUST_F32, 0.0f);
   288  }
   289  bool mutate_just_f32(float _just_f32 = 0.0f) {
   290    return SetField<float>(VT_JUST_F32, _just_f32, 0.0f);
   291  }
   292  ::flatbuffers::Optional<float> maybe_f32() const {
   293    return GetOptional<float, float>(VT_MAYBE_F32);
   294  }
   295  bool mutate_maybe_f32(float _maybe_f32) {
   296    return SetField<float>(VT_MAYBE_F32, _maybe_f32);
   297  }
   298  float default_f32() const {
   299    return GetField<float>(VT_DEFAULT_F32, 42.0f);
   300  }
   301  bool mutate_default_f32(float _default_f32 = 42.0f) {
   302    return SetField<float>(VT_DEFAULT_F32, _default_f32, 42.0f);
   303  }
   304  double just_f64() const {
   305    return GetField<double>(VT_JUST_F64, 0.0);
   306  }
   307  bool mutate_just_f64(double _just_f64 = 0.0) {
   308    return SetField<double>(VT_JUST_F64, _just_f64, 0.0);
   309  }
   310  ::flatbuffers::Optional<double> maybe_f64() const {
   311    return GetOptional<double, double>(VT_MAYBE_F64);
   312  }
   313  bool mutate_maybe_f64(double _maybe_f64) {
   314    return SetField<double>(VT_MAYBE_F64, _maybe_f64);
   315  }
   316  double default_f64() const {
   317    return GetField<double>(VT_DEFAULT_F64, 42.0);
   318  }
   319  bool mutate_default_f64(double _default_f64 = 42.0) {
   320    return SetField<double>(VT_DEFAULT_F64, _default_f64, 42.0);
   321  }
   322  bool just_bool() const {
   323    return GetField<uint8_t>(VT_JUST_BOOL, 0) != 0;
   324  }
   325  bool mutate_just_bool(bool _just_bool = 0) {
   326    return SetField<uint8_t>(VT_JUST_BOOL, static_cast<uint8_t>(_just_bool), 0);
   327  }
   328  ::flatbuffers::Optional<bool> maybe_bool() const {
   329    return GetOptional<uint8_t, bool>(VT_MAYBE_BOOL);
   330  }
   331  bool mutate_maybe_bool(bool _maybe_bool) {
   332    return SetField<uint8_t>(VT_MAYBE_BOOL, static_cast<uint8_t>(_maybe_bool));
   333  }
   334  bool default_bool() const {
   335    return GetField<uint8_t>(VT_DEFAULT_BOOL, 1) != 0;
   336  }
   337  bool mutate_default_bool(bool _default_bool = 1) {
   338    return SetField<uint8_t>(VT_DEFAULT_BOOL, static_cast<uint8_t>(_default_bool), 1);
   339  }
   340  optional_scalars::OptionalByte just_enum() const {
   341    return static_cast<optional_scalars::OptionalByte>(GetField<int8_t>(VT_JUST_ENUM, 0));
   342  }
   343  bool mutate_just_enum(optional_scalars::OptionalByte _just_enum = static_cast<optional_scalars::OptionalByte>(0)) {
   344    return SetField<int8_t>(VT_JUST_ENUM, static_cast<int8_t>(_just_enum), 0);
   345  }
   346  ::flatbuffers::Optional<optional_scalars::OptionalByte> maybe_enum() const {
   347    return GetOptional<int8_t, optional_scalars::OptionalByte>(VT_MAYBE_ENUM);
   348  }
   349  bool mutate_maybe_enum(optional_scalars::OptionalByte _maybe_enum) {
   350    return SetField<int8_t>(VT_MAYBE_ENUM, static_cast<int8_t>(_maybe_enum));
   351  }
   352  optional_scalars::OptionalByte default_enum() const {
   353    return static_cast<optional_scalars::OptionalByte>(GetField<int8_t>(VT_DEFAULT_ENUM, 1));
   354  }
   355  bool mutate_default_enum(optional_scalars::OptionalByte _default_enum = static_cast<optional_scalars::OptionalByte>(1)) {
   356    return SetField<int8_t>(VT_DEFAULT_ENUM, static_cast<int8_t>(_default_enum), 1);
   357  }
   358  template<size_t Index>
   359  auto get_field() const {
   360         if constexpr (Index == 0) return just_i8();
   361    else if constexpr (Index == 1) return maybe_i8();
   362    else if constexpr (Index == 2) return default_i8();
   363    else if constexpr (Index == 3) return just_u8();
   364    else if constexpr (Index == 4) return maybe_u8();
   365    else if constexpr (Index == 5) return default_u8();
   366    else if constexpr (Index == 6) return just_i16();
   367    else if constexpr (Index == 7) return maybe_i16();
   368    else if constexpr (Index == 8) return default_i16();
   369    else if constexpr (Index == 9) return just_u16();
   370    else if constexpr (Index == 10) return maybe_u16();
   371    else if constexpr (Index == 11) return default_u16();
   372    else if constexpr (Index == 12) return just_i32();
   373    else if constexpr (Index == 13) return maybe_i32();
   374    else if constexpr (Index == 14) return default_i32();
   375    else if constexpr (Index == 15) return just_u32();
   376    else if constexpr (Index == 16) return maybe_u32();
   377    else if constexpr (Index == 17) return default_u32();
   378    else if constexpr (Index == 18) return just_i64();
   379    else if constexpr (Index == 19) return maybe_i64();
   380    else if constexpr (Index == 20) return default_i64();
   381    else if constexpr (Index == 21) return just_u64();
   382    else if constexpr (Index == 22) return maybe_u64();
   383    else if constexpr (Index == 23) return default_u64();
   384    else if constexpr (Index == 24) return just_f32();
   385    else if constexpr (Index == 25) return maybe_f32();
   386    else if constexpr (Index == 26) return default_f32();
   387    else if constexpr (Index == 27) return just_f64();
   388    else if constexpr (Index == 28) return maybe_f64();
   389    else if constexpr (Index == 29) return default_f64();
   390    else if constexpr (Index == 30) return just_bool();
   391    else if constexpr (Index == 31) return maybe_bool();
   392    else if constexpr (Index == 32) return default_bool();
   393    else if constexpr (Index == 33) return just_enum();
   394    else if constexpr (Index == 34) return maybe_enum();
   395    else if constexpr (Index == 35) return default_enum();
   396    else static_assert(Index != Index, "Invalid Field Index");
   397  }
   398  bool Verify(::flatbuffers::Verifier &verifier) const {
   399    return VerifyTableStart(verifier) &&
   400           VerifyField<int8_t>(verifier, VT_JUST_I8, 1) &&
   401           VerifyField<int8_t>(verifier, VT_MAYBE_I8, 1) &&
   402           VerifyField<int8_t>(verifier, VT_DEFAULT_I8, 1) &&
   403           VerifyField<uint8_t>(verifier, VT_JUST_U8, 1) &&
   404           VerifyField<uint8_t>(verifier, VT_MAYBE_U8, 1) &&
   405           VerifyField<uint8_t>(verifier, VT_DEFAULT_U8, 1) &&
   406           VerifyField<int16_t>(verifier, VT_JUST_I16, 2) &&
   407           VerifyField<int16_t>(verifier, VT_MAYBE_I16, 2) &&
   408           VerifyField<int16_t>(verifier, VT_DEFAULT_I16, 2) &&
   409           VerifyField<uint16_t>(verifier, VT_JUST_U16, 2) &&
   410           VerifyField<uint16_t>(verifier, VT_MAYBE_U16, 2) &&
   411           VerifyField<uint16_t>(verifier, VT_DEFAULT_U16, 2) &&
   412           VerifyField<int32_t>(verifier, VT_JUST_I32, 4) &&
   413           VerifyField<int32_t>(verifier, VT_MAYBE_I32, 4) &&
   414           VerifyField<int32_t>(verifier, VT_DEFAULT_I32, 4) &&
   415           VerifyField<uint32_t>(verifier, VT_JUST_U32, 4) &&
   416           VerifyField<uint32_t>(verifier, VT_MAYBE_U32, 4) &&
   417           VerifyField<uint32_t>(verifier, VT_DEFAULT_U32, 4) &&
   418           VerifyField<int64_t>(verifier, VT_JUST_I64, 8) &&
   419           VerifyField<int64_t>(verifier, VT_MAYBE_I64, 8) &&
   420           VerifyField<int64_t>(verifier, VT_DEFAULT_I64, 8) &&
   421           VerifyField<uint64_t>(verifier, VT_JUST_U64, 8) &&
   422           VerifyField<uint64_t>(verifier, VT_MAYBE_U64, 8) &&
   423           VerifyField<uint64_t>(verifier, VT_DEFAULT_U64, 8) &&
   424           VerifyField<float>(verifier, VT_JUST_F32, 4) &&
   425           VerifyField<float>(verifier, VT_MAYBE_F32, 4) &&
   426           VerifyField<float>(verifier, VT_DEFAULT_F32, 4) &&
   427           VerifyField<double>(verifier, VT_JUST_F64, 8) &&
   428           VerifyField<double>(verifier, VT_MAYBE_F64, 8) &&
   429           VerifyField<double>(verifier, VT_DEFAULT_F64, 8) &&
   430           VerifyField<uint8_t>(verifier, VT_JUST_BOOL, 1) &&
   431           VerifyField<uint8_t>(verifier, VT_MAYBE_BOOL, 1) &&
   432           VerifyField<uint8_t>(verifier, VT_DEFAULT_BOOL, 1) &&
   433           VerifyField<int8_t>(verifier, VT_JUST_ENUM, 1) &&
   434           VerifyField<int8_t>(verifier, VT_MAYBE_ENUM, 1) &&
   435           VerifyField<int8_t>(verifier, VT_DEFAULT_ENUM, 1) &&
   436           verifier.EndTable();
   437  }
   438  ScalarStuffT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
   439  void UnPackTo(ScalarStuffT *_o, const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
   440  static ::flatbuffers::Offset<ScalarStuff> Pack(::flatbuffers::FlatBufferBuilder &_fbb, const ScalarStuffT* _o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);
   441};
   442
   443struct ScalarStuffBuilder {
   444  typedef ScalarStuff Table;
   445  ::flatbuffers::FlatBufferBuilder &fbb_;
   446  ::flatbuffers::uoffset_t start_;
   447  void add_just_i8(int8_t just_i8) {
   448    fbb_.AddElement<int8_t>(ScalarStuff::VT_JUST_I8, just_i8, 0);
   449  }
   450  void add_maybe_i8(int8_t maybe_i8) {
   451    fbb_.AddElement<int8_t>(ScalarStuff::VT_MAYBE_I8, maybe_i8);
   452  }
   453  void add_default_i8(int8_t default_i8) {
   454    fbb_.AddElement<int8_t>(ScalarStuff::VT_DEFAULT_I8, default_i8, 42);
   455  }
   456  void add_just_u8(uint8_t just_u8) {
   457    fbb_.AddElement<uint8_t>(ScalarStuff::VT_JUST_U8, just_u8, 0);
   458  }
   459  void add_maybe_u8(uint8_t maybe_u8) {
   460    fbb_.AddElement<uint8_t>(ScalarStuff::VT_MAYBE_U8, maybe_u8);
   461  }
   462  void add_default_u8(uint8_t default_u8) {
   463    fbb_.AddElement<uint8_t>(ScalarStuff::VT_DEFAULT_U8, default_u8, 42);
   464  }
   465  void add_just_i16(int16_t just_i16) {
   466    fbb_.AddElement<int16_t>(ScalarStuff::VT_JUST_I16, just_i16, 0);
   467  }
   468  void add_maybe_i16(int16_t maybe_i16) {
   469    fbb_.AddElement<int16_t>(ScalarStuff::VT_MAYBE_I16, maybe_i16);
   470  }
   471  void add_default_i16(int16_t default_i16) {
   472    fbb_.AddElement<int16_t>(ScalarStuff::VT_DEFAULT_I16, default_i16, 42);
   473  }
   474  void add_just_u16(uint16_t just_u16) {
   475    fbb_.AddElement<uint16_t>(ScalarStuff::VT_JUST_U16, just_u16, 0);
   476  }
   477  void add_maybe_u16(uint16_t maybe_u16) {
   478    fbb_.AddElement<uint16_t>(ScalarStuff::VT_MAYBE_U16, maybe_u16);
   479  }
   480  void add_default_u16(uint16_t default_u16) {
   481    fbb_.AddElement<uint16_t>(ScalarStuff::VT_DEFAULT_U16, default_u16, 42);
   482  }
   483  void add_just_i32(int32_t just_i32) {
   484    fbb_.AddElement<int32_t>(ScalarStuff::VT_JUST_I32, just_i32, 0);
   485  }
   486  void add_maybe_i32(int32_t maybe_i32) {
   487    fbb_.AddElement<int32_t>(ScalarStuff::VT_MAYBE_I32, maybe_i32);
   488  }
   489  void add_default_i32(int32_t default_i32) {
   490    fbb_.AddElement<int32_t>(ScalarStuff::VT_DEFAULT_I32, default_i32, 42);
   491  }
   492  void add_just_u32(uint32_t just_u32) {
   493    fbb_.AddElement<uint32_t>(ScalarStuff::VT_JUST_U32, just_u32, 0);
   494  }
   495  void add_maybe_u32(uint32_t maybe_u32) {
   496    fbb_.AddElement<uint32_t>(ScalarStuff::VT_MAYBE_U32, maybe_u32);
   497  }
   498  void add_default_u32(uint32_t default_u32) {
   499    fbb_.AddElement<uint32_t>(ScalarStuff::VT_DEFAULT_U32, default_u32, 42);
   500  }
   501  void add_just_i64(int64_t just_i64) {
   502    fbb_.AddElement<int64_t>(ScalarStuff::VT_JUST_I64, just_i64, 0);
   503  }
   504  void add_maybe_i64(int64_t maybe_i64) {
   505    fbb_.AddElement<int64_t>(ScalarStuff::VT_MAYBE_I64, maybe_i64);
   506  }
   507  void add_default_i64(int64_t default_i64) {
   508    fbb_.AddElement<int64_t>(ScalarStuff::VT_DEFAULT_I64, default_i64, 42LL);
   509  }
   510  void add_just_u64(uint64_t just_u64) {
   511    fbb_.AddElement<uint64_t>(ScalarStuff::VT_JUST_U64, just_u64, 0);
   512  }
   513  void add_maybe_u64(uint64_t maybe_u64) {
   514    fbb_.AddElement<uint64_t>(ScalarStuff::VT_MAYBE_U64, maybe_u64);
   515  }
   516  void add_default_u64(uint64_t default_u64) {
   517    fbb_.AddElement<uint64_t>(ScalarStuff::VT_DEFAULT_U64, default_u64, 42ULL);
   518  }
   519  void add_just_f32(float just_f32) {
   520    fbb_.AddElement<float>(ScalarStuff::VT_JUST_F32, just_f32, 0.0f);
   521  }
   522  void add_maybe_f32(float maybe_f32) {
   523    fbb_.AddElement<float>(ScalarStuff::VT_MAYBE_F32, maybe_f32);
   524  }
   525  void add_default_f32(float default_f32) {
   526    fbb_.AddElement<float>(ScalarStuff::VT_DEFAULT_F32, default_f32, 42.0f);
   527  }
   528  void add_just_f64(double just_f64) {
   529    fbb_.AddElement<double>(ScalarStuff::VT_JUST_F64, just_f64, 0.0);
   530  }
   531  void add_maybe_f64(double maybe_f64) {
   532    fbb_.AddElement<double>(ScalarStuff::VT_MAYBE_F64, maybe_f64);
   533  }
   534  void add_default_f64(double default_f64) {
   535    fbb_.AddElement<double>(ScalarStuff::VT_DEFAULT_F64, default_f64, 42.0);
   536  }
   537  void add_just_bool(bool just_bool) {
   538    fbb_.AddElement<uint8_t>(ScalarStuff::VT_JUST_BOOL, static_cast<uint8_t>(just_bool), 0);
   539  }
   540  void add_maybe_bool(bool maybe_bool) {
   541    fbb_.AddElement<uint8_t>(ScalarStuff::VT_MAYBE_BOOL, static_cast<uint8_t>(maybe_bool));
   542  }
   543  void add_default_bool(bool default_bool) {
   544    fbb_.AddElement<uint8_t>(ScalarStuff::VT_DEFAULT_BOOL, static_cast<uint8_t>(default_bool), 1);
   545  }
   546  void add_just_enum(optional_scalars::OptionalByte just_enum) {
   547    fbb_.AddElement<int8_t>(ScalarStuff::VT_JUST_ENUM, static_cast<int8_t>(just_enum), 0);
   548  }
   549  void add_maybe_enum(optional_scalars::OptionalByte maybe_enum) {
   550    fbb_.AddElement<int8_t>(ScalarStuff::VT_MAYBE_ENUM, static_cast<int8_t>(maybe_enum));
   551  }
   552  void add_default_enum(optional_scalars::OptionalByte default_enum) {
   553    fbb_.AddElement<int8_t>(ScalarStuff::VT_DEFAULT_ENUM, static_cast<int8_t>(default_enum), 1);
   554  }
   555  explicit ScalarStuffBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
   556        : fbb_(_fbb) {
   557    start_ = fbb_.StartTable();
   558  }
   559  ::flatbuffers::Offset<ScalarStuff> Finish() {
   560    const auto end = fbb_.EndTable(start_);
   561    auto o = ::flatbuffers::Offset<ScalarStuff>(end);
   562    return o;
   563  }
   564};
   565
   566inline ::flatbuffers::Offset<ScalarStuff> CreateScalarStuff(
   567    ::flatbuffers::FlatBufferBuilder &_fbb,
   568    int8_t just_i8 = 0,
   569    ::flatbuffers::Optional<int8_t> maybe_i8 = ::flatbuffers::nullopt,
   570    int8_t default_i8 = 42,
   571    uint8_t just_u8 = 0,
   572    ::flatbuffers::Optional<uint8_t> maybe_u8 = ::flatbuffers::nullopt,
   573    uint8_t default_u8 = 42,
   574    int16_t just_i16 = 0,
   575    ::flatbuffers::Optional<int16_t> maybe_i16 = ::flatbuffers::nullopt,
   576    int16_t default_i16 = 42,
   577    uint16_t just_u16 = 0,
   578    ::flatbuffers::Optional<uint16_t> maybe_u16 = ::flatbuffers::nullopt,
   579    uint16_t default_u16 = 42,
   580    int32_t just_i32 = 0,
   581    ::flatbuffers::Optional<int32_t> maybe_i32 = ::flatbuffers::nullopt,
   582    int32_t default_i32 = 42,
   583    uint32_t just_u32 = 0,
   584    ::flatbuffers::Optional<uint32_t> maybe_u32 = ::flatbuffers::nullopt,
   585    uint32_t default_u32 = 42,
   586    int64_t just_i64 = 0,
   587    ::flatbuffers::Optional<int64_t> maybe_i64 = ::flatbuffers::nullopt,
   588    int64_t default_i64 = 42LL,
   589    uint64_t just_u64 = 0,
   590    ::flatbuffers::Optional<uint64_t> maybe_u64 = ::flatbuffers::nullopt,
   591    uint64_t default_u64 = 42ULL,
   592    float just_f32 = 0.0f,
   593    ::flatbuffers::Optional<float> maybe_f32 = ::flatbuffers::nullopt,
   594    float default_f32 = 42.0f,
   595    double just_f64 = 0.0,
   596    ::flatbuffers::Optional<double> maybe_f64 = ::flatbuffers::nullopt,
   597    double default_f64 = 42.0,
   598    bool just_bool = false,
   599    ::flatbuffers::Optional<bool> maybe_bool = ::flatbuffers::nullopt,
   600    bool default_bool = true,
   601    optional_scalars::OptionalByte just_enum = optional_scalars::OptionalByte::None,
   602    ::flatbuffers::Optional<optional_scalars::OptionalByte> maybe_enum = ::flatbuffers::nullopt,
   603    optional_scalars::OptionalByte default_enum = optional_scalars::OptionalByte::One) {
   604  ScalarStuffBuilder builder_(_fbb);
   605  builder_.add_default_f64(default_f64);
   606  if(maybe_f64) { builder_.add_maybe_f64(*maybe_f64); }
   607  builder_.add_just_f64(just_f64);
   608  builder_.add_default_u64(default_u64);
   609  if(maybe_u64) { builder_.add_maybe_u64(*maybe_u64); }
   610  builder_.add_just_u64(just_u64);
   611  builder_.add_default_i64(default_i64);
   612  if(maybe_i64) { builder_.add_maybe_i64(*maybe_i64); }
   613  builder_.add_just_i64(just_i64);
   614  builder_.add_default_f32(default_f32);
   615  if(maybe_f32) { builder_.add_maybe_f32(*maybe_f32); }
   616  builder_.add_just_f32(just_f32);
   617  builder_.add_default_u32(default_u32);
   618  if(maybe_u32) { builder_.add_maybe_u32(*maybe_u32); }
   619  builder_.add_just_u32(just_u32);
   620  builder_.add_default_i32(default_i32);
   621  if(maybe_i32) { builder_.add_maybe_i32(*maybe_i32); }
   622  builder_.add_just_i32(just_i32);
   623  builder_.add_default_u16(default_u16);
   624  if(maybe_u16) { builder_.add_maybe_u16(*maybe_u16); }
   625  builder_.add_just_u16(just_u16);
   626  builder_.add_default_i16(default_i16);
   627  if(maybe_i16) { builder_.add_maybe_i16(*maybe_i16); }
   628  builder_.add_just_i16(just_i16);
   629  builder_.add_default_enum(default_enum);
   630  if(maybe_enum) { builder_.add_maybe_enum(*maybe_enum); }
   631  builder_.add_just_enum(just_enum);
   632  builder_.add_default_bool(default_bool);
   633  if(maybe_bool) { builder_.add_maybe_bool(*maybe_bool); }
   634  builder_.add_just_bool(just_bool);
   635  builder_.add_default_u8(default_u8);
   636  if(maybe_u8) { builder_.add_maybe_u8(*maybe_u8); }
   637  builder_.add_just_u8(just_u8);
   638  builder_.add_default_i8(default_i8);
   639  if(maybe_i8) { builder_.add_maybe_i8(*maybe_i8); }
   640  builder_.add_just_i8(just_i8);
   641  return builder_.Finish();
   642}
   643
   644struct ScalarStuff::Traits {
   645  using type = ScalarStuff;
   646  static auto constexpr Create = CreateScalarStuff;
   647  static constexpr auto name = "ScalarStuff";
   648  static constexpr auto fully_qualified_name = "optional_scalars.ScalarStuff";
   649  static constexpr size_t fields_number = 36;
   650  static constexpr std::array<const char *, fields_number> field_names = {
   651    "just_i8",
   652    "maybe_i8",
   653    "default_i8",
   654    "just_u8",
   655    "maybe_u8",
   656    "default_u8",
   657    "just_i16",
   658    "maybe_i16",
   659    "default_i16",
   660    "just_u16",
   661    "maybe_u16",
   662    "default_u16",
   663    "just_i32",
   664    "maybe_i32",
   665    "default_i32",
   666    "just_u32",
   667    "maybe_u32",
   668    "default_u32",
   669    "just_i64",
   670    "maybe_i64",
   671    "default_i64",
   672    "just_u64",
   673    "maybe_u64",
   674    "default_u64",
   675    "just_f32",
   676    "maybe_f32",
   677    "default_f32",
   678    "just_f64",
   679    "maybe_f64",
   680    "default_f64",
   681    "just_bool",
   682    "maybe_bool",
   683    "default_bool",
   684    "just_enum",
   685    "maybe_enum",
   686    "default_enum"
   687  };
   688  template<size_t Index>
   689  using FieldType = decltype(std::declval<type>().get_field<Index>());
   690};
   691
   692::flatbuffers::Offset<ScalarStuff> CreateScalarStuff(::flatbuffers::FlatBufferBuilder &_fbb, const ScalarStuffT *_o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);
   693
   694inline ScalarStuffT *ScalarStuff::UnPack(const ::flatbuffers::resolver_function_t *_resolver) const {
   695  auto _o = std::make_unique<ScalarStuffT>();
   696  UnPackTo(_o.get(), _resolver);
   697  return _o.release();
   698}
   699
   700inline void ScalarStuff::UnPackTo(ScalarStuffT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
   701  (void)_o;
   702  (void)_resolver;
   703  { auto _e = just_i8(); _o->just_i8 = _e; }
   704  { auto _e = maybe_i8(); _o->maybe_i8 = _e; }
   705  { auto _e = default_i8(); _o->default_i8 = _e; }
   706  { auto _e = just_u8(); _o->just_u8 = _e; }
   707  { auto _e = maybe_u8(); _o->maybe_u8 = _e; }
   708  { auto _e = default_u8(); _o->default_u8 = _e; }
   709  { auto _e = just_i16(); _o->just_i16 = _e; }
   710  { auto _e = maybe_i16(); _o->maybe_i16 = _e; }
   711  { auto _e = default_i16(); _o->default_i16 = _e; }
   712  { auto _e = just_u16(); _o->just_u16 = _e; }
   713  { auto _e = maybe_u16(); _o->maybe_u16 = _e; }
   714  { auto _e = default_u16(); _o->default_u16 = _e; }
   715  { auto _e = just_i32(); _o->just_i32 = _e; }
   716  { auto _e = maybe_i32(); _o->maybe_i32 = _e; }
   717  { auto _e = default_i32(); _o->default_i32 = _e; }
   718  { auto _e = just_u32(); _o->just_u32 = _e; }
   719  { auto _e = maybe_u32(); _o->maybe_u32 = _e; }
   720  { auto _e = default_u32(); _o->default_u32 = _e; }
   721  { auto _e = just_i64(); _o->just_i64 = _e; }
   722  { auto _e = maybe_i64(); _o->maybe_i64 = _e; }
   723  { auto _e = default_i64(); _o->default_i64 = _e; }
   724  { auto _e = just_u64(); _o->just_u64 = _e; }
   725  { auto _e = maybe_u64(); _o->maybe_u64 = _e; }
   726  { auto _e = default_u64(); _o->default_u64 = _e; }
   727  { auto _e = just_f32(); _o->just_f32 = _e; }
   728  { auto _e = maybe_f32(); _o->maybe_f32 = _e; }
   729  { auto _e = default_f32(); _o->default_f32 = _e; }
   730  { auto _e = just_f64(); _o->just_f64 = _e; }
   731  { auto _e = maybe_f64(); _o->maybe_f64 = _e; }
   732  { auto _e = default_f64(); _o->default_f64 = _e; }
   733  { auto _e = just_bool(); _o->just_bool = _e; }
   734  { auto _e = maybe_bool(); _o->maybe_bool = _e; }
   735  { auto _e = default_bool(); _o->default_bool = _e; }
   736  { auto _e = just_enum(); _o->just_enum = _e; }
   737  { auto _e = maybe_enum(); _o->maybe_enum = _e; }
   738  { auto _e = default_enum(); _o->default_enum = _e; }
   739}
   740
   741inline ::flatbuffers::Offset<ScalarStuff> ScalarStuff::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const ScalarStuffT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) {
   742  return CreateScalarStuff(_fbb, _o, _rehasher);
   743}
   744
   745inline ::flatbuffers::Offset<ScalarStuff> CreateScalarStuff(::flatbuffers::FlatBufferBuilder &_fbb, const ScalarStuffT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
   746  (void)_rehasher;
   747  (void)_o;
   748  struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const ScalarStuffT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
   749  auto _just_i8 = _o->just_i8;
   750  auto _maybe_i8 = _o->maybe_i8;
   751  auto _default_i8 = _o->default_i8;
   752  auto _just_u8 = _o->just_u8;
   753  auto _maybe_u8 = _o->maybe_u8;
   754  auto _default_u8 = _o->default_u8;
   755  auto _just_i16 = _o->just_i16;
   756  auto _maybe_i16 = _o->maybe_i16;
   757  auto _default_i16 = _o->default_i16;
   758  auto _just_u16 = _o->just_u16;
   759  auto _maybe_u16 = _o->maybe_u16;
   760  auto _default_u16 = _o->default_u16;
   761  auto _just_i32 = _o->just_i32;
   762  auto _maybe_i32 = _o->maybe_i32;
   763  auto _default_i32 = _o->default_i32;
   764  auto _just_u32 = _o->just_u32;
   765  auto _maybe_u32 = _o->maybe_u32;
   766  auto _default_u32 = _o->default_u32;
   767  auto _just_i64 = _o->just_i64;
   768  auto _maybe_i64 = _o->maybe_i64;
   769  auto _default_i64 = _o->default_i64;
   770  auto _just_u64 = _o->just_u64;
   771  auto _maybe_u64 = _o->maybe_u64;
   772  auto _default_u64 = _o->default_u64;
   773  auto _just_f32 = _o->just_f32;
   774  auto _maybe_f32 = _o->maybe_f32;
   775  auto _default_f32 = _o->default_f32;
   776  auto _just_f64 = _o->just_f64;
   777  auto _maybe_f64 = _o->maybe_f64;
   778  auto _default_f64 = _o->default_f64;
   779  auto _just_bool = _o->just_bool;
   780  auto _maybe_bool = _o->maybe_bool;
   781  auto _default_bool = _o->default_bool;
   782  auto _just_enum = _o->just_enum;
   783  auto _maybe_enum = _o->maybe_enum;
   784  auto _default_enum = _o->default_enum;
   785  return optional_scalars::CreateScalarStuff(
   786      _fbb,
   787      _just_i8,
   788      _maybe_i8,
   789      _default_i8,
   790      _just_u8,
   791      _maybe_u8,
   792      _default_u8,
   793      _just_i16,
   794      _maybe_i16,
   795      _default_i16,
   796      _just_u16,
   797      _maybe_u16,
   798      _default_u16,
   799      _just_i32,
   800      _maybe_i32,
   801      _default_i32,
   802      _just_u32,
   803      _maybe_u32,
   804      _default_u32,
   805      _just_i64,
   806      _maybe_i64,
   807      _default_i64,
   808      _just_u64,
   809      _maybe_u64,
   810      _default_u64,
   811      _just_f32,
   812      _maybe_f32,
   813      _default_f32,
   814      _just_f64,
   815      _maybe_f64,
   816      _default_f64,
   817      _just_bool,
   818      _maybe_bool,
   819      _default_bool,
   820      _just_enum,
   821      _maybe_enum,
   822      _default_enum);
   823}
   824
   825inline const ::flatbuffers::TypeTable *OptionalByteTypeTable() {
   826  static const ::flatbuffers::TypeCode type_codes[] = {
   827    { ::flatbuffers::ET_CHAR, 0, 0 },
   828    { ::flatbuffers::ET_CHAR, 0, 0 },
   829    { ::flatbuffers::ET_CHAR, 0, 0 }
   830  };
   831  static const ::flatbuffers::TypeFunction type_refs[] = {
   832    optional_scalars::OptionalByteTypeTable
   833  };
   834  static const char * const names[] = {
   835    "None",
   836    "One",
   837    "Two"
   838  };
   839  static const ::flatbuffers::TypeTable tt = {
   840    ::flatbuffers::ST_ENUM, 3, type_codes, type_refs, nullptr, nullptr, names
   841  };
   842  return &tt;
   843}
   844
   845inline const ::flatbuffers::TypeTable *ScalarStuffTypeTable() {
   846  static const ::flatbuffers::TypeCode type_codes[] = {
   847    { ::flatbuffers::ET_CHAR, 0, -1 },
   848    { ::flatbuffers::ET_CHAR, 0, -1 },
   849    { ::flatbuffers::ET_CHAR, 0, -1 },
   850    { ::flatbuffers::ET_UCHAR, 0, -1 },
   851    { ::flatbuffers::ET_UCHAR, 0, -1 },
   852    { ::flatbuffers::ET_UCHAR, 0, -1 },
   853    { ::flatbuffers::ET_SHORT, 0, -1 },
   854    { ::flatbuffers::ET_SHORT, 0, -1 },
   855    { ::flatbuffers::ET_SHORT, 0, -1 },
   856    { ::flatbuffers::ET_USHORT, 0, -1 },
   857    { ::flatbuffers::ET_USHORT, 0, -1 },
   858    { ::flatbuffers::ET_USHORT, 0, -1 },
   859    { ::flatbuffers::ET_INT, 0, -1 },
   860    { ::flatbuffers::ET_INT, 0, -1 },
   861    { ::flatbuffers::ET_INT, 0, -1 },
   862    { ::flatbuffers::ET_UINT, 0, -1 },
   863    { ::flatbuffers::ET_UINT, 0, -1 },
   864    { ::flatbuffers::ET_UINT, 0, -1 },
   865    { ::flatbuffers::ET_LONG, 0, -1 },
   866    { ::flatbuffers::ET_LONG, 0, -1 },
   867    { ::flatbuffers::ET_LONG, 0, -1 },
   868    { ::flatbuffers::ET_ULONG, 0, -1 },
   869    { ::flatbuffers::ET_ULONG, 0, -1 },
   870    { ::flatbuffers::ET_ULONG, 0, -1 },
   871    { ::flatbuffers::ET_FLOAT, 0, -1 },
   872    { ::flatbuffers::ET_FLOAT, 0, -1 },
   873    { ::flatbuffers::ET_FLOAT, 0, -1 },
   874    { ::flatbuffers::ET_DOUBLE, 0, -1 },
   875    { ::flatbuffers::ET_DOUBLE, 0, -1 },
   876    { ::flatbuffers::ET_DOUBLE, 0, -1 },
   877    { ::flatbuffers::ET_BOOL, 0, -1 },
   878    { ::flatbuffers::ET_BOOL, 0, -1 },
   879    { ::flatbuffers::ET_BOOL, 0, -1 },
   880    { ::flatbuffers::ET_CHAR, 0, 0 },
   881    { ::flatbuffers::ET_CHAR, 0, 0 },
   882    { ::flatbuffers::ET_CHAR, 0, 0 }
   883  };
   884  static const ::flatbuffers::TypeFunction type_refs[] = {
   885    optional_scalars::OptionalByteTypeTable
   886  };
   887  static const char * const names[] = {
   888    "just_i8",
   889    "maybe_i8",
   890    "default_i8",
   891    "just_u8",
   892    "maybe_u8",
   893    "default_u8",
   894    "just_i16",
   895    "maybe_i16",
   896    "default_i16",
   897    "just_u16",
   898    "maybe_u16",
   899    "default_u16",
   900    "just_i32",
   901    "maybe_i32",
   902    "default_i32",
   903    "just_u32",
   904    "maybe_u32",
   905    "default_u32",
   906    "just_i64",
   907    "maybe_i64",
   908    "default_i64",
   909    "just_u64",
   910    "maybe_u64",
   911    "default_u64",
   912    "just_f32",
   913    "maybe_f32",
   914    "default_f32",
   915    "just_f64",
   916    "maybe_f64",
   917    "default_f64",
   918    "just_bool",
   919    "maybe_bool",
   920    "default_bool",
   921    "just_enum",
   922    "maybe_enum",
   923    "default_enum"
   924  };
   925  static const ::flatbuffers::TypeTable tt = {
   926    ::flatbuffers::ST_TABLE, 36, type_codes, type_refs, nullptr, nullptr, names
   927  };
   928  return &tt;
   929}
   930
   931inline const optional_scalars::ScalarStuff *GetScalarStuff(const void *buf) {
   932  return ::flatbuffers::GetRoot<optional_scalars::ScalarStuff>(buf);
   933}
   934
   935inline const optional_scalars::ScalarStuff *GetSizePrefixedScalarStuff(const void *buf) {
   936  return ::flatbuffers::GetSizePrefixedRoot<optional_scalars::ScalarStuff>(buf);
   937}
   938
   939inline ScalarStuff *GetMutableScalarStuff(void *buf) {
   940  return ::flatbuffers::GetMutableRoot<ScalarStuff>(buf);
   941}
   942
   943inline optional_scalars::ScalarStuff *GetMutableSizePrefixedScalarStuff(void *buf) {
   944  return ::flatbuffers::GetMutableSizePrefixedRoot<optional_scalars::ScalarStuff>(buf);
   945}
   946
   947inline const char *ScalarStuffIdentifier() {
   948  return "NULL";
   949}
   950
   951inline bool ScalarStuffBufferHasIdentifier(const void *buf) {
   952  return ::flatbuffers::BufferHasIdentifier(
   953      buf, ScalarStuffIdentifier());
   954}
   955
   956inline bool SizePrefixedScalarStuffBufferHasIdentifier(const void *buf) {
   957  return ::flatbuffers::BufferHasIdentifier(
   958      buf, ScalarStuffIdentifier(), true);
   959}
   960
   961inline bool VerifyScalarStuffBuffer(
   962    ::flatbuffers::Verifier &verifier) {
   963  return verifier.VerifyBuffer<optional_scalars::ScalarStuff>(ScalarStuffIdentifier());
   964}
   965
   966inline bool VerifySizePrefixedScalarStuffBuffer(
   967    ::flatbuffers::Verifier &verifier) {
   968  return verifier.VerifySizePrefixedBuffer<optional_scalars::ScalarStuff>(ScalarStuffIdentifier());
   969}
   970
   971inline const char *ScalarStuffExtension() {
   972  return "mon";
   973}
   974
   975inline void FinishScalarStuffBuffer(
   976    ::flatbuffers::FlatBufferBuilder &fbb,
   977    ::flatbuffers::Offset<optional_scalars::ScalarStuff> root) {
   978  fbb.Finish(root, ScalarStuffIdentifier());
   979}
   980
   981inline void FinishSizePrefixedScalarStuffBuffer(
   982    ::flatbuffers::FlatBufferBuilder &fbb,
   983    ::flatbuffers::Offset<optional_scalars::ScalarStuff> root) {
   984  fbb.FinishSizePrefixed(root, ScalarStuffIdentifier());
   985}
   986
   987inline std::unique_ptr<optional_scalars::ScalarStuffT> UnPackScalarStuff(
   988    const void *buf,
   989    const ::flatbuffers::resolver_function_t *res = nullptr) {
   990  return std::unique_ptr<optional_scalars::ScalarStuffT>(GetScalarStuff(buf)->UnPack(res));
   991}
   992
   993inline std::unique_ptr<optional_scalars::ScalarStuffT> UnPackSizePrefixedScalarStuff(
   994    const void *buf,
   995    const ::flatbuffers::resolver_function_t *res = nullptr) {
   996  return std::unique_ptr<optional_scalars::ScalarStuffT>(GetSizePrefixedScalarStuff(buf)->UnPack(res));
   997}
   998
   999}  // namespace optional_scalars
  1000
  1001#endif  // FLATBUFFERS_GENERATED_OPTIONALSCALARS_OPTIONAL_SCALARS_H_

View as plain text