"Fossies" - the Fresh Open Source Software Archive

Member "flatbuffers-23.1.21/android/app/src/main/cpp/generated/animal_generated.h" (21 Jan 2023, 4059 Bytes) of package /linux/misc/flatbuffers-23.1.21.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "animal_generated.h" see the Fossies "Dox" file reference documentation.

    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 // Ensure the included flatbuffers.h is the same version as when this file was
   10 // generated, otherwise it may not be compatible.
   11 static_assert(FLATBUFFERS_VERSION_MAJOR == 2 &&
   12               FLATBUFFERS_VERSION_MINOR == 0 &&
   13               FLATBUFFERS_VERSION_REVISION == 8,
   14              "Non-compatible flatbuffers version included");
   15 
   16 namespace com {
   17 namespace fbs {
   18 namespace app {
   19 
   20 struct Animal;
   21 struct AnimalBuilder;
   22 
   23 struct Animal FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
   24   typedef AnimalBuilder Builder;
   25   enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
   26     VT_NAME = 4,
   27     VT_SOUND = 6,
   28     VT_WEIGHT = 8
   29   };
   30   const flatbuffers::String *name() const {
   31     return GetPointer<const flatbuffers::String *>(VT_NAME);
   32   }
   33   const flatbuffers::String *sound() const {
   34     return GetPointer<const flatbuffers::String *>(VT_SOUND);
   35   }
   36   uint16_t weight() const {
   37     return GetField<uint16_t>(VT_WEIGHT, 0);
   38   }
   39   bool Verify(flatbuffers::Verifier &verifier) const {
   40     return VerifyTableStart(verifier) &&
   41            VerifyOffset(verifier, VT_NAME) &&
   42            verifier.VerifyString(name()) &&
   43            VerifyOffset(verifier, VT_SOUND) &&
   44            verifier.VerifyString(sound()) &&
   45            VerifyField<uint16_t>(verifier, VT_WEIGHT, 2) &&
   46            verifier.EndTable();
   47   }
   48 };
   49 
   50 struct AnimalBuilder {
   51   typedef Animal Table;
   52   flatbuffers::FlatBufferBuilder &fbb_;
   53   flatbuffers::uoffset_t start_;
   54   void add_name(flatbuffers::Offset<flatbuffers::String> name) {
   55     fbb_.AddOffset(Animal::VT_NAME, name);
   56   }
   57   void add_sound(flatbuffers::Offset<flatbuffers::String> sound) {
   58     fbb_.AddOffset(Animal::VT_SOUND, sound);
   59   }
   60   void add_weight(uint16_t weight) {
   61     fbb_.AddElement<uint16_t>(Animal::VT_WEIGHT, weight, 0);
   62   }
   63   explicit AnimalBuilder(flatbuffers::FlatBufferBuilder &_fbb)
   64         : fbb_(_fbb) {
   65     start_ = fbb_.StartTable();
   66   }
   67   flatbuffers::Offset<Animal> Finish() {
   68     const auto end = fbb_.EndTable(start_);
   69     auto o = flatbuffers::Offset<Animal>(end);
   70     return o;
   71   }
   72 };
   73 
   74 inline flatbuffers::Offset<Animal> CreateAnimal(
   75     flatbuffers::FlatBufferBuilder &_fbb,
   76     flatbuffers::Offset<flatbuffers::String> name = 0,
   77     flatbuffers::Offset<flatbuffers::String> sound = 0,
   78     uint16_t weight = 0) {
   79   AnimalBuilder builder_(_fbb);
   80   builder_.add_sound(sound);
   81   builder_.add_name(name);
   82   builder_.add_weight(weight);
   83   return builder_.Finish();
   84 }
   85 
   86 inline flatbuffers::Offset<Animal> CreateAnimalDirect(
   87     flatbuffers::FlatBufferBuilder &_fbb,
   88     const char *name = nullptr,
   89     const char *sound = nullptr,
   90     uint16_t weight = 0) {
   91   auto name__ = name ? _fbb.CreateString(name) : 0;
   92   auto sound__ = sound ? _fbb.CreateString(sound) : 0;
   93   return com::fbs::app::CreateAnimal(
   94       _fbb,
   95       name__,
   96       sound__,
   97       weight);
   98 }
   99 
  100 inline const com::fbs::app::Animal *GetAnimal(const void *buf) {
  101   return flatbuffers::GetRoot<com::fbs::app::Animal>(buf);
  102 }
  103 
  104 inline const com::fbs::app::Animal *GetSizePrefixedAnimal(const void *buf) {
  105   return flatbuffers::GetSizePrefixedRoot<com::fbs::app::Animal>(buf);
  106 }
  107 
  108 inline bool VerifyAnimalBuffer(
  109     flatbuffers::Verifier &verifier) {
  110   return verifier.VerifyBuffer<com::fbs::app::Animal>(nullptr);
  111 }
  112 
  113 inline bool VerifySizePrefixedAnimalBuffer(
  114     flatbuffers::Verifier &verifier) {
  115   return verifier.VerifySizePrefixedBuffer<com::fbs::app::Animal>(nullptr);
  116 }
  117 
  118 inline void FinishAnimalBuffer(
  119     flatbuffers::FlatBufferBuilder &fbb,
  120     flatbuffers::Offset<com::fbs::app::Animal> root) {
  121   fbb.Finish(root);
  122 }
  123 
  124 inline void FinishSizePrefixedAnimalBuffer(
  125     flatbuffers::FlatBufferBuilder &fbb,
  126     flatbuffers::Offset<com::fbs::app::Animal> root) {
  127   fbb.FinishSizePrefixed(root);
  128 }
  129 
  130 }  // namespace app
  131 }  // namespace fbs
  132 }  // namespace com
  133 
  134 #endif  // FLATBUFFERS_GENERATED_ANIMAL_COM_FBS_APP_H_