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


#ifndef FLATBUFFERS_GENERATED_ENGINECONFIG_HIPDNN_DATA_SDK_DATA_OBJECTS_H_
#define FLATBUFFERS_GENERATED_ENGINECONFIG_HIPDNN_DATA_SDK_DATA_OBJECTS_H_

#include "flatbuffers/flatbuffers.h"

// Ensure the included flatbuffers.h is the same version as when this file was
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 25 &&
              FLATBUFFERS_VERSION_MINOR == 9 &&
              FLATBUFFERS_VERSION_REVISION == 23,
             "Non-compatible flatbuffers version included");

#include "knob_value_generated.h"

namespace hipdnn_data_sdk {
namespace data_objects {

struct KnobSetting;
struct KnobSettingBuilder;
struct KnobSettingT;

struct EngineConfig;
struct EngineConfigBuilder;
struct EngineConfigT;

bool operator==(const KnobSettingT &lhs, const KnobSettingT &rhs);
bool operator!=(const KnobSettingT &lhs, const KnobSettingT &rhs);
bool operator==(const EngineConfigT &lhs, const EngineConfigT &rhs);
bool operator!=(const EngineConfigT &lhs, const EngineConfigT &rhs);

struct KnobSettingT : public ::flatbuffers::NativeTable {
  typedef KnobSetting TableType;
  int64_t knob_id = 0;
  hipdnn_data_sdk::data_objects::KnobValueUnion value{};
};

struct KnobSetting FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
  typedef KnobSettingT NativeTableType;
  typedef KnobSettingBuilder Builder;
  enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
    VT_KNOB_ID = 4,
    VT_VALUE_TYPE = 6,
    VT_VALUE = 8
  };
  int64_t knob_id() const {
    return GetField<int64_t>(VT_KNOB_ID, 0);
  }
  bool mutate_knob_id(int64_t _knob_id = 0) {
    return SetField<int64_t>(VT_KNOB_ID, _knob_id, 0);
  }
  hipdnn_data_sdk::data_objects::KnobValue value_type() const {
    return static_cast<hipdnn_data_sdk::data_objects::KnobValue>(GetField<uint8_t>(VT_VALUE_TYPE, 0));
  }
  const void *value() const {
    return GetPointer<const void *>(VT_VALUE);
  }
  template<typename T> const T *value_as() const;
  const hipdnn_data_sdk::data_objects::IntValue *value_as_IntValue() const {
    return value_type() == hipdnn_data_sdk::data_objects::KnobValue::IntValue ? static_cast<const hipdnn_data_sdk::data_objects::IntValue *>(value()) : nullptr;
  }
  const hipdnn_data_sdk::data_objects::FloatValue *value_as_FloatValue() const {
    return value_type() == hipdnn_data_sdk::data_objects::KnobValue::FloatValue ? static_cast<const hipdnn_data_sdk::data_objects::FloatValue *>(value()) : nullptr;
  }
  const hipdnn_data_sdk::data_objects::StringValue *value_as_StringValue() const {
    return value_type() == hipdnn_data_sdk::data_objects::KnobValue::StringValue ? static_cast<const hipdnn_data_sdk::data_objects::StringValue *>(value()) : nullptr;
  }
  void *mutable_value() {
    return GetPointer<void *>(VT_VALUE);
  }
  bool Verify(::flatbuffers::Verifier &verifier) const {
    return VerifyTableStart(verifier) &&
           VerifyField<int64_t>(verifier, VT_KNOB_ID, 8) &&
           VerifyField<uint8_t>(verifier, VT_VALUE_TYPE, 1) &&
           VerifyOffset(verifier, VT_VALUE) &&
           VerifyKnobValue(verifier, value(), value_type()) &&
           verifier.EndTable();
  }
  KnobSettingT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  void UnPackTo(KnobSettingT *_o, const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  static ::flatbuffers::Offset<KnobSetting> Pack(::flatbuffers::FlatBufferBuilder &_fbb, const KnobSettingT* _o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);
};

template<> inline const hipdnn_data_sdk::data_objects::IntValue *KnobSetting::value_as<hipdnn_data_sdk::data_objects::IntValue>() const {
  return value_as_IntValue();
}

template<> inline const hipdnn_data_sdk::data_objects::FloatValue *KnobSetting::value_as<hipdnn_data_sdk::data_objects::FloatValue>() const {
  return value_as_FloatValue();
}

template<> inline const hipdnn_data_sdk::data_objects::StringValue *KnobSetting::value_as<hipdnn_data_sdk::data_objects::StringValue>() const {
  return value_as_StringValue();
}

struct KnobSettingBuilder {
  typedef KnobSetting Table;
  ::flatbuffers::FlatBufferBuilder &fbb_;
  ::flatbuffers::uoffset_t start_;
  void add_knob_id(int64_t knob_id) {
    fbb_.AddElement<int64_t>(KnobSetting::VT_KNOB_ID, knob_id, 0);
  }
  void add_value_type(hipdnn_data_sdk::data_objects::KnobValue value_type) {
    fbb_.AddElement<uint8_t>(KnobSetting::VT_VALUE_TYPE, static_cast<uint8_t>(value_type), 0);
  }
  void add_value(::flatbuffers::Offset<void> value) {
    fbb_.AddOffset(KnobSetting::VT_VALUE, value);
  }
  explicit KnobSettingBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
        : fbb_(_fbb) {
    start_ = fbb_.StartTable();
  }
  ::flatbuffers::Offset<KnobSetting> Finish() {
    const auto end = fbb_.EndTable(start_);
    auto o = ::flatbuffers::Offset<KnobSetting>(end);
    return o;
  }
};

inline ::flatbuffers::Offset<KnobSetting> CreateKnobSetting(
    ::flatbuffers::FlatBufferBuilder &_fbb,
    int64_t knob_id = 0,
    hipdnn_data_sdk::data_objects::KnobValue value_type = hipdnn_data_sdk::data_objects::KnobValue::NONE,
    ::flatbuffers::Offset<void> value = 0) {
  KnobSettingBuilder builder_(_fbb);
  builder_.add_knob_id(knob_id);
  builder_.add_value(value);
  builder_.add_value_type(value_type);
  return builder_.Finish();
}

::flatbuffers::Offset<KnobSetting> CreateKnobSetting(::flatbuffers::FlatBufferBuilder &_fbb, const KnobSettingT *_o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);

struct EngineConfigT : public ::flatbuffers::NativeTable {
  typedef EngineConfig TableType;
  int64_t engine_id = 0;
  std::vector<std::unique_ptr<hipdnn_data_sdk::data_objects::KnobSettingT>> knobs{};
  EngineConfigT() = default;
  EngineConfigT(const EngineConfigT &o);
  EngineConfigT(EngineConfigT&&) FLATBUFFERS_NOEXCEPT = default;
  EngineConfigT &operator=(EngineConfigT o) FLATBUFFERS_NOEXCEPT;
};

struct EngineConfig FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
  typedef EngineConfigT NativeTableType;
  typedef EngineConfigBuilder Builder;
  enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
    VT_ENGINE_ID = 4,
    VT_KNOBS = 6
  };
  int64_t engine_id() const {
    return GetField<int64_t>(VT_ENGINE_ID, 0);
  }
  bool mutate_engine_id(int64_t _engine_id = 0) {
    return SetField<int64_t>(VT_ENGINE_ID, _engine_id, 0);
  }
  const ::flatbuffers::Vector<::flatbuffers::Offset<hipdnn_data_sdk::data_objects::KnobSetting>> *knobs() const {
    return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<hipdnn_data_sdk::data_objects::KnobSetting>> *>(VT_KNOBS);
  }
  ::flatbuffers::Vector<::flatbuffers::Offset<hipdnn_data_sdk::data_objects::KnobSetting>> *mutable_knobs() {
    return GetPointer<::flatbuffers::Vector<::flatbuffers::Offset<hipdnn_data_sdk::data_objects::KnobSetting>> *>(VT_KNOBS);
  }
  bool Verify(::flatbuffers::Verifier &verifier) const {
    return VerifyTableStart(verifier) &&
           VerifyField<int64_t>(verifier, VT_ENGINE_ID, 8) &&
           VerifyOffset(verifier, VT_KNOBS) &&
           verifier.VerifyVector(knobs()) &&
           verifier.VerifyVectorOfTables(knobs()) &&
           verifier.EndTable();
  }
  EngineConfigT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  void UnPackTo(EngineConfigT *_o, const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  static ::flatbuffers::Offset<EngineConfig> Pack(::flatbuffers::FlatBufferBuilder &_fbb, const EngineConfigT* _o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);
};

