// automatically generated by the FlatBuffers compiler, do not modify


#ifndef FLATBUFFERS_GENERATED_GPULIBRARY_MNN_H_
#define FLATBUFFERS_GENERATED_GPULIBRARY_MNN_H_


#include "Tensor_generated.h"
#include "Type_generated.h"

namespace MNN {

struct GpuLibrary;
struct GpuLibraryT;

inline const flatbuffers::TypeTable *GpuLibraryTypeTable();

struct GpuLibraryT : public flatbuffers::NativeTable {
  typedef GpuLibrary TableType;
  std::vector<int8_t> buffer;
  std::string name;
  GpuLibraryT() {
  }
};

struct GpuLibrary FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
  typedef GpuLibraryT NativeTableType;
  static const flatbuffers::TypeTable *MiniReflectTypeTable() {
    return GpuLibraryTypeTable();
  }
  const flatbuffers::Vector<int8_t> *buffer() const {
    return GetPointer<const flatbuffers::Vector<int8_t> *>(4);
  }
  const flatbuffers::String *name() const {
    return GetPointer<const flatbuffers::String *>(6);
  }
  bool Verify(flatbuffers::Verifier &verifier) const {
    return VerifyTableStart(verifier) &&
           VerifyOffset(verifier, 4) &&
           verifier.VerifyVector(buffer()) &&
           VerifyOffset(verifier, 6) &&
           verifier.VerifyString(name()) &&
           verifier.EndTable();
  }
  GpuLibraryT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
  void UnPackTo(GpuLibraryT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
  static flatbuffers::Offset<GpuLibrary> Pack(flatbuffers::FlatBufferBuilder &_fbb, const GpuLibraryT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
};

struct GpuLibraryBuilder {
  flatbuffers::FlatBufferBuilder &fbb_;
  flatbuffers::uoffset_t start_;
  void add_buffer(flatbuffers::Offset<flatbuffers::Vector<int8_t>> buffer) {
    fbb_.AddOffset(4, buffer);
  }
  void add_name(flatbuffers::Offset<flatbuffers::String> name) {
    fbb_.AddOffset(6, name);
  }
  explicit GpuLibraryBuilder(flatbuffers::FlatBufferBuilder &_fbb)
        : fbb_(_fbb) {
    start_ = fbb_.StartTable();
  }
  GpuLibraryBuilder &operator=(const GpuLibraryBuilder &);
  flatbuffers::Offset<GpuLibrary> Finish() {
    const auto end = fbb_.EndTable(start_);
    auto o = flatbuffers::Offset<GpuLibrary>(end);
    return o;
  }
};

inline flatbuffers::Offset<GpuLibrary> CreateGpuLibrary(
    flatbuffers::FlatBufferBuilder &_fbb,
    flatbuffers::Offset<flatbuffers::Vector<int8_t>> buffer = 0,
    flatbuffers::Offset<flatbuffers::String> name = 0) {
  GpuLibraryBuilder builder_(_fbb);
  builder_.add_name(name);
  builder_.add_buffer(buffer);
  return builder_.Finish();
}

flatbuffers::Offset<GpuLibrary> CreateGpuLibrary(flatbuffers::FlatBufferBuilder &_fbb, const GpuLibraryT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);

inline GpuLibraryT *GpuLibrary::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
  auto _o = new GpuLibraryT();
  UnPackTo(_o, _resolver);
  return _o;
}

inline void GpuLibrary::UnPackTo(GpuLibraryT *_o, const flatbuffers::resolver_function_t *_resolver) const {
  (void)_o;
  (void)_resolver;
  { auto _e = buffer(); if (_e) { _o->buffer.resize(_e->size()); for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->buffer[_i] = _e->Get(_i); } } };
  { auto _e = name(); if (_e) _o->name = _e->str(); };
}

inline flatbuffers::Offset<GpuLibrary> GpuLibrary::Pack(flatbuffers::FlatBufferBuilder &_fbb, const GpuLibraryT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
  return CreateGpuLibrary(_fbb, _o, _rehasher);
}

inline flatbuffers::Offset<GpuLibrary> CreateGpuLibrary(flatbuffers::FlatBufferBuilder &_fbb, const GpuLibraryT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
  (void)_rehasher;
  (void)_o;
  struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const GpuLibraryT* __o; const flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
  auto _buffer = _o->buffer.size() ? _fbb.CreateVector(_o->buffer) : 0;
  auto _name = _o->name.empty() ? 0 : _fbb.CreateString(_o->name);
  return MNN::CreateGpuLibrary(
      _fbb,
      _buffer,
      _name);
}

inline const flatbuffers::TypeTable *GpuLibraryTypeTable() {
  static const flatbuffers::TypeCode type_codes[] = {
    { flatbuffers::ET_CHAR, 1, -1 },
    { flatbuffers::ET_STRING, 0, -1 }
  };
  static const char * const names[] = {
    "buffer",
    "name"
  };
  static const flatbuffers::TypeTable tt = {
    flatbuffers::ST_TABLE, 2, type_codes, nullptr, nullptr, names
  };
  return &tt;
}

}  // namespace MNN

#endif  // FLATBUFFERS_GENERATED_GPULIBRARY_MNN_H_
