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


#ifndef FLATBUFFERS_GENERATED_EXTRAINFO_MNN_H_
#define FLATBUFFERS_GENERATED_EXTRAINFO_MNN_H_


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

namespace MNN {

struct ExtraInfo;
struct ExtraInfoT;

inline const flatbuffers::TypeTable *ExtraInfoTypeTable();

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

struct ExtraInfo FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
  typedef ExtraInfoT NativeTableType;
  static const flatbuffers::TypeTable *MiniReflectTypeTable() {
    return ExtraInfoTypeTable();
  }
  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);
  }
  const flatbuffers::String *version() const {
    return GetPointer<const flatbuffers::String *>(8);
  }
  bool Verify(flatbuffers::Verifier &verifier) const {
    return VerifyTableStart(verifier) &&
           VerifyOffset(verifier, 4) &&
           verifier.VerifyVector(buffer()) &&
           VerifyOffset(verifier, 6) &&
           verifier.VerifyString(name()) &&
           VerifyOffset(verifier, 8) &&
           verifier.VerifyString(version()) &&
           verifier.EndTable();
  }
  ExtraInfoT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;
  void UnPackTo(ExtraInfoT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;
  static flatbuffers::Offset<ExtraInfo> Pack(flatbuffers::FlatBufferBuilder &_fbb, const ExtraInfoT* _o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);
};

struct ExtraInfoBuilder {
  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);
  }
  void add_version(flatbuffers::Offset<flatbuffers::String> version) {
    fbb_.AddOffset(8, version);
  }
  explicit ExtraInfoBuilder(flatbuffers::FlatBufferBuilder &_fbb)
        : fbb_(_fbb) {
    start_ = fbb_.StartTable();
  }
  ExtraInfoBuilder &operator=(const ExtraInfoBuilder &);
  flatbuffers::Offset<ExtraInfo> Finish() {
    const auto end = fbb_.EndTable(start_);
    auto o = flatbuffers::Offset<ExtraInfo>(end);
    return o;
  }
};

inline flatbuffers::Offset<ExtraInfo> CreateExtraInfo(
    flatbuffers::FlatBufferBuilder &_fbb,
    flatbuffers::Offset<flatbuffers::Vector<int8_t>> buffer = 0,
    flatbuffers::Offset<flatbuffers::String> name = 0,
    flatbuffers::Offset<flatbuffers::String> version = 0) {
  ExtraInfoBuilder builder_(_fbb);
  builder_.add_version(version);
  builder_.add_name(name);
  builder_.add_buffer(buffer);
  return builder_.Finish();
}

flatbuffers::Offset<ExtraInfo> CreateExtraInfo(flatbuffers::FlatBufferBuilder &_fbb, const ExtraInfoT *_o, const flatbuffers::rehasher_function_t *_rehasher = nullptr);

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

inline void ExtraInfo::UnPackTo(ExtraInfoT *_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(); };
  { auto _e = version(); if (_e) _o->version = _e->str(); };
}

inline flatbuffers::Offset<ExtraInfo> ExtraInfo::Pack(flatbuffers::FlatBufferBuilder &_fbb, const ExtraInfoT* _o, const flatbuffers::rehasher_function_t *_rehasher) {
  return CreateExtraInfo(_fbb, _o, _rehasher);
}

inline flatbuffers::Offset<ExtraInfo> CreateExtraInfo(flatbuffers::FlatBufferBuilder &_fbb, const ExtraInfoT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
  (void)_rehasher;
  (void)_o;
  struct _VectorArgs { flatbuffers::FlatBufferBuilder *__fbb; const ExtraInfoT* __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);
  auto _version = _o->version.empty() ? 0 : _fbb.CreateString(_o->version);
  return MNN::CreateExtraInfo(
      _fbb,
      _buffer,
      _name,
      _version);
}

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

}  // namespace MNN

#endif  // FLATBUFFERS_GENERATED_EXTRAINFO_MNN_H_
