/**
 * Autogenerated by Thrift for /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_fbthrift/fbthrift/work/fbthrift-2024.09.23.00/thrift/lib/thrift/standard.thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated @nocommit
 */
#pragma once

#include "thrift/lib/thrift/gen-cpp2/standard_types.h"

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


namespace apache {
namespace thrift {
namespace detail {

template <>
struct TccStructTraits<::apache::thrift::type::TypeUri> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};
template <>
struct TccStructTraits<::apache::thrift::type::TypeName> {
  static void translateFieldName(
      std::string_view _fname,
      int16_t& fid,
      apache::thrift::protocol::TType& _ftype) noexcept;
};

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

namespace apache::thrift::type {

template <class Protocol_>
void TypeUri::readNoXfer(Protocol_* iprot) {
  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;
  _readState.fieldId = 0;

  _readState.readStructBegin(iprot);

  _readState.readFieldBegin(iprot);
  if (_readState.atStop()) {
    apache::thrift::clear(*this);
  } else {
    if (iprot->kUsesFieldNames()) {
      _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<TypeUri>>();
    }
    switch (_readState.fieldId) {
      case 1:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING)) {
          this->uri_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::readWithContext(*iprot, value_.uri, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 2:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING)) {
          this->typeHashPrefixSha2_256_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::binary, ::apache::thrift::type::ByteString>::readWithContext(*iprot, value_.typeHashPrefixSha2_256, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 3:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING)) {
          this->scopedName_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::readWithContext(*iprot, value_.scopedName, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 4:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRING)) {
          this->definitionKey_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::binary, ::apache::thrift::type::ByteString>::readWithContext(*iprot, value_.definitionKey, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      default:
      {
        _readState.skip(iprot);
        break;
      }
    }
    _readState.readFieldEnd(iprot);
    _readState.readFieldBegin(iprot);
    if (UNLIKELY(!_readState.atStop())) {
      using apache::thrift::protocol::TProtocolException;
      TProtocolException::throwUnionMissingStop();
    }
  }
  _readState.readStructEnd(iprot);
}
template <class Protocol_>
uint32_t TypeUri::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("TypeUri");
  switch(this->getType()) {
    case TypeUri::Type::uri:
    {
      xfer += prot_->serializedFieldSize("uri", apache::thrift::protocol::T_STRING, 1);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, value_.uri);
      break;
    }
    case TypeUri::Type::typeHashPrefixSha2_256:
    {
      xfer += prot_->serializedFieldSize("typeHashPrefixSha2_256", apache::thrift::protocol::T_STRING, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::binary, ::apache::thrift::type::ByteString>::serializedSize<false>(*prot_, value_.typeHashPrefixSha2_256);
      break;
    }
    case TypeUri::Type::scopedName:
    {
      xfer += prot_->serializedFieldSize("scopedName", apache::thrift::protocol::T_STRING, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, value_.scopedName);
      break;
    }
    case TypeUri::Type::definitionKey:
    {
      xfer += prot_->serializedFieldSize("definitionKey", apache::thrift::protocol::T_STRING, 4);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::binary, ::apache::thrift::type::ByteString>::serializedSize<false>(*prot_, value_.definitionKey);
      break;
    }
    case TypeUri::Type::__EMPTY__:;
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t TypeUri::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("TypeUri");
  switch(this->getType()) {
    case TypeUri::Type::uri:
    {
      xfer += prot_->serializedFieldSize("uri", apache::thrift::protocol::T_STRING, 1);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, value_.uri);
      break;
    }
    case TypeUri::Type::typeHashPrefixSha2_256:
    {
      xfer += prot_->serializedFieldSize("typeHashPrefixSha2_256", apache::thrift::protocol::T_STRING, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::binary, ::apache::thrift::type::ByteString>::serializedSize<true>(*prot_, value_.typeHashPrefixSha2_256);
      break;
    }
    case TypeUri::Type::scopedName:
    {
      xfer += prot_->serializedFieldSize("scopedName", apache::thrift::protocol::T_STRING, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::serializedSize<false>(*prot_, value_.scopedName);
      break;
    }
    case TypeUri::Type::definitionKey:
    {
      xfer += prot_->serializedFieldSize("definitionKey", apache::thrift::protocol::T_STRING, 4);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::binary, ::apache::thrift::type::ByteString>::serializedSize<true>(*prot_, value_.definitionKey);
      break;
    }
    case TypeUri::Type::__EMPTY__:;
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t TypeUri::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("TypeUri");
  switch(this->getType()) {
    case TypeUri::Type::uri:
    {
      constexpr int16_t kPrevFieldId = 0;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 1, kPrevFieldId>(*prot_, "uri", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::write(*prot_, value_.uri);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeUri::Type::typeHashPrefixSha2_256:
    {
      constexpr int16_t kPrevFieldId = 1;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 2, kPrevFieldId>(*prot_, "typeHashPrefixSha2_256", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::binary, ::apache::thrift::type::ByteString>::write(*prot_, value_.typeHashPrefixSha2_256);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeUri::Type::scopedName:
    {
      constexpr int16_t kPrevFieldId = 2;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 3, kPrevFieldId>(*prot_, "scopedName", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::string, ::std::string>::write(*prot_, value_.scopedName);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeUri::Type::definitionKey:
    {
      constexpr int16_t kPrevFieldId = 3;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRING, 4, kPrevFieldId>(*prot_, "definitionKey", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::binary, ::apache::thrift::type::ByteString>::write(*prot_, value_.definitionKey);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeUri::Type::__EMPTY__:;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


template <class Protocol_>
void TypeName::readNoXfer(Protocol_* iprot) {
  apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState;
  _readState.fieldId = 0;

  _readState.readStructBegin(iprot);

  _readState.readFieldBegin(iprot);
  if (_readState.atStop()) {
    apache::thrift::clear(*this);
  } else {
    if (iprot->kUsesFieldNames()) {
      _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<TypeName>>();
    }
    switch (_readState.fieldId) {
      case 1:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32)) {
          this->boolType_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::readWithContext(*iprot, value_.boolType, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 2:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32)) {
          this->byteType_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::readWithContext(*iprot, value_.byteType, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 3:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32)) {
          this->i16Type_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::readWithContext(*iprot, value_.i16Type, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 4:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32)) {
          this->i32Type_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::readWithContext(*iprot, value_.i32Type, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 5:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32)) {
          this->i64Type_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::readWithContext(*iprot, value_.i64Type, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 6:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32)) {
          this->floatType_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::readWithContext(*iprot, value_.floatType, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 7:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32)) {
          this->doubleType_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::readWithContext(*iprot, value_.doubleType, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 8:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32)) {
          this->stringType_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::readWithContext(*iprot, value_.stringType, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 9:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32)) {
          this->binaryType_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::readWithContext(*iprot, value_.binaryType, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 10:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->enumType_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::readWithContext(*iprot, value_.enumType, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 17:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->typedefType_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::readWithContext(*iprot, value_.typedefType, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 11:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->structType_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::readWithContext(*iprot, value_.structType, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 12:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->unionType_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::readWithContext(*iprot, value_.unionType, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 13:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_STRUCT)) {
          this->exceptionType_ref().emplace();
          _readState.beforeSubobject(iprot);
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::readWithContext(*iprot, value_.exceptionType, _readState);
          _readState.afterSubobject(iprot);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 14:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32)) {
          this->listType_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::readWithContext(*iprot, value_.listType, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 15:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32)) {
          this->setType_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::readWithContext(*iprot, value_.setType, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      case 16:
      {
        if (_readState.isCompatibleWithType(iprot, apache::thrift::protocol::T_I32)) {
          this->mapType_ref().emplace();
          ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::readWithContext(*iprot, value_.mapType, _readState);
        } else {
          _readState.skip(iprot);
        }
        break;
      }
      default:
      {
        _readState.skip(iprot);
        break;
      }
    }
    _readState.readFieldEnd(iprot);
    _readState.readFieldBegin(iprot);
    if (UNLIKELY(!_readState.atStop())) {
      using apache::thrift::protocol::TProtocolException;
      TProtocolException::throwUnionMissingStop();
    }
  }
  _readState.readStructEnd(iprot);
}
template <class Protocol_>
uint32_t TypeName::serializedSize(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("TypeName");
  switch(this->getType()) {
    case TypeName::Type::boolType:
    {
      xfer += prot_->serializedFieldSize("boolType", apache::thrift::protocol::T_I32, 1);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.boolType);
      break;
    }
    case TypeName::Type::byteType:
    {
      xfer += prot_->serializedFieldSize("byteType", apache::thrift::protocol::T_I32, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.byteType);
      break;
    }
    case TypeName::Type::i16Type:
    {
      xfer += prot_->serializedFieldSize("i16Type", apache::thrift::protocol::T_I32, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.i16Type);
      break;
    }
    case TypeName::Type::i32Type:
    {
      xfer += prot_->serializedFieldSize("i32Type", apache::thrift::protocol::T_I32, 4);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.i32Type);
      break;
    }
    case TypeName::Type::i64Type:
    {
      xfer += prot_->serializedFieldSize("i64Type", apache::thrift::protocol::T_I32, 5);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.i64Type);
      break;
    }
    case TypeName::Type::floatType:
    {
      xfer += prot_->serializedFieldSize("floatType", apache::thrift::protocol::T_I32, 6);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.floatType);
      break;
    }
    case TypeName::Type::doubleType:
    {
      xfer += prot_->serializedFieldSize("doubleType", apache::thrift::protocol::T_I32, 7);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.doubleType);
      break;
    }
    case TypeName::Type::stringType:
    {
      xfer += prot_->serializedFieldSize("stringType", apache::thrift::protocol::T_I32, 8);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.stringType);
      break;
    }
    case TypeName::Type::binaryType:
    {
      xfer += prot_->serializedFieldSize("binaryType", apache::thrift::protocol::T_I32, 9);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.binaryType);
      break;
    }
    case TypeName::Type::enumType:
    {
      xfer += prot_->serializedFieldSize("enumType", apache::thrift::protocol::T_STRUCT, 10);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::serializedSize<false>(*prot_, value_.enumType);
      break;
    }
    case TypeName::Type::typedefType:
    {
      xfer += prot_->serializedFieldSize("typedefType", apache::thrift::protocol::T_STRUCT, 17);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::serializedSize<false>(*prot_, value_.typedefType);
      break;
    }
    case TypeName::Type::structType:
    {
      xfer += prot_->serializedFieldSize("structType", apache::thrift::protocol::T_STRUCT, 11);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::serializedSize<false>(*prot_, value_.structType);
      break;
    }
    case TypeName::Type::unionType:
    {
      xfer += prot_->serializedFieldSize("unionType", apache::thrift::protocol::T_STRUCT, 12);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::serializedSize<false>(*prot_, value_.unionType);
      break;
    }
    case TypeName::Type::exceptionType:
    {
      xfer += prot_->serializedFieldSize("exceptionType", apache::thrift::protocol::T_STRUCT, 13);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::serializedSize<false>(*prot_, value_.exceptionType);
      break;
    }
    case TypeName::Type::listType:
    {
      xfer += prot_->serializedFieldSize("listType", apache::thrift::protocol::T_I32, 14);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.listType);
      break;
    }
    case TypeName::Type::setType:
    {
      xfer += prot_->serializedFieldSize("setType", apache::thrift::protocol::T_I32, 15);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.setType);
      break;
    }
    case TypeName::Type::mapType:
    {
      xfer += prot_->serializedFieldSize("mapType", apache::thrift::protocol::T_I32, 16);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.mapType);
      break;
    }
    case TypeName::Type::__EMPTY__:;
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t TypeName::serializedSizeZC(Protocol_ const* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->serializedStructSize("TypeName");
  switch(this->getType()) {
    case TypeName::Type::boolType:
    {
      xfer += prot_->serializedFieldSize("boolType", apache::thrift::protocol::T_I32, 1);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.boolType);
      break;
    }
    case TypeName::Type::byteType:
    {
      xfer += prot_->serializedFieldSize("byteType", apache::thrift::protocol::T_I32, 2);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.byteType);
      break;
    }
    case TypeName::Type::i16Type:
    {
      xfer += prot_->serializedFieldSize("i16Type", apache::thrift::protocol::T_I32, 3);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.i16Type);
      break;
    }
    case TypeName::Type::i32Type:
    {
      xfer += prot_->serializedFieldSize("i32Type", apache::thrift::protocol::T_I32, 4);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.i32Type);
      break;
    }
    case TypeName::Type::i64Type:
    {
      xfer += prot_->serializedFieldSize("i64Type", apache::thrift::protocol::T_I32, 5);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.i64Type);
      break;
    }
    case TypeName::Type::floatType:
    {
      xfer += prot_->serializedFieldSize("floatType", apache::thrift::protocol::T_I32, 6);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.floatType);
      break;
    }
    case TypeName::Type::doubleType:
    {
      xfer += prot_->serializedFieldSize("doubleType", apache::thrift::protocol::T_I32, 7);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.doubleType);
      break;
    }
    case TypeName::Type::stringType:
    {
      xfer += prot_->serializedFieldSize("stringType", apache::thrift::protocol::T_I32, 8);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.stringType);
      break;
    }
    case TypeName::Type::binaryType:
    {
      xfer += prot_->serializedFieldSize("binaryType", apache::thrift::protocol::T_I32, 9);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.binaryType);
      break;
    }
    case TypeName::Type::enumType:
    {
      xfer += prot_->serializedFieldSize("enumType", apache::thrift::protocol::T_STRUCT, 10);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::serializedSize<true>(*prot_, value_.enumType);
      break;
    }
    case TypeName::Type::typedefType:
    {
      xfer += prot_->serializedFieldSize("typedefType", apache::thrift::protocol::T_STRUCT, 17);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::serializedSize<true>(*prot_, value_.typedefType);
      break;
    }
    case TypeName::Type::structType:
    {
      xfer += prot_->serializedFieldSize("structType", apache::thrift::protocol::T_STRUCT, 11);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::serializedSize<true>(*prot_, value_.structType);
      break;
    }
    case TypeName::Type::unionType:
    {
      xfer += prot_->serializedFieldSize("unionType", apache::thrift::protocol::T_STRUCT, 12);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::serializedSize<true>(*prot_, value_.unionType);
      break;
    }
    case TypeName::Type::exceptionType:
    {
      xfer += prot_->serializedFieldSize("exceptionType", apache::thrift::protocol::T_STRUCT, 13);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::serializedSize<true>(*prot_, value_.exceptionType);
      break;
    }
    case TypeName::Type::listType:
    {
      xfer += prot_->serializedFieldSize("listType", apache::thrift::protocol::T_I32, 14);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.listType);
      break;
    }
    case TypeName::Type::setType:
    {
      xfer += prot_->serializedFieldSize("setType", apache::thrift::protocol::T_I32, 15);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.setType);
      break;
    }
    case TypeName::Type::mapType:
    {
      xfer += prot_->serializedFieldSize("mapType", apache::thrift::protocol::T_I32, 16);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::serializedSize<false>(*prot_, value_.mapType);
      break;
    }
    case TypeName::Type::__EMPTY__:;
  }
  xfer += prot_->serializedSizeStop();
  return xfer;
}

