/**
 * Autogenerated by Thrift for thrift/compiler/test/fixtures/enums/src/module.thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated @nocommit
 */
#include "thrift/compiler/test/fixtures/enums/gen-cpp2/module_types.h"
#include "thrift/compiler/test/fixtures/enums/gen-cpp2/module_types.tcc"

#include <thrift/lib/cpp2/gen/module_types_cpp.h>

#include "thrift/compiler/test/fixtures/enums/gen-cpp2/module_data.h"
[[maybe_unused]] static constexpr std::string_view kModuleName = "module";


namespace apache { namespace thrift {

const std::string_view TEnumTraits<::test::fixtures::enums::Metasyntactic>::__fbthrift_module_name_internal_do_not_use = kModuleName;
folly::Range<::test::fixtures::enums::Metasyntactic const*> const TEnumTraits<::test::fixtures::enums::Metasyntactic>::values = folly::range(TEnumDataStorage<::test::fixtures::enums::Metasyntactic>::values);
folly::Range<std::string_view const*> const TEnumTraits<::test::fixtures::enums::Metasyntactic>::names = folly::range(TEnumDataStorage<::test::fixtures::enums::Metasyntactic>::names);

bool TEnumTraits<::test::fixtures::enums::Metasyntactic>::findName(type value, std::string_view* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_name(value, out);
}

bool TEnumTraits<::test::fixtures::enums::Metasyntactic>::findValue(std::string_view name, type* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_value(name, out);
}

}} // apache::thrift


namespace apache { namespace thrift {

const std::string_view TEnumTraits<::test::fixtures::enums::MyEnum1>::__fbthrift_module_name_internal_do_not_use = kModuleName;
folly::Range<::test::fixtures::enums::MyEnum1 const*> const TEnumTraits<::test::fixtures::enums::MyEnum1>::values = folly::range(TEnumDataStorage<::test::fixtures::enums::MyEnum1>::values);
folly::Range<std::string_view const*> const TEnumTraits<::test::fixtures::enums::MyEnum1>::names = folly::range(TEnumDataStorage<::test::fixtures::enums::MyEnum1>::names);

bool TEnumTraits<::test::fixtures::enums::MyEnum1>::findName(type value, std::string_view* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_name(value, out);
}

bool TEnumTraits<::test::fixtures::enums::MyEnum1>::findValue(std::string_view name, type* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_value(name, out);
}

}} // apache::thrift


namespace apache { namespace thrift {

const std::string_view TEnumTraits<::test::fixtures::enums::MyEnum2>::__fbthrift_module_name_internal_do_not_use = kModuleName;
folly::Range<::test::fixtures::enums::MyEnum2 const*> const TEnumTraits<::test::fixtures::enums::MyEnum2>::values = folly::range(TEnumDataStorage<::test::fixtures::enums::MyEnum2>::values);
folly::Range<std::string_view const*> const TEnumTraits<::test::fixtures::enums::MyEnum2>::names = folly::range(TEnumDataStorage<::test::fixtures::enums::MyEnum2>::names);

bool TEnumTraits<::test::fixtures::enums::MyEnum2>::findName(type value, std::string_view* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_name(value, out);
}

bool TEnumTraits<::test::fixtures::enums::MyEnum2>::findValue(std::string_view name, type* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_value(name, out);
}

}} // apache::thrift


namespace apache { namespace thrift {

const std::string_view TEnumTraits<::test::fixtures::enums::MyEnum3>::__fbthrift_module_name_internal_do_not_use = kModuleName;
folly::Range<::test::fixtures::enums::MyEnum3 const*> const TEnumTraits<::test::fixtures::enums::MyEnum3>::values = folly::range(TEnumDataStorage<::test::fixtures::enums::MyEnum3>::values);
folly::Range<std::string_view const*> const TEnumTraits<::test::fixtures::enums::MyEnum3>::names = folly::range(TEnumDataStorage<::test::fixtures::enums::MyEnum3>::names);

bool TEnumTraits<::test::fixtures::enums::MyEnum3>::findName(type value, std::string_view* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_name(value, out);
}

bool TEnumTraits<::test::fixtures::enums::MyEnum3>::findValue(std::string_view name, type* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_value(name, out);
}

}} // apache::thrift


