1 /** 2 * Autogenerated by Thrift for src/module.thrift 3 * 4 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 5 * @generated @nocommit 6 */ 7 #pragma once 8 9 #include "thrift/compiler/test/fixtures/empty-struct/gen-cpp2/module_types.h" 10 11 #include <thrift/lib/cpp2/gen/module_types_tcc.h> 12 13 14 namespace apache { 15 namespace thrift { 16 namespace detail { 17 18 template <> 19 struct TccStructTraits<::cpp2::Empty> { 20 static void translateFieldName( 21 folly::StringPiece _fname, 22 int16_t& fid, 23 apache::thrift::protocol::TType& _ftype) noexcept; 24 }; 25 template <> 26 struct TccStructTraits<::cpp2::Nada> { 27 static void translateFieldName( 28 folly::StringPiece _fname, 29 int16_t& fid, 30 apache::thrift::protocol::TType& _ftype) noexcept; 31 }; 32 33 } // namespace detail 34 } // namespace thrift 35 } // namespace apache 36 37 namespace cpp2 { 38 39 template <class Protocol_> readNoXfer(Protocol_ * iprot)40void Empty::readNoXfer(Protocol_* iprot) { 41 apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState; 42 43 _readState.readStructBegin(iprot); 44 45 using apache::thrift::TProtocolException; 46 47 48 if (UNLIKELY(!_readState.advanceToNextField( 49 iprot, 50 0, 51 0, 52 apache::thrift::protocol::T_STOP))) { 53 goto _loop; 54 } 55 56 _end: 57 _readState.readStructEnd(iprot); 58 59 return; 60 61 _loop: 62 _readState.afterAdvanceFailure(iprot); 63 if (_readState.atStop()) { 64 goto _end; 65 } 66 if (iprot->kUsesFieldNames()) { 67 _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Empty>>(); 68 } 69 70 switch (_readState.fieldId) { 71 default: 72 { 73 _readState.skip(iprot); 74 _readState.readFieldEnd(iprot); 75 _readState.readFieldBeginNoInline(iprot); 76 goto _loop; 77 } 78 } 79 } 80 81 template <class Protocol_> serializedSize(Protocol_ const * prot_) const82uint32_t Empty::serializedSize(Protocol_ const* prot_) const { 83 uint32_t xfer = 0; 84 xfer += prot_->serializedStructSize("Empty"); 85 xfer += prot_->serializedSizeStop(); 86 return xfer; 87 } 88 89 template <class Protocol_> serializedSizeZC(Protocol_ const * prot_) const90uint32_t Empty::serializedSizeZC(Protocol_ const* prot_) const { 91 uint32_t xfer = 0; 92 xfer += prot_->serializedStructSize("Empty"); 93 xfer += prot_->serializedSizeStop(); 94 return xfer; 95 } 96 97 template <class Protocol_> write(Protocol_ * prot_) const98uint32_t Empty::write(Protocol_* prot_) const { 99 uint32_t xfer = 0; 100 xfer += prot_->writeStructBegin("Empty"); 101 xfer += prot_->writeFieldStop(); 102 xfer += prot_->writeStructEnd(); 103 return xfer; 104 } 105 106 extern template void Empty::readNoXfer<>(apache::thrift::BinaryProtocolReader*); 107 extern template uint32_t Empty::write<>(apache::thrift::BinaryProtocolWriter*) const; 108 extern template uint32_t Empty::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; 109 extern template uint32_t Empty::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; 110 extern template void Empty::readNoXfer<>(apache::thrift::CompactProtocolReader*); 111 extern template uint32_t Empty::write<>(apache::thrift::CompactProtocolWriter*) const; 112 extern template uint32_t Empty::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; 113 extern template uint32_t Empty::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; 114 115 } // cpp2 116 namespace cpp2 { 117 118 template <class Protocol_> readNoXfer(Protocol_ * iprot)119void Nada::readNoXfer(Protocol_* iprot) { 120 apache::thrift::detail::ProtocolReaderStructReadState<Protocol_> _readState; 121 _readState.fieldId = 0; 122 123 _readState.readStructBegin(iprot); 124 125 _readState.readFieldBegin(iprot); 126 if (_readState.atStop()) { 127 apache::thrift::clear(*this); 128 } else { 129 if (iprot->kUsesFieldNames()) { 130 _readState.template fillFieldTraitsFromName<apache::thrift::detail::TccStructTraits<Nada>>(); 131 } 132 switch (_readState.fieldId) { 133 default: 134 { 135 _readState.skip(iprot); 136 break; 137 } 138 } 139 _readState.readFieldEnd(iprot); 140 _readState.readFieldBegin(iprot); 141 if (UNLIKELY(!_readState.atStop())) { 142 using apache::thrift::protocol::TProtocolException; 143 TProtocolException::throwUnionMissingStop(); 144 } 145 } 146 _readState.readStructEnd(iprot); 147 } 148 template <class Protocol_> serializedSize(Protocol_ const * prot_) const149uint32_t Nada::serializedSize(Protocol_ const* prot_) const { 150 uint32_t xfer = 0; 151 xfer += prot_->serializedStructSize("Nada"); 152 switch(this->getType()) { 153 case Nada::Type::__EMPTY__:; 154 } 155 xfer += prot_->serializedSizeStop(); 156 return xfer; 157 } 158 159 template <class Protocol_> serializedSizeZC(Protocol_ const * prot_) const160uint32_t Nada::serializedSizeZC(Protocol_ const* prot_) const { 161 uint32_t xfer = 0; 162 xfer += prot_->serializedStructSize("Nada"); 163 switch(this->getType()) { 164 case Nada::Type::__EMPTY__:; 165 } 166 xfer += prot_->serializedSizeStop(); 167 return xfer; 168 } 169 170 template <class Protocol_> write(Protocol_ * prot_) const171uint32_t Nada::write(Protocol_* prot_) const { 172 uint32_t xfer = 0; 173 xfer += prot_->writeStructBegin("Nada"); 174 switch(this->getType()) { 175 case Nada::Type::__EMPTY__:; 176 } 177 xfer += prot_->writeFieldStop(); 178 xfer += prot_->writeStructEnd(); 179 return xfer; 180 } 181 182 extern template void Nada::readNoXfer<>(apache::thrift::BinaryProtocolReader*); 183 extern template uint32_t Nada::write<>(apache::thrift::BinaryProtocolWriter*) const; 184 extern template uint32_t Nada::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const; 185 extern template uint32_t Nada::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const; 186 extern template void Nada::readNoXfer<>(apache::thrift::CompactProtocolReader*); 187 extern template uint32_t Nada::write<>(apache::thrift::CompactProtocolWriter*) const; 188 extern template uint32_t Nada::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const; 189 extern template uint32_t Nada::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const; 190 191 } // cpp2 192