struct EngineConfigBuilder {
  typedef EngineConfig Table;
  ::flatbuffers::FlatBufferBuilder &fbb_;
  ::flatbuffers::uoffset_t start_;
  void add_engine_id(int64_t engine_id) {
    fbb_.AddElement<int64_t>(EngineConfig::VT_ENGINE_ID, engine_id, 0);
  }
  void add_knobs(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<hipdnn_data_sdk::data_objects::KnobSetting>>> knobs) {
    fbb_.AddOffset(EngineConfig::VT_KNOBS, knobs);
  }
  explicit EngineConfigBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
        : fbb_(_fbb) {
    start_ = fbb_.StartTable();
  }
  ::flatbuffers::Offset<EngineConfig> Finish() {
    const auto end = fbb_.EndTable(start_);
    auto o = ::flatbuffers::Offset<EngineConfig>(end);
    return o;
  }
};

inline ::flatbuffers::Offset<EngineConfig> CreateEngineConfig(
    ::flatbuffers::FlatBufferBuilder &_fbb,
    int64_t engine_id = 0,
    ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<hipdnn_data_sdk::data_objects::KnobSetting>>> knobs = 0) {
  EngineConfigBuilder builder_(_fbb);
  builder_.add_engine_id(engine_id);
  builder_.add_knobs(knobs);
  return builder_.Finish();
}

