• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // automatically generated by the FlatBuffers compiler, do not modify
2 
3 
4 #ifndef FLATBUFFERS_GENERATED_ANIMAL_COM_FBS_APP_H_
5 #define FLATBUFFERS_GENERATED_ANIMAL_COM_FBS_APP_H_
6 
7 #include "flatbuffers/flatbuffers.h"
8 
9 namespace com {
10 namespace fbs {
11 namespace app {
12 
13 struct Animal;
14 struct AnimalBuilder;
15 
16 struct Animal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
17   typedef AnimalBuilder Builder;
18   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
19     VT_NAME = 4,
20     VT_SOUND = 6,
21     VT_WEIGHT = 8
22   };
nameFLATBUFFERS_FINAL_CLASS23   const flatbuffers::String *name() const {
24     return GetPointer<const flatbuffers::String *>(VT_NAME);
25   }
soundFLATBUFFERS_FINAL_CLASS26   const flatbuffers::String *sound() const {
27     return GetPointer<const flatbuffers::String *>(VT_SOUND);
28   }
weightFLATBUFFERS_FINAL_CLASS29   uint16_t weight() const {
30     return GetField<uint16_t>(VT_WEIGHT, 0);
31   }
VerifyFLATBUFFERS_FINAL_CLASS32   bool Verify(flatbuffers::Verifier &verifier) const {
33     return VerifyTableStart(verifier) &&
34            VerifyOffset(verifier, VT_NAME) &&
35            verifier.VerifyString(name()) &&
36            VerifyOffset(verifier, VT_SOUND) &&
37            verifier.VerifyString(sound()) &&
38            VerifyField<uint16_t>(verifier, VT_WEIGHT) &&
39            verifier.EndTable();
40   }
41 };
42 
43 struct AnimalBuilder {
44   typedef Animal Table;
45   flatbuffers::FlatBufferBuilder &fbb_;
46   flatbuffers::uoffset_t start_;
add_nameAnimalBuilder47   void add_name(flatbuffers::Offset<flatbuffers::String> name) {
48     fbb_.AddOffset(Animal::VT_NAME, name);
49   }
add_soundAnimalBuilder50   void add_sound(flatbuffers::Offset<flatbuffers::String> sound) {
51     fbb_.AddOffset(Animal::VT_SOUND, sound);
52   }
add_weightAnimalBuilder53   void add_weight(uint16_t weight) {
54     fbb_.AddElement<uint16_t>(Animal::VT_WEIGHT, weight, 0);
55   }
AnimalBuilderAnimalBuilder56   explicit AnimalBuilder(flatbuffers::FlatBufferBuilder &_fbb)
57         : fbb_(_fbb) {
58     start_ = fbb_.StartTable();
59   }
60   AnimalBuilder &operator=(const AnimalBuilder &);
FinishAnimalBuilder61   flatbuffers::Offset<Animal> Finish() {
62     const auto end = fbb_.EndTable(start_);
63     auto o = flatbuffers::Offset<Animal>(end);
64     return o;
65   }
66 };
67 
68 inline flatbuffers::Offset<Animal> CreateAnimal(
69     flatbuffers::FlatBufferBuilder &_fbb,
70     flatbuffers::Offset<flatbuffers::String> name = 0,
71     flatbuffers::Offset<flatbuffers::String> sound = 0,
72     uint16_t weight = 0) {
73   AnimalBuilder builder_(_fbb);
74   builder_.add_sound(sound);
75   builder_.add_name(name);
76   builder_.add_weight(weight);
77   return builder_.Finish();
78 }
79 
80 inline flatbuffers::Offset<Animal> CreateAnimalDirect(
81     flatbuffers::FlatBufferBuilder &_fbb,
82     const char *name = nullptr,
83     const char *sound = nullptr,
84     uint16_t weight = 0) {
85   auto name__ = name ? _fbb.CreateString(name) : 0;
86   auto sound__ = sound ? _fbb.CreateString(sound) : 0;
87   return com::fbs::app::CreateAnimal(
88       _fbb,
89       name__,
90       sound__,
91       weight);
92 }
93 
GetAnimal(const void * buf)94 inline const com::fbs::app::Animal *GetAnimal(const void *buf) {
95   return flatbuffers::GetRoot<com::fbs::app::Animal>(buf);
96 }
97 
GetSizePrefixedAnimal(const void * buf)98 inline const com::fbs::app::Animal *GetSizePrefixedAnimal(const void *buf) {
99   return flatbuffers::GetSizePrefixedRoot<com::fbs::app::Animal>(buf);
100 }
101 
VerifyAnimalBuffer(flatbuffers::Verifier & verifier)102 inline bool VerifyAnimalBuffer(
103     flatbuffers::Verifier &verifier) {
104   return verifier.VerifyBuffer<com::fbs::app::Animal>(nullptr);
105 }
106 
VerifySizePrefixedAnimalBuffer(flatbuffers::Verifier & verifier)107 inline bool VerifySizePrefixedAnimalBuffer(
108     flatbuffers::Verifier &verifier) {
109   return verifier.VerifySizePrefixedBuffer<com::fbs::app::Animal>(nullptr);
110 }
111 
FinishAnimalBuffer(flatbuffers::FlatBufferBuilder & fbb,flatbuffers::Offset<com::fbs::app::Animal> root)112 inline void FinishAnimalBuffer(
113     flatbuffers::FlatBufferBuilder &fbb,
114     flatbuffers::Offset<com::fbs::app::Animal> root) {
115   fbb.Finish(root);
116 }
117 
FinishSizePrefixedAnimalBuffer(flatbuffers::FlatBufferBuilder & fbb,flatbuffers::Offset<com::fbs::app::Animal> root)118 inline void FinishSizePrefixedAnimalBuffer(
119     flatbuffers::FlatBufferBuilder &fbb,
120     flatbuffers::Offset<com::fbs::app::Animal> root) {
121   fbb.FinishSizePrefixed(root);
122 }
123 
124 }  // namespace app
125 }  // namespace fbs
126 }  // namespace com
127 
128 #endif  // FLATBUFFERS_GENERATED_ANIMAL_COM_FBS_APP_H_
129