namespace apache { namespace thrift {

const std::string_view TEnumTraits<::test::fixtures::enums::MyEnum4>::__fbthrift_module_name_internal_do_not_use = kModuleName;
folly::Range<::test::fixtures::enums::MyEnum4 const*> const TEnumTraits<::test::fixtures::enums::MyEnum4>::values = folly::range(TEnumDataStorage<::test::fixtures::enums::MyEnum4>::values);
folly::Range<std::string_view const*> const TEnumTraits<::test::fixtures::enums::MyEnum4>::names = folly::range(TEnumDataStorage<::test::fixtures::enums::MyEnum4>::names);

bool TEnumTraits<::test::fixtures::enums::MyEnum4>::findName(type value, std::string_view* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_name(value, out);
}

bool TEnumTraits<::test::fixtures::enums::MyEnum4>::findValue(std::string_view name, type* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_value(name, out);
}

}} // apache::thrift


namespace apache { namespace thrift {

const std::string_view TEnumTraits<::test::fixtures::enums::MyBitmaskEnum1>::__fbthrift_module_name_internal_do_not_use = kModuleName;
folly::Range<::test::fixtures::enums::MyBitmaskEnum1 const*> const TEnumTraits<::test::fixtures::enums::MyBitmaskEnum1>::values = folly::range(TEnumDataStorage<::test::fixtures::enums::MyBitmaskEnum1>::values);
folly::Range<std::string_view const*> const TEnumTraits<::test::fixtures::enums::MyBitmaskEnum1>::names = folly::range(TEnumDataStorage<::test::fixtures::enums::MyBitmaskEnum1>::names);

bool TEnumTraits<::test::fixtures::enums::MyBitmaskEnum1>::findName(type value, std::string_view* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_name(value, out);
}

bool TEnumTraits<::test::fixtures::enums::MyBitmaskEnum1>::findValue(std::string_view name, type* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_value(name, out);
}

}} // apache::thrift


namespace apache { namespace thrift {

const std::string_view TEnumTraits<::test::fixtures::enums::MyBitmaskEnum2>::__fbthrift_module_name_internal_do_not_use = kModuleName;
folly::Range<::test::fixtures::enums::MyBitmaskEnum2 const*> const TEnumTraits<::test::fixtures::enums::MyBitmaskEnum2>::values = folly::range(TEnumDataStorage<::test::fixtures::enums::MyBitmaskEnum2>::values);
folly::Range<std::string_view const*> const TEnumTraits<::test::fixtures::enums::MyBitmaskEnum2>::names = folly::range(TEnumDataStorage<::test::fixtures::enums::MyBitmaskEnum2>::names);

bool TEnumTraits<::test::fixtures::enums::MyBitmaskEnum2>::findName(type value, std::string_view* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_name(value, out);
}

bool TEnumTraits<::test::fixtures::enums::MyBitmaskEnum2>::findValue(std::string_view name, type* out) noexcept {
  return ::apache::thrift::detail::st::enum_find_value(name, out);
}

}} // apache::thrift


namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::test::fixtures::enums::SomeStruct>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::test::fixtures::enums::SomeStruct>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace test::fixtures::enums {

const char* SomeStruct::__fbthrift_thrift_uri() {
  return "test.dev/fixtures/enums/SomeStruct";
}

std::string_view SomeStruct::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<SomeStruct>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view SomeStruct::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<SomeStruct>::name;
}

SomeStruct::SomeStruct(const SomeStruct&) = default;
SomeStruct& SomeStruct::operator=(const SomeStruct&) = default;
SomeStruct::SomeStruct() :
    __fbthrift_field_reasonable( ::test::fixtures::enums::Metasyntactic::FOO),
    __fbthrift_field_fine( ::test::fixtures::enums::Metasyntactic::BAR),
    __fbthrift_field_questionable(static_cast< ::test::fixtures::enums::Metasyntactic>(-1)) {
}


