Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 1 | // automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | |
| 4 | #ifndef FLATBUFFERS_GENERATED_NAMESPACETEST1_NAMESPACEA_NAMESPACEB_H_ |
| 5 | #define FLATBUFFERS_GENERATED_NAMESPACETEST1_NAMESPACEA_NAMESPACEB_H_ |
| 6 | |
| 7 | #include "flatbuffers/flatbuffers.h" |
| 8 | |
| 9 | namespace NamespaceA { |
| 10 | namespace NamespaceB { |
| 11 | |
| 12 | struct TableInNestedNS; |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 13 | struct TableInNestedNSBuilder; |
| 14 | struct TableInNestedNST; |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 15 | |
| 16 | struct StructInNestedNS; |
| 17 | |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 18 | bool operator==(const TableInNestedNST &lhs, const TableInNestedNST &rhs); |
| 19 | bool operator!=(const TableInNestedNST &lhs, const TableInNestedNST &rhs); |
| 20 | bool operator==(const StructInNestedNS &lhs, const StructInNestedNS &rhs); |
| 21 | bool operator!=(const StructInNestedNS &lhs, const StructInNestedNS &rhs); |
| 22 | |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 23 | inline const flatbuffers::TypeTable *TableInNestedNSTypeTable(); |
| 24 | |
| 25 | inline const flatbuffers::TypeTable *StructInNestedNSTypeTable(); |
| 26 | |
| 27 | enum EnumInNestedNS { |
| 28 | EnumInNestedNS_A = 0, |
| 29 | EnumInNestedNS_B = 1, |
| 30 | EnumInNestedNS_C = 2, |
| 31 | EnumInNestedNS_MIN = EnumInNestedNS_A, |
| 32 | EnumInNestedNS_MAX = EnumInNestedNS_C |
| 33 | }; |
| 34 | |
| 35 | inline const EnumInNestedNS (&EnumValuesEnumInNestedNS())[3] { |
| 36 | static const EnumInNestedNS values[] = { |
| 37 | EnumInNestedNS_A, |
| 38 | EnumInNestedNS_B, |
| 39 | EnumInNestedNS_C |
| 40 | }; |
| 41 | return values; |
| 42 | } |
| 43 | |
| 44 | inline const char * const *EnumNamesEnumInNestedNS() { |
| 45 | static const char * const names[4] = { |
| 46 | "A", |
| 47 | "B", |
| 48 | "C", |
| 49 | nullptr |
| 50 | }; |
| 51 | return names; |
| 52 | } |
| 53 | |
| 54 | inline const char *EnumNameEnumInNestedNS(EnumInNestedNS e) { |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 55 | if (flatbuffers::IsOutRange(e, EnumInNestedNS_A, EnumInNestedNS_C)) return ""; |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 56 | const size_t index = static_cast<size_t>(e); |
| 57 | return EnumNamesEnumInNestedNS()[index]; |
| 58 | } |
| 59 | |
| 60 | FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(4) StructInNestedNS FLATBUFFERS_FINAL_CLASS { |
| 61 | private: |
| 62 | int32_t a_; |
| 63 | int32_t b_; |
| 64 | |
| 65 | public: |
| 66 | static const flatbuffers::TypeTable *MiniReflectTypeTable() { |
| 67 | return StructInNestedNSTypeTable(); |
| 68 | } |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 69 | static FLATBUFFERS_CONSTEXPR const char *GetFullyQualifiedName() { |
| 70 | return "NamespaceA.NamespaceB.StructInNestedNS"; |
| 71 | } |
| 72 | StructInNestedNS() |
| 73 | : a_(0), |
| 74 | b_(0) { |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 75 | } |
| 76 | StructInNestedNS(int32_t _a, int32_t _b) |
| 77 | : a_(flatbuffers::EndianScalar(_a)), |
| 78 | b_(flatbuffers::EndianScalar(_b)) { |
| 79 | } |
| 80 | int32_t a() const { |
| 81 | return flatbuffers::EndianScalar(a_); |
| 82 | } |
| 83 | void mutate_a(int32_t _a) { |
| 84 | flatbuffers::WriteScalar(&a_, _a); |
| 85 | } |
| 86 | int32_t b() const { |
| 87 | return flatbuffers::EndianScalar(b_); |
| 88 | } |
| 89 | void mutate_b(int32_t _b) { |
| 90 | flatbuffers::WriteScalar(&b_, _b); |
| 91 | } |
| 92 | }; |
| 93 | FLATBUFFERS_STRUCT_END(StructInNestedNS, 8); |
| 94 | |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 95 | inline bool operator==(const StructInNestedNS &lhs, const StructInNestedNS &rhs) { |
| 96 | return |
| 97 | (lhs.a() == rhs.a()) && |
| 98 | (lhs.b() == rhs.b()); |
| 99 | } |
| 100 | |
| 101 | inline bool operator!=(const StructInNestedNS &lhs, const StructInNestedNS &rhs) { |
| 102 | return !(lhs == rhs); |
| 103 | } |
| 104 | |
| 105 | |
| 106 | struct TableInNestedNST : public flatbuffers::NativeTable { |
| 107 | typedef TableInNestedNS TableType; |
| 108 | static FLATBUFFERS_CONSTEXPR const char *GetFullyQualifiedName() { |
| 109 | return "NamespaceA.NamespaceB.TableInNestedNST"; |
| 110 | } |
| 111 | int32_t foo; |
| 112 | TableInNestedNST() |
| 113 | : foo(0) { |
| 114 | } |
| 115 | }; |
| 116 | |
| 117 | inline bool operator==(const TableInNestedNST &lhs, const TableInNestedNST &rhs) { |
| 118 | return |
| 119 | (lhs.foo == rhs.foo); |
| 120 | } |
| 121 | |
| 122 | inline bool operator!=(const TableInNestedNST &lhs, const TableInNestedNST &rhs) { |
| 123 | return !(lhs == rhs); |
| 124 | } |
| 125 | |
| 126 | |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 127 | struct TableInNestedNS FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table { |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 128 | typedef TableInNestedNST NativeTableType; |
| 129 | typedef TableInNestedNSBuilder Builder; |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 130 | static const flatbuffers::TypeTable *MiniReflectTypeTable() { |
| 131 | return TableInNestedNSTypeTable(); |
| 132 | } |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 133 | static FLATBUFFERS_CONSTEXPR const char *GetFullyQualifiedName() { |
| 134 | return "NamespaceA.NamespaceB.TableInNestedNS"; |
| 135 | } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 136 | enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE { |
| 137 | VT_FOO = 4 |
| 138 | }; |
| 139 | int32_t foo() const { |
| 140 | return GetField<int32_t>(VT_FOO, 0); |
| 141 | } |
| 142 | bool mutate_foo(int32_t _foo) { |
| 143 | return SetField<int32_t>(VT_FOO, _foo, 0); |
| 144 | } |
| 145 | bool Verify(flatbuffers::Verifier &verifier) const { |
| 146 | return VerifyTableStart(verifier) && |
| 147 | VerifyField<int32_t>(verifier, VT_FOO) && |
| 148 | verifier.EndTable(); |
| 149 | } |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 150 | TableInNestedNST *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const; |
| 151 | void UnPackTo(TableInNestedNST *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const; |
| 152 | static flatbuffers::Offset<TableInNestedNS> Pack(flatbuffers::FlatBufferBuilder &_fbb, const TableInNestedNST* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 153 | }; |
| 154 | |
| 155 | struct TableInNestedNSBuilder { |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 156 | typedef TableInNestedNS Table; |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 157 | flatbuffers::FlatBufferBuilder &fbb_; |
| 158 | flatbuffers::uoffset_t start_; |
| 159 | void add_foo(int32_t foo) { |
| 160 | fbb_.AddElement<int32_t>(TableInNestedNS::VT_FOO, foo, 0); |
| 161 | } |
| 162 | explicit TableInNestedNSBuilder(flatbuffers::FlatBufferBuilder &_fbb) |
| 163 | : fbb_(_fbb) { |
| 164 | start_ = fbb_.StartTable(); |
| 165 | } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 166 | flatbuffers::Offset<TableInNestedNS> Finish() { |
| 167 | const auto end = fbb_.EndTable(start_); |
| 168 | auto o = flatbuffers::Offset<TableInNestedNS>(end); |
| 169 | return o; |
| 170 | } |
| 171 | }; |
| 172 | |
| 173 | inline flatbuffers::Offset<TableInNestedNS> CreateTableInNestedNS( |
| 174 | flatbuffers::FlatBufferBuilder &_fbb, |
| 175 | int32_t foo = 0) { |
| 176 | TableInNestedNSBuilder builder_(_fbb); |
| 177 | builder_.add_foo(foo); |
| 178 | return builder_.Finish(); |
| 179 | } |
| 180 | |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 181 | flatbuffers::Offset<TableInNestedNS> CreateTableInNestedNS(flatbuffers::FlatBufferBuilder &_fbb, const TableInNestedNST *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr); |
| 182 | |
| 183 | inline TableInNestedNST *TableInNestedNS::UnPack(const flatbuffers::resolver_function_t *_resolver) const { |
| 184 | flatbuffers::unique_ptr<NamespaceA::NamespaceB::TableInNestedNST> _o = flatbuffers::unique_ptr<NamespaceA::NamespaceB::TableInNestedNST>(new TableInNestedNST()); |
| 185 | UnPackTo(_o.get(), _resolver); |
| 186 | return _o.release(); |
| 187 | } |
| 188 | |
| 189 | inline void TableInNestedNS::UnPackTo(TableInNestedNST *_o, const flatbuffers::resolver_function_t *_resolver) const { |
| 190 | (void)_o; |
| 191 | (void)_resolver; |
| 192 | { auto _e = foo(); _o->foo = _e; } |
| 193 | } |
| 194 | |
| 195 | inline flatbuffers::Offset<TableInNestedNS> TableInNestedNS::Pack(flatbuffers::FlatBufferBuilder &_fbb, const TableInNestedNST* _o, const flatbuffers::rehasher_function_t *_rehasher) { |
| 196 | return CreateTableInNestedNS(_fbb, _o, _rehasher); |
| 197 | } |
| 198 | |
| 199 | inline flatbuffers::Offset<TableInNestedNS> CreateTableInNestedNS(flatbuffers::FlatBufferBuilder &_fbb, const TableInNestedNST *_o, const flatbuffers::rehasher_function_t *_rehasher) { |
| 200 | (void)_rehasher; |
| 201 | (void)_o; |
| 202 | struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const TableInNestedNST* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va; |
| 203 | auto _foo = _o->foo; |
| 204 | return NamespaceA::NamespaceB::CreateTableInNestedNS( |
| 205 | _fbb, |
| 206 | _foo); |
| 207 | } |
| 208 | |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 209 | inline const flatbuffers::TypeTable *EnumInNestedNSTypeTable() { |
| 210 | static const flatbuffers::TypeCode type_codes[] = { |
| 211 | { flatbuffers::ET_CHAR, 0, 0 }, |
| 212 | { flatbuffers::ET_CHAR, 0, 0 }, |
| 213 | { flatbuffers::ET_CHAR, 0, 0 } |
| 214 | }; |
| 215 | static const flatbuffers::TypeFunction type_refs[] = { |
| 216 | NamespaceA::NamespaceB::EnumInNestedNSTypeTable |
| 217 | }; |
| 218 | static const char * const names[] = { |
| 219 | "A", |
| 220 | "B", |
| 221 | "C" |
| 222 | }; |
| 223 | static const flatbuffers::TypeTable tt = { |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 224 | flatbuffers::ST_ENUM, 3, type_codes, type_refs, nullptr, nullptr, names |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 225 | }; |
| 226 | return &tt; |
| 227 | } |
| 228 | |
| 229 | inline const flatbuffers::TypeTable *TableInNestedNSTypeTable() { |
| 230 | static const flatbuffers::TypeCode type_codes[] = { |
| 231 | { flatbuffers::ET_INT, 0, -1 } |
| 232 | }; |
| 233 | static const char * const names[] = { |
| 234 | "foo" |
| 235 | }; |
| 236 | static const flatbuffers::TypeTable tt = { |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 237 | flatbuffers::ST_TABLE, 1, type_codes, nullptr, nullptr, nullptr, names |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 238 | }; |
| 239 | return &tt; |
| 240 | } |
| 241 | |
| 242 | inline const flatbuffers::TypeTable *StructInNestedNSTypeTable() { |
| 243 | static const flatbuffers::TypeCode type_codes[] = { |
| 244 | { flatbuffers::ET_INT, 0, -1 }, |
| 245 | { flatbuffers::ET_INT, 0, -1 } |
| 246 | }; |
| 247 | static const int64_t values[] = { 0, 4, 8 }; |
| 248 | static const char * const names[] = { |
| 249 | "a", |
| 250 | "b" |
| 251 | }; |
| 252 | static const flatbuffers::TypeTable tt = { |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 253 | flatbuffers::ST_STRUCT, 2, type_codes, nullptr, nullptr, values, names |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 254 | }; |
| 255 | return &tt; |
| 256 | } |
| 257 | |
| 258 | } // namespace NamespaceB |
| 259 | } // namespace NamespaceA |
| 260 | |
| 261 | #endif // FLATBUFFERS_GENERATED_NAMESPACETEST1_NAMESPACEA_NAMESPACEB_H_ |