inline ::flatbuffers::Offset<EngineConfig> CreateEngineConfigDirect(
    ::flatbuffers::FlatBufferBuilder &_fbb,
    int64_t engine_id = 0,
    const std::vector<::flatbuffers::Offset<hipdnn_data_sdk::data_objects::KnobSetting>> *knobs = nullptr) {
  auto knobs__ = knobs ? _fbb.CreateVector<::flatbuffers::Offset<hipdnn_data_sdk::data_objects::KnobSetting>>(*knobs) : 0;
  return hipdnn_data_sdk::data_objects::CreateEngineConfig(
      _fbb,
      engine_id,
      knobs__);
}

::flatbuffers::Offset<EngineConfig> CreateEngineConfig(::flatbuffers::FlatBufferBuilder &_fbb, const EngineConfigT *_o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);


inline bool operator==(const KnobSettingT &lhs, const KnobSettingT &rhs) {
  return
      (lhs.knob_id == rhs.knob_id) &&
      (lhs.value == rhs.value);
}

inline bool operator!=(const KnobSettingT &lhs, const KnobSettingT &rhs) {
    return !(lhs == rhs);
}


inline KnobSettingT *KnobSetting::UnPack(const ::flatbuffers::resolver_function_t *_resolver) const {
  auto _o = std::unique_ptr<KnobSettingT>(new KnobSettingT());
  UnPackTo(_o.get(), _resolver);
  return _o.release();
}

inline void KnobSetting::UnPackTo(KnobSettingT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
  (void)_o;
  (void)_resolver;
  { auto _e = knob_id(); _o->knob_id = _e; }
  { auto _e = value_type(); _o->value.type = _e; }
  { auto _e = value(); if (_e) _o->value.value = hipdnn_data_sdk::data_objects::KnobValueUnion::UnPack(_e, value_type(), _resolver); }
}

inline ::flatbuffers::Offset<KnobSetting> KnobSetting::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const KnobSettingT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  return CreateKnobSetting(_fbb, _o, _rehasher);
}

inline ::flatbuffers::Offset<KnobSetting> CreateKnobSetting(::flatbuffers::FlatBufferBuilder &_fbb, const KnobSettingT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  (void)_rehasher;
  (void)_o;
  struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const KnobSettingT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
  auto _knob_id = _o->knob_id;
  auto _value_type = _o->value.type;
  auto _value = _o->value.Pack(_fbb);
  return hipdnn_data_sdk::data_objects::CreateKnobSetting(
      _fbb,
      _knob_id,
      _value_type,
      _value);
}


inline bool operator==(const EngineConfigT &lhs, const EngineConfigT &rhs) {
  return
      (lhs.engine_id == rhs.engine_id) &&
      (lhs.knobs.size() == rhs.knobs.size() && std::equal(lhs.knobs.cbegin(), lhs.knobs.cend(), rhs.knobs.cbegin(), [](std::unique_ptr<hipdnn_data_sdk::data_objects::KnobSettingT> const &a, std::unique_ptr<hipdnn_data_sdk::data_objects::KnobSettingT> const &b) { return (a == b) || (a && b && *a == *b); }));
}

inline bool operator!=(const EngineConfigT &lhs, const EngineConfigT &rhs) {
    return !(lhs == rhs);
}


inline EngineConfigT::EngineConfigT(const EngineConfigT &o)
      : engine_id(o.engine_id) {
  knobs.reserve(o.knobs.size());
  for (const auto &knobs_ : o.knobs) { knobs.emplace_back((knobs_) ? new hipdnn_data_sdk::data_objects::KnobSettingT(*knobs_) : nullptr); }
}

inline EngineConfigT &EngineConfigT::operator=(EngineConfigT o) FLATBUFFERS_NOEXCEPT {
  std::swap(engine_id, o.engine_id);
  std::swap(knobs, o.knobs);
  return *this;
}