SomeStruct::~SomeStruct() {}

SomeStruct::SomeStruct([[maybe_unused]] SomeStruct&& other) noexcept :
    __fbthrift_field_reasonable(std::move(other.__fbthrift_field_reasonable)),
    __fbthrift_field_fine(std::move(other.__fbthrift_field_fine)),
    __fbthrift_field_questionable(std::move(other.__fbthrift_field_questionable)),
    __fbthrift_field_tags(std::move(other.__fbthrift_field_tags)),
    __isset(other.__isset) {
}

SomeStruct& SomeStruct::operator=([[maybe_unused]] SomeStruct&& other) noexcept {
    this->__fbthrift_field_reasonable = std::move(other.__fbthrift_field_reasonable);
    this->__fbthrift_field_fine = std::move(other.__fbthrift_field_fine);
    this->__fbthrift_field_questionable = std::move(other.__fbthrift_field_questionable);
    this->__fbthrift_field_tags = std::move(other.__fbthrift_field_tags);
    __isset = other.__isset;
    return *this;
}


SomeStruct::SomeStruct(apache::thrift::FragileConstructor, ::test::fixtures::enums::Metasyntactic reasonable__arg, ::test::fixtures::enums::Metasyntactic fine__arg, ::test::fixtures::enums::Metasyntactic questionable__arg, ::std::set<::std::int32_t> tags__arg) :
    __fbthrift_field_reasonable(std::move(reasonable__arg)),
    __fbthrift_field_fine(std::move(fine__arg)),
    __fbthrift_field_questionable(std::move(questionable__arg)),
    __fbthrift_field_tags(std::move(tags__arg)) { 
  __isset.set(folly::index_constant<0>(), true);
  __isset.set(folly::index_constant<1>(), true);
  __isset.set(folly::index_constant<2>(), true);
  __isset.set(folly::index_constant<3>(), true);
}


void SomeStruct::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_reasonable = ::test::fixtures::enums::Metasyntactic();
  this->__fbthrift_field_fine = ::test::fixtures::enums::Metasyntactic();
  this->__fbthrift_field_questionable = ::test::fixtures::enums::Metasyntactic();
  this->__fbthrift_field_tags.clear();
  __isset = {};
}

void SomeStruct::__fbthrift_clear_terse_fields() {
}

bool SomeStruct::__fbthrift_is_empty() const {
  return false;
}

bool SomeStruct::operator==([[maybe_unused]] const SomeStruct& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool SomeStruct::operator<([[maybe_unused]] const SomeStruct& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}

const ::std::set<::std::int32_t>& SomeStruct::get_tags() const& {
  return __fbthrift_field_tags;
}

::std::set<::std::int32_t> SomeStruct::get_tags() && {
  return std::move(__fbthrift_field_tags);
}


void swap([[maybe_unused]] SomeStruct& a, [[maybe_unused]] SomeStruct& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_reasonable, b.__fbthrift_field_reasonable);
  swap(a.__fbthrift_field_fine, b.__fbthrift_field_fine);
  swap(a.__fbthrift_field_questionable, b.__fbthrift_field_questionable);
  swap(a.__fbthrift_field_tags, b.__fbthrift_field_tags);
  swap(a.__isset, b.__isset);
}

template void SomeStruct::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t SomeStruct::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t SomeStruct::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t SomeStruct::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void SomeStruct::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t SomeStruct::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t SomeStruct::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t SomeStruct::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;


} // namespace test::fixtures::enums

namespace apache {
namespace thrift {
namespace detail {

void TccStructTraits<::test::fixtures::enums::MyStruct>::translateFieldName(
    std::string_view _fname,
    int16_t& fid,
    apache::thrift::protocol::TType& _ftype) noexcept {
  using data = apache::thrift::TStructDataStorage<::test::fixtures::enums::MyStruct>;
  static const st::translate_field_name_table table{
      data::fields_size,
      data::fields_names.data(),
      data::fields_ids.data(),
      data::fields_types.data()};
  st::translate_field_name(_fname, fid, _ftype, table);
}

} // namespace detail
} // namespace thrift
} // namespace apache

