// @generated by thrift-lite.py; do not edit.
#pragma once

#include <bitset>
#include <cstddef>
#include <cstdint>
#include <map>
#include <set>
#include <span>
#include <string>
#include <string_view>
#include <vector>

#include <dwarfs/thrift_lite/concepts.h>
#include <dwarfs/thrift_lite/enum_traits.h>
#include <dwarfs/thrift_lite/field_ref.h>
#include <dwarfs/thrift_lite/types.h>

#include <parallel_hashmap/btree.h>

namespace dwarfs::thrift_lite {

struct writer_options;

} // namespace dwarfs::thrift_lite

namespace apache::thrift::frozen::schema {

class Field final {
 public:
  Field();
  Field(Field const&);
  Field(Field&&) noexcept;
  auto operator=(Field const&) -> Field&;
  auto operator=(Field&&) noexcept -> Field&;

#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
  friend bool operator==(Field const& lhs, Field const& rhs) = default;
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

  void read(::dwarfs::thrift_lite::protocol_reader_type auto& r);
  void write(::dwarfs::thrift_lite::protocol_writer_type auto& w) const;

  [[nodiscard]] auto has_any_fields_for_write(::dwarfs::thrift_lite::writer_options const& opts) const noexcept -> bool;

  auto layoutId() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int16_t&>{layoutId_};
  }
  auto layoutId_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int16_t&>{layoutId_};
  }
  auto layoutId() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int16_t const&>{layoutId_};
  }
  auto layoutId_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int16_t const&>{layoutId_};
  }

  auto offset() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int16_t&>{offset_};
  }
  auto offset_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int16_t&>{offset_};
  }
  auto offset() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int16_t const&>{offset_};
  }
  auto offset_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int16_t const&>{offset_};
  }

 private:
  std::int16_t layoutId_{};
  std::int16_t offset_{};
};

class Layout final {
 public:
  Layout();
  Layout(Layout const&);
  Layout(Layout&&) noexcept;
  auto operator=(Layout const&) -> Layout&;
  auto operator=(Layout&&) noexcept -> Layout&;

#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
  friend bool operator==(Layout const& lhs, Layout const& rhs) = default;
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

  void read(::dwarfs::thrift_lite::protocol_reader_type auto& r);
  void write(::dwarfs::thrift_lite::protocol_writer_type auto& w) const;

  [[nodiscard]] auto has_any_fields_for_write(::dwarfs::thrift_lite::writer_options const& opts) const noexcept -> bool;

  auto size() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int32_t&>{size_};
  }
  auto size_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int32_t&>{size_};
  }
  auto size() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int32_t const&>{size_};
  }
  auto size_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int32_t const&>{size_};
  }

  auto bits() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int16_t&>{bits_};
  }
  auto bits_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int16_t&>{bits_};
  }
  auto bits() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int16_t const&>{bits_};
  }
  auto bits_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int16_t const&>{bits_};
  }

  auto fields() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<phmap::btree_map<std::int16_t, Field>&>{fields_};
  }
  auto fields_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<phmap::btree_map<std::int16_t, Field>&>{fields_};
  }
  auto fields() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<phmap::btree_map<std::int16_t, Field> const&>{fields_};
  }
  auto fields_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<phmap::btree_map<std::int16_t, Field> const&>{fields_};
  }

  auto typeName() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::string&>{typeName_};
  }
  auto typeName_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::string&>{typeName_};
  }
  auto typeName() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::string const&>{typeName_};
  }
  auto typeName_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::string const&>{typeName_};
  }

 private:
  std::int32_t size_{};
  std::int16_t bits_{};
  phmap::btree_map<std::int16_t, Field> fields_{};
  std::string typeName_{};
};

class Schema final {
 public:
  Schema();
  Schema(Schema const&);
  Schema(Schema&&) noexcept;
  auto operator=(Schema const&) -> Schema&;
  auto operator=(Schema&&) noexcept -> Schema&;

#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
  friend bool operator==(Schema const& lhs, Schema const& rhs) = default;
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

  void read(::dwarfs::thrift_lite::protocol_reader_type auto& r);
  void write(::dwarfs::thrift_lite::protocol_writer_type auto& w) const;

  [[nodiscard]] auto has_any_fields_for_write(::dwarfs::thrift_lite::writer_options const& opts) const noexcept -> bool;

  auto fileVersion() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int32_t&>{fileVersion_};
  }
  auto fileVersion_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int32_t&>{fileVersion_};
  }
  auto fileVersion() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int32_t const&>{fileVersion_};
  }
  auto fileVersion_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int32_t const&>{fileVersion_};
  }

  auto relaxTypeChecks() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<bool&>{relaxTypeChecks_};
  }
  auto relaxTypeChecks_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<bool&>{relaxTypeChecks_};
  }
  auto relaxTypeChecks() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<bool const&>{relaxTypeChecks_};
  }
  auto relaxTypeChecks_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<bool const&>{relaxTypeChecks_};
  }

  auto layouts() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<phmap::btree_map<std::int16_t, Layout>&>{layouts_};
  }
  auto layouts_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<phmap::btree_map<std::int16_t, Layout>&>{layouts_};
  }
  auto layouts() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<phmap::btree_map<std::int16_t, Layout> const&>{layouts_};
  }
  auto layouts_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<phmap::btree_map<std::int16_t, Layout> const&>{layouts_};
  }

  auto rootLayout() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int16_t&>{rootLayout_};
  }
  auto rootLayout_ref() & noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int16_t&>{rootLayout_};
  }
  auto rootLayout() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int16_t const&>{rootLayout_};
  }
  auto rootLayout_ref() const& noexcept {
    return ::dwarfs::thrift_lite::field_ref<std::int16_t const&>{rootLayout_};
  }

 private:
  std::int32_t fileVersion_{};
  bool relaxTypeChecks_{};
  phmap::btree_map<std::int16_t, Layout> layouts_{};
  std::int16_t rootLayout_{};
};

} // namespace apache::thrift::frozen::schema

namespace dwarfs::thrift_lite {

} // namespace dwarfs::thrift_lite

#include "frozen_types-inl.h"