inline EngineConfigT *EngineConfig::UnPack(const ::flatbuffers::resolver_function_t *_resolver) const {
  auto _o = std::unique_ptr<EngineConfigT>(new EngineConfigT());
  UnPackTo(_o.get(), _resolver);
  return _o.release();
}

inline void EngineConfig::UnPackTo(EngineConfigT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
  (void)_o;
  (void)_resolver;
  { auto _e = engine_id(); _o->engine_id = _e; }
  { auto _e = knobs(); if (_e) { _o->knobs.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { if(_o->knobs[_i]) { _e->Get(_i)->UnPackTo(_o->knobs[_i].get(), _resolver); } else { _o->knobs[_i] = std::unique_ptr<hipdnn_data_sdk::data_objects::KnobSettingT>(_e->Get(_i)->UnPack(_resolver)); } } } else { _o->knobs.resize(0); } }
}

inline ::flatbuffers::Offset<EngineConfig> EngineConfig::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const EngineConfigT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  return CreateEngineConfig(_fbb, _o, _rehasher);
}

inline ::flatbuffers::Offset<EngineConfig> CreateEngineConfig(::flatbuffers::FlatBufferBuilder &_fbb, const EngineConfigT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  (void)_rehasher;
  (void)_o;
  struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const EngineConfigT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
  auto _engine_id = _o->engine_id;
  auto _knobs = _o->knobs.size() ? _fbb.CreateVector<::flatbuffers::Offset<hipdnn_data_sdk::data_objects::KnobSetting>> (_o->knobs.size(), [](size_t i, _VectorArgs *__va) { return CreateKnobSetting(*__va->__fbb, __va->__o->knobs[i].get(), __va->__rehasher); }, &_va ) : 0;
  return hipdnn_data_sdk::data_objects::CreateEngineConfig(
      _fbb,
      _engine_id,
      _knobs);
}

inline const hipdnn_data_sdk::data_objects::EngineConfig *GetEngineConfig(const void *buf) {
  return ::flatbuffers::GetRoot<hipdnn_data_sdk::data_objects::EngineConfig>(buf);
}

inline const hipdnn_data_sdk::data_objects::EngineConfig *GetSizePrefixedEngineConfig(const void *buf) {
  return ::flatbuffers::GetSizePrefixedRoot<hipdnn_data_sdk::data_objects::EngineConfig>(buf);
}

inline EngineConfig *GetMutableEngineConfig(void *buf) {
  return ::flatbuffers::GetMutableRoot<EngineConfig>(buf);
}

inline hipdnn_data_sdk::data_objects::EngineConfig *GetMutableSizePrefixedEngineConfig(void *buf) {
  return ::flatbuffers::GetMutableSizePrefixedRoot<hipdnn_data_sdk::data_objects::EngineConfig>(buf);
}

inline bool VerifyEngineConfigBuffer(
    ::flatbuffers::Verifier &verifier) {
  return verifier.VerifyBuffer<hipdnn_data_sdk::data_objects::EngineConfig>(nullptr);
}

inline bool VerifySizePrefixedEngineConfigBuffer(
    ::flatbuffers::Verifier &verifier) {
  return verifier.VerifySizePrefixedBuffer<hipdnn_data_sdk::data_objects::EngineConfig>(nullptr);
}

inline void FinishEngineConfigBuffer(
    ::flatbuffers::FlatBufferBuilder &fbb,
    ::flatbuffers::Offset<hipdnn_data_sdk::data_objects::EngineConfig> root) {
  fbb.Finish(root);
}

inline void FinishSizePrefixedEngineConfigBuffer(
    ::flatbuffers::FlatBufferBuilder &fbb,
    ::flatbuffers::Offset<hipdnn_data_sdk::data_objects::EngineConfig> root) {
  fbb.FinishSizePrefixed(root);
}

inline std::unique_ptr<hipdnn_data_sdk::data_objects::EngineConfigT> UnPackEngineConfig(
    const void *buf,
    const ::flatbuffers::resolver_function_t *res = nullptr) {
  return std::unique_ptr<hipdnn_data_sdk::data_objects::EngineConfigT>(GetEngineConfig(buf)->UnPack(res));
}

inline std::unique_ptr<hipdnn_data_sdk::data_objects::EngineConfigT> UnPackSizePrefixedEngineConfig(
    const void *buf,
    const ::flatbuffers::resolver_function_t *res = nullptr) {
  return std::unique_ptr<hipdnn_data_sdk::data_objects::EngineConfigT>(GetSizePrefixedEngineConfig(buf)->UnPack(res));
}

}  // namespace data_objects
}  // namespace hipdnn_data_sdk

#endif  // FLATBUFFERS_GENERATED_ENGINECONFIG_HIPDNN_DATA_SDK_DATA_OBJECTS_H_