namespace test::fixtures::enums {

const char* MyStruct::__fbthrift_thrift_uri() {
  return "test.dev/fixtures/enums/MyStruct";
}

std::string_view MyStruct::__fbthrift_get_field_name(::apache::thrift::FieldOrdinal ord) {
  if (ord == ::apache::thrift::FieldOrdinal{0}) { return {}; }
  return apache::thrift::TStructDataStorage<MyStruct>::fields_names[folly::to_underlying(ord) - 1];
}
std::string_view MyStruct::__fbthrift_get_class_name() {
  return apache::thrift::TStructDataStorage<MyStruct>::name;
}


MyStruct::MyStruct(apache::thrift::FragileConstructor, ::test::fixtures::enums::MyEnum2 me2_3__arg, ::test::fixtures::enums::MyEnum3 me3_n3__arg, ::test::fixtures::enums::MyEnum1 me1_t1__arg, ::test::fixtures::enums::MyEnum1 me1_t2__arg) :
    __fbthrift_field_me2_3(std::move(me2_3__arg)),
    __fbthrift_field_me3_n3(std::move(me3_n3__arg)),
    __fbthrift_field_me1_t1(std::move(me1_t1__arg)),
    __fbthrift_field_me1_t2(std::move(me1_t2__arg)) { 
  __isset.set(folly::index_constant<0>(), true);
  __isset.set(folly::index_constant<1>(), true);
  __isset.set(folly::index_constant<2>(), true);
  __isset.set(folly::index_constant<3>(), true);
}


void MyStruct::__fbthrift_clear() {
  // clear all fields
  this->__fbthrift_field_me2_3 = ::test::fixtures::enums::MyEnum2();
  this->__fbthrift_field_me3_n3 = ::test::fixtures::enums::MyEnum3();
  this->__fbthrift_field_me1_t1 = ::test::fixtures::enums::MyEnum1();
  this->__fbthrift_field_me1_t2 = ::test::fixtures::enums::MyEnum1();
  __isset = {};
}

void MyStruct::__fbthrift_clear_terse_fields() {
}

bool MyStruct::__fbthrift_is_empty() const {
  return false;
}

bool MyStruct::operator==([[maybe_unused]] const MyStruct& rhs) const {
  return ::apache::thrift::op::detail::StructEquality{}(*this, rhs);
}

bool MyStruct::operator<([[maybe_unused]] const MyStruct& rhs) const {
  return ::apache::thrift::op::detail::StructLessThan{}(*this, rhs);
}


void swap([[maybe_unused]] MyStruct& a, [[maybe_unused]] MyStruct& b) {
  using ::std::swap;
  swap(a.__fbthrift_field_me2_3, b.__fbthrift_field_me2_3);
  swap(a.__fbthrift_field_me3_n3, b.__fbthrift_field_me3_n3);
  swap(a.__fbthrift_field_me1_t1, b.__fbthrift_field_me1_t1);
  swap(a.__fbthrift_field_me1_t2, b.__fbthrift_field_me1_t2);
  swap(a.__isset, b.__isset);
}

template void MyStruct::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
template uint32_t MyStruct::write<>(apache::thrift::BinaryProtocolWriter*) const;
template uint32_t MyStruct::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
template uint32_t MyStruct::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
template void MyStruct::readNoXfer<>(apache::thrift::CompactProtocolReader*);
template uint32_t MyStruct::write<>(apache::thrift::CompactProtocolWriter*) const;
template uint32_t MyStruct::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
template uint32_t MyStruct::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;


} // namespace test::fixtures::enums

namespace test::fixtures::enums { namespace {
[[maybe_unused]] FOLLY_ERASE void validateAdapters() {
}
}} // namespace test::fixtures::enums
namespace apache::thrift::detail::annotation {
}