template <class Protocol_>
uint32_t TypeName::write(Protocol_* prot_) const {
  uint32_t xfer = 0;
  xfer += prot_->writeStructBegin("TypeName");
  switch(this->getType()) {
    case TypeName::Type::boolType:
    {
      constexpr int16_t kPrevFieldId = 0;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 1, kPrevFieldId>(*prot_, "boolType", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::write(*prot_, value_.boolType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::byteType:
    {
      constexpr int16_t kPrevFieldId = 1;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 2, kPrevFieldId>(*prot_, "byteType", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::write(*prot_, value_.byteType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::i16Type:
    {
      constexpr int16_t kPrevFieldId = 2;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 3, kPrevFieldId>(*prot_, "i16Type", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::write(*prot_, value_.i16Type);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::i32Type:
    {
      constexpr int16_t kPrevFieldId = 3;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 4, kPrevFieldId>(*prot_, "i32Type", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::write(*prot_, value_.i32Type);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::i64Type:
    {
      constexpr int16_t kPrevFieldId = 4;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 5, kPrevFieldId>(*prot_, "i64Type", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::write(*prot_, value_.i64Type);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::floatType:
    {
      constexpr int16_t kPrevFieldId = 5;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 6, kPrevFieldId>(*prot_, "floatType", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::write(*prot_, value_.floatType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::doubleType:
    {
      constexpr int16_t kPrevFieldId = 6;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 7, kPrevFieldId>(*prot_, "doubleType", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::write(*prot_, value_.doubleType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::stringType:
    {
      constexpr int16_t kPrevFieldId = 7;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 8, kPrevFieldId>(*prot_, "stringType", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::write(*prot_, value_.stringType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::binaryType:
    {
      constexpr int16_t kPrevFieldId = 8;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 9, kPrevFieldId>(*prot_, "binaryType", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::write(*prot_, value_.binaryType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::enumType:
    {
      constexpr int16_t kPrevFieldId = 9;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 10, kPrevFieldId>(*prot_, "enumType", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::write(*prot_, value_.enumType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::typedefType:
    {
      constexpr int16_t kPrevFieldId = 10;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 17, kPrevFieldId>(*prot_, "typedefType", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::write(*prot_, value_.typedefType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::structType:
    {
      constexpr int16_t kPrevFieldId = 17;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 11, kPrevFieldId>(*prot_, "structType", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::write(*prot_, value_.structType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::unionType:
    {
      constexpr int16_t kPrevFieldId = 11;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 12, kPrevFieldId>(*prot_, "unionType", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::write(*prot_, value_.unionType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::exceptionType:
    {
      constexpr int16_t kPrevFieldId = 12;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_STRUCT, 13, kPrevFieldId>(*prot_, "exceptionType", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::variant, ::apache::thrift::type::TypeUri>::write(*prot_, value_.exceptionType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::listType:
    {
      constexpr int16_t kPrevFieldId = 13;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 14, kPrevFieldId>(*prot_, "listType", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::write(*prot_, value_.listType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::setType:
    {
      constexpr int16_t kPrevFieldId = 14;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 15, kPrevFieldId>(*prot_, "setType", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::write(*prot_, value_.setType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::mapType:
    {
      constexpr int16_t kPrevFieldId = 15;
      xfer += ::apache::thrift::detail::writeFieldBegin<apache::thrift::protocol::T_I32, 16, kPrevFieldId>(*prot_, "mapType", false);
      xfer += ::apache::thrift::detail::pm::protocol_methods<::apache::thrift::type_class::enumeration, ::apache::thrift::type::Void>::write(*prot_, value_.mapType);
      xfer += prot_->writeFieldEnd();
      break;
    }
    case TypeName::Type::__EMPTY__:;
  }
  xfer += prot_->writeFieldStop();
  xfer += prot_->writeStructEnd();
  return xfer;
}

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


} // namespace apache::thrift::type
