text: /**
   * Autogenerated by Thrift
   *
   * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
   *  @generated
   */
  #pragma once
  
  #include "thrift/compiler/test/fixtures/fatal-compat/gen-cpp2/service3.h"
  #include <thrift/lib/cpp/TApplicationException.h>
  #include <folly/io/IOBuf.h>
  #include <folly/io/IOBufQueue.h>
  #include <thrift/lib/cpp/transport/THeader.h>
  #include <thrift/lib/cpp2/server/Cpp2ConnContext.h>
  #include <thrift/lib/cpp2/GeneratedCodeHelper.h>
  #include <thrift/lib/cpp2/GeneratedSerializationCodeHelper.h>
  
  namespace test_cpp2 { namespace cpp_reflection {
  
  template <class Protocol_>
  uint32_t service3_methodA_pargs_read(Protocol_* iprot, service3_methodA_pargs* obj) {
    (void)obj;
    auto _xferStart = iprot->getCurrentPosition().getCurrentPosition();
    std::string _fname;
    apache::thrift::protocol::TType _ftype;
    int16_t fid;
  
    iprot->readStructBegin(_fname);
  
    using apache::thrift::TProtocolException;
  
  
    while (true) {
      iprot->readFieldBegin(_fname, _ftype, fid);
      if (_ftype == apache::thrift::protocol::T_STOP) {
        break;
      }
      if (iprot->kUsesFieldNames()) {
        obj->translateFieldName(_fname, fid, _ftype);
      }
      switch (fid) {
        default:
        {
          iprot->skip(_ftype);
          break;
        }
      }
      iprot->readFieldEnd();
    }
    iprot->readStructEnd();
  
    return iprot->getCurrentPosition().getCurrentPosition() - _xferStart;
  }
  
  template <class Protocol_>
  uint32_t service3_methodA_pargs_serializedSize(Protocol_ const* prot_, const service3_methodA_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodA_pargs");
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodA_pargs_serializedSizeZC(Protocol_ const* prot_, const service3_methodA_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodA_pargs");
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodA_pargs_write(Protocol_* prot_, const service3_methodA_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->writeStructBegin("service3_methodA_pargs");
    xfer += prot_->writeFieldStop();
    xfer += prot_->writeStructEnd();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodA_presult_read(Protocol_* iprot, service3_methodA_presult* obj) {
    (void)obj;
    auto _xferStart = iprot->getCurrentPosition().getCurrentPosition();
    std::string _fname;
    apache::thrift::protocol::TType _ftype;
    int16_t fid;
  
    iprot->readStructBegin(_fname);
  
    using apache::thrift::TProtocolException;
  
  
    while (true) {
      iprot->readFieldBegin(_fname, _ftype, fid);
      if (_ftype == apache::thrift::protocol::T_STOP) {
        break;
      }
      if (iprot->kUsesFieldNames()) {
        obj->translateFieldName(_fname, fid, _ftype);
      }
      switch (fid) {
        default:
        {
          iprot->skip(_ftype);
          break;
        }
      }
      iprot->readFieldEnd();
    }
    iprot->readStructEnd();
  
    return iprot->getCurrentPosition().getCurrentPosition() - _xferStart;
  }
  
  template <class Protocol_>
  uint32_t service3_methodA_presult_serializedSize(Protocol_ const* prot_, const service3_methodA_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodA_presult");
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodA_presult_serializedSizeZC(Protocol_ const* prot_, const service3_methodA_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodA_presult");
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodA_presult_write(Protocol_* prot_, const service3_methodA_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->writeStructBegin("service3_methodA_presult");
    xfer += prot_->writeFieldStop();
    xfer += prot_->writeStructEnd();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodB_pargs_read(Protocol_* iprot, service3_methodB_pargs* obj) {
    (void)obj;
    auto _xferStart = iprot->getCurrentPosition().getCurrentPosition();
    std::string _fname;
    apache::thrift::protocol::TType _ftype;
    int16_t fid;
  
    iprot->readStructBegin(_fname);
  
    using apache::thrift::TProtocolException;
  
  
    while (true) {
      iprot->readFieldBegin(_fname, _ftype, fid);
      if (_ftype == apache::thrift::protocol::T_STOP) {
        break;
      }
      if (iprot->kUsesFieldNames()) {
        obj->translateFieldName(_fname, fid, _ftype);
      }
      switch (fid) {
        case 1:
        {
          if (_ftype == apache::thrift::protocol::T_I32) {
            iprot->readI32((*const_cast<int32_t*>(obj->x)));
          } else {
            iprot->skip(_ftype);
          }
          break;
        }
        case 2:
        {
          if (_ftype == apache::thrift::protocol::T_STRUCT) {
            ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct1>::read(iprot, &(*const_cast< ::test_cpp2::cpp_reflection::struct1*>(obj->y)));
          } else {
            iprot->skip(_ftype);
          }
          break;
        }
        case 3:
        {
          if (_ftype == apache::thrift::protocol::T_DOUBLE) {
            iprot->readDouble((*const_cast<double*>(obj->z)));
          } else {
            iprot->skip(_ftype);
          }
          break;
        }
        default:
        {
          iprot->skip(_ftype);
          break;
        }
      }
      iprot->readFieldEnd();
    }
    iprot->readStructEnd();
  
    return iprot->getCurrentPosition().getCurrentPosition() - _xferStart;
  }
  
  template <class Protocol_>
  uint32_t service3_methodB_pargs_serializedSize(Protocol_ const* prot_, const service3_methodB_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodB_pargs");
    xfer += prot_->serializedFieldSize("x", apache::thrift::protocol::T_I32, 1);
    xfer += prot_->serializedSizeI32((*const_cast<int32_t*>(obj->x)));
    xfer += prot_->serializedFieldSize("y", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct1>::serializedSize(prot_, &(*const_cast< ::test_cpp2::cpp_reflection::struct1*>(obj->y)));
    xfer += prot_->serializedFieldSize("z", apache::thrift::protocol::T_DOUBLE, 3);
    xfer += prot_->serializedSizeDouble((*const_cast<double*>(obj->z)));
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodB_pargs_serializedSizeZC(Protocol_ const* prot_, const service3_methodB_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodB_pargs");
    xfer += prot_->serializedFieldSize("x", apache::thrift::protocol::T_I32, 1);
    xfer += prot_->serializedSizeI32((*const_cast<int32_t*>(obj->x)));
    xfer += prot_->serializedFieldSize("y", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct1>::serializedSizeZC(prot_, &(*const_cast< ::test_cpp2::cpp_reflection::struct1*>(obj->y)));
    xfer += prot_->serializedFieldSize("z", apache::thrift::protocol::T_DOUBLE, 3);
    xfer += prot_->serializedSizeDouble((*const_cast<double*>(obj->z)));
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodB_pargs_write(Protocol_* prot_, const service3_methodB_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->writeStructBegin("service3_methodB_pargs");
    xfer += prot_->writeFieldBegin("x", apache::thrift::protocol::T_I32, 1);
    xfer += prot_->writeI32((*const_cast<int32_t*>(obj->x)));
    xfer += prot_->writeFieldEnd();
    xfer += prot_->writeFieldBegin("y", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct1>::write(prot_, &(*const_cast< ::test_cpp2::cpp_reflection::struct1*>(obj->y)));
    xfer += prot_->writeFieldEnd();
    xfer += prot_->writeFieldBegin("z", apache::thrift::protocol::T_DOUBLE, 3);
    xfer += prot_->writeDouble((*const_cast<double*>(obj->z)));
    xfer += prot_->writeFieldEnd();
    xfer += prot_->writeFieldStop();
    xfer += prot_->writeStructEnd();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodB_presult_read(Protocol_* iprot, service3_methodB_presult* obj) {
    (void)obj;
    auto _xferStart = iprot->getCurrentPosition().getCurrentPosition();
    std::string _fname;
    apache::thrift::protocol::TType _ftype;
    int16_t fid;
  
    iprot->readStructBegin(_fname);
  
    using apache::thrift::TProtocolException;
  
  
    while (true) {
      iprot->readFieldBegin(_fname, _ftype, fid);
      if (_ftype == apache::thrift::protocol::T_STOP) {
        break;
      }
      if (iprot->kUsesFieldNames()) {
        obj->translateFieldName(_fname, fid, _ftype);
      }
      switch (fid) {
        default:
        {
          iprot->skip(_ftype);
          break;
        }
      }
      iprot->readFieldEnd();
    }
    iprot->readStructEnd();
  
    return iprot->getCurrentPosition().getCurrentPosition() - _xferStart;
  }
  
  template <class Protocol_>
  uint32_t service3_methodB_presult_serializedSize(Protocol_ const* prot_, const service3_methodB_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodB_presult");
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodB_presult_serializedSizeZC(Protocol_ const* prot_, const service3_methodB_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodB_presult");
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodB_presult_write(Protocol_* prot_, const service3_methodB_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->writeStructBegin("service3_methodB_presult");
    xfer += prot_->writeFieldStop();
    xfer += prot_->writeStructEnd();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodC_pargs_read(Protocol_* iprot, service3_methodC_pargs* obj) {
    (void)obj;
    auto _xferStart = iprot->getCurrentPosition().getCurrentPosition();
    std::string _fname;
    apache::thrift::protocol::TType _ftype;
    int16_t fid;
  
    iprot->readStructBegin(_fname);
  
    using apache::thrift::TProtocolException;
  
  
    while (true) {
      iprot->readFieldBegin(_fname, _ftype, fid);
      if (_ftype == apache::thrift::protocol::T_STOP) {
        break;
      }
      if (iprot->kUsesFieldNames()) {
        obj->translateFieldName(_fname, fid, _ftype);
      }
      switch (fid) {
        default:
        {
          iprot->skip(_ftype);
          break;
        }
      }
      iprot->readFieldEnd();
    }
    iprot->readStructEnd();
  
    return iprot->getCurrentPosition().getCurrentPosition() - _xferStart;
  }
  
  template <class Protocol_>
  uint32_t service3_methodC_pargs_serializedSize(Protocol_ const* prot_, const service3_methodC_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodC_pargs");
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodC_pargs_serializedSizeZC(Protocol_ const* prot_, const service3_methodC_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodC_pargs");
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodC_pargs_write(Protocol_* prot_, const service3_methodC_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->writeStructBegin("service3_methodC_pargs");
    xfer += prot_->writeFieldStop();
    xfer += prot_->writeStructEnd();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodC_presult_read(Protocol_* iprot, service3_methodC_presult* obj) {
    (void)obj;
    auto _xferStart = iprot->getCurrentPosition().getCurrentPosition();
    std::string _fname;
    apache::thrift::protocol::TType _ftype;
    int16_t fid;
  
    iprot->readStructBegin(_fname);
  
    using apache::thrift::TProtocolException;
  
  
    while (true) {
      iprot->readFieldBegin(_fname, _ftype, fid);
      if (_ftype == apache::thrift::protocol::T_STOP) {
        break;
      }
      if (iprot->kUsesFieldNames()) {
        obj->translateFieldName(_fname, fid, _ftype);
      }
      switch (fid) {
        case 0:
        {
          if (_ftype == apache::thrift::protocol::T_I32) {
            iprot->readI32((*const_cast<int32_t*>(obj->success)));
            obj->__isset.success = true;
          } else {
            iprot->skip(_ftype);
          }
          break;
        }
        default:
        {
          iprot->skip(_ftype);
          break;
        }
      }
      iprot->readFieldEnd();
    }
    iprot->readStructEnd();
  
    return iprot->getCurrentPosition().getCurrentPosition() - _xferStart;
  }
  
  template <class Protocol_>
  uint32_t service3_methodC_presult_serializedSize(Protocol_ const* prot_, const service3_methodC_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodC_presult");
    if (obj->__isset.success) {
      xfer += prot_->serializedFieldSize("success", apache::thrift::protocol::T_I32, 0);
      xfer += prot_->serializedSizeI32((*const_cast<int32_t*>(obj->success)));
    }
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodC_presult_serializedSizeZC(Protocol_ const* prot_, const service3_methodC_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodC_presult");
    if (obj->__isset.success) {
      xfer += prot_->serializedFieldSize("success", apache::thrift::protocol::T_I32, 0);
      xfer += prot_->serializedSizeI32((*const_cast<int32_t*>(obj->success)));
    }
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodC_presult_write(Protocol_* prot_, const service3_methodC_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->writeStructBegin("service3_methodC_presult");
    if (obj->__isset.success) {
      xfer += prot_->writeFieldBegin("success", apache::thrift::protocol::T_I32, 0);
      xfer += prot_->writeI32((*const_cast<int32_t*>(obj->success)));
      xfer += prot_->writeFieldEnd();
    }
    xfer += prot_->writeFieldStop();
    xfer += prot_->writeStructEnd();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodD_pargs_read(Protocol_* iprot, service3_methodD_pargs* obj) {
    (void)obj;
    auto _xferStart = iprot->getCurrentPosition().getCurrentPosition();
    std::string _fname;
    apache::thrift::protocol::TType _ftype;
    int16_t fid;
  
    iprot->readStructBegin(_fname);
  
    using apache::thrift::TProtocolException;
  
  
    while (true) {
      iprot->readFieldBegin(_fname, _ftype, fid);
      if (_ftype == apache::thrift::protocol::T_STOP) {
        break;
      }
      if (iprot->kUsesFieldNames()) {
        obj->translateFieldName(_fname, fid, _ftype);
      }
      switch (fid) {
        case 1:
        {
          if (_ftype == apache::thrift::protocol::T_I32) {
            iprot->readI32((*const_cast<int32_t*>(obj->i)));
          } else {
            iprot->skip(_ftype);
          }
          break;
        }
        case 2:
        {
          if (_ftype == apache::thrift::protocol::T_STRUCT) {
            ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct1>::read(iprot, &(*const_cast< ::test_cpp2::cpp_reflection::struct1*>(obj->j)));
          } else {
            iprot->skip(_ftype);
          }
          break;
        }
        case 3:
        {
          if (_ftype == apache::thrift::protocol::T_DOUBLE) {
            iprot->readDouble((*const_cast<double*>(obj->k)));
          } else {
            iprot->skip(_ftype);
          }
          break;
        }
        default:
        {
          iprot->skip(_ftype);
          break;
        }
      }
      iprot->readFieldEnd();
    }
    iprot->readStructEnd();
  
    return iprot->getCurrentPosition().getCurrentPosition() - _xferStart;
  }
  
  template <class Protocol_>
  uint32_t service3_methodD_pargs_serializedSize(Protocol_ const* prot_, const service3_methodD_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodD_pargs");
    xfer += prot_->serializedFieldSize("i", apache::thrift::protocol::T_I32, 1);
    xfer += prot_->serializedSizeI32((*const_cast<int32_t*>(obj->i)));
    xfer += prot_->serializedFieldSize("j", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct1>::serializedSize(prot_, &(*const_cast< ::test_cpp2::cpp_reflection::struct1*>(obj->j)));
    xfer += prot_->serializedFieldSize("k", apache::thrift::protocol::T_DOUBLE, 3);
    xfer += prot_->serializedSizeDouble((*const_cast<double*>(obj->k)));
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodD_pargs_serializedSizeZC(Protocol_ const* prot_, const service3_methodD_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodD_pargs");
    xfer += prot_->serializedFieldSize("i", apache::thrift::protocol::T_I32, 1);
    xfer += prot_->serializedSizeI32((*const_cast<int32_t*>(obj->i)));
    xfer += prot_->serializedFieldSize("j", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct1>::serializedSizeZC(prot_, &(*const_cast< ::test_cpp2::cpp_reflection::struct1*>(obj->j)));
    xfer += prot_->serializedFieldSize("k", apache::thrift::protocol::T_DOUBLE, 3);
    xfer += prot_->serializedSizeDouble((*const_cast<double*>(obj->k)));
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodD_pargs_write(Protocol_* prot_, const service3_methodD_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->writeStructBegin("service3_methodD_pargs");
    xfer += prot_->writeFieldBegin("i", apache::thrift::protocol::T_I32, 1);
    xfer += prot_->writeI32((*const_cast<int32_t*>(obj->i)));
    xfer += prot_->writeFieldEnd();
    xfer += prot_->writeFieldBegin("j", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct1>::write(prot_, &(*const_cast< ::test_cpp2::cpp_reflection::struct1*>(obj->j)));
    xfer += prot_->writeFieldEnd();
    xfer += prot_->writeFieldBegin("k", apache::thrift::protocol::T_DOUBLE, 3);
    xfer += prot_->writeDouble((*const_cast<double*>(obj->k)));
    xfer += prot_->writeFieldEnd();
    xfer += prot_->writeFieldStop();
    xfer += prot_->writeStructEnd();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodD_presult_read(Protocol_* iprot, service3_methodD_presult* obj) {
    (void)obj;
    auto _xferStart = iprot->getCurrentPosition().getCurrentPosition();
    std::string _fname;
    apache::thrift::protocol::TType _ftype;
    int16_t fid;
  
    iprot->readStructBegin(_fname);
  
    using apache::thrift::TProtocolException;
  
  
    while (true) {
      iprot->readFieldBegin(_fname, _ftype, fid);
      if (_ftype == apache::thrift::protocol::T_STOP) {
        break;
      }
      if (iprot->kUsesFieldNames()) {
        obj->translateFieldName(_fname, fid, _ftype);
      }
      switch (fid) {
        case 0:
        {
          if (_ftype == apache::thrift::protocol::T_I32) {
            iprot->readI32((*const_cast<int32_t*>(obj->success)));
            obj->__isset.success = true;
          } else {
            iprot->skip(_ftype);
          }
          break;
        }
        default:
        {
          iprot->skip(_ftype);
          break;
        }
      }
      iprot->readFieldEnd();
    }
    iprot->readStructEnd();
  
    return iprot->getCurrentPosition().getCurrentPosition() - _xferStart;
  }
  
  template <class Protocol_>
  uint32_t service3_methodD_presult_serializedSize(Protocol_ const* prot_, const service3_methodD_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodD_presult");
    if (obj->__isset.success) {
      xfer += prot_->serializedFieldSize("success", apache::thrift::protocol::T_I32, 0);
      xfer += prot_->serializedSizeI32((*const_cast<int32_t*>(obj->success)));
    }
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodD_presult_serializedSizeZC(Protocol_ const* prot_, const service3_methodD_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodD_presult");
    if (obj->__isset.success) {
      xfer += prot_->serializedFieldSize("success", apache::thrift::protocol::T_I32, 0);
      xfer += prot_->serializedSizeI32((*const_cast<int32_t*>(obj->success)));
    }
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodD_presult_write(Protocol_* prot_, const service3_methodD_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->writeStructBegin("service3_methodD_presult");
    if (obj->__isset.success) {
      xfer += prot_->writeFieldBegin("success", apache::thrift::protocol::T_I32, 0);
      xfer += prot_->writeI32((*const_cast<int32_t*>(obj->success)));
      xfer += prot_->writeFieldEnd();
    }
    xfer += prot_->writeFieldStop();
    xfer += prot_->writeStructEnd();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodE_pargs_read(Protocol_* iprot, service3_methodE_pargs* obj) {
    (void)obj;
    auto _xferStart = iprot->getCurrentPosition().getCurrentPosition();
    std::string _fname;
    apache::thrift::protocol::TType _ftype;
    int16_t fid;
  
    iprot->readStructBegin(_fname);
  
    using apache::thrift::TProtocolException;
  
  
    while (true) {
      iprot->readFieldBegin(_fname, _ftype, fid);
      if (_ftype == apache::thrift::protocol::T_STOP) {
        break;
      }
      if (iprot->kUsesFieldNames()) {
        obj->translateFieldName(_fname, fid, _ftype);
      }
      switch (fid) {
        default:
        {
          iprot->skip(_ftype);
          break;
        }
      }
      iprot->readFieldEnd();
    }
    iprot->readStructEnd();
  
    return iprot->getCurrentPosition().getCurrentPosition() - _xferStart;
  }
  
  template <class Protocol_>
  uint32_t service3_methodE_pargs_serializedSize(Protocol_ const* prot_, const service3_methodE_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodE_pargs");
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodE_pargs_serializedSizeZC(Protocol_ const* prot_, const service3_methodE_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodE_pargs");
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodE_pargs_write(Protocol_* prot_, const service3_methodE_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->writeStructBegin("service3_methodE_pargs");
    xfer += prot_->writeFieldStop();
    xfer += prot_->writeStructEnd();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodE_presult_read(Protocol_* iprot, service3_methodE_presult* obj) {
    (void)obj;
    auto _xferStart = iprot->getCurrentPosition().getCurrentPosition();
    std::string _fname;
    apache::thrift::protocol::TType _ftype;
    int16_t fid;
  
    iprot->readStructBegin(_fname);
  
    using apache::thrift::TProtocolException;
  
  
    while (true) {
      iprot->readFieldBegin(_fname, _ftype, fid);
      if (_ftype == apache::thrift::protocol::T_STOP) {
        break;
      }
      if (iprot->kUsesFieldNames()) {
        obj->translateFieldName(_fname, fid, _ftype);
      }
      switch (fid) {
        case 0:
        {
          if (_ftype == apache::thrift::protocol::T_STRUCT) {
            ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct2>::read(iprot, &(*const_cast< ::test_cpp2::cpp_reflection::struct2*>(obj->success)));
            obj->__isset.success = true;
          } else {
            iprot->skip(_ftype);
          }
          break;
        }
        default:
        {
          iprot->skip(_ftype);
          break;
        }
      }
      iprot->readFieldEnd();
    }
    iprot->readStructEnd();
  
    return iprot->getCurrentPosition().getCurrentPosition() - _xferStart;
  }
  
  template <class Protocol_>
  uint32_t service3_methodE_presult_serializedSize(Protocol_ const* prot_, const service3_methodE_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodE_presult");
    if (obj->__isset.success) {
      xfer += prot_->serializedFieldSize("success", apache::thrift::protocol::T_STRUCT, 0);
      xfer += ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct2>::serializedSize(prot_, &(*const_cast< ::test_cpp2::cpp_reflection::struct2*>(obj->success)));
    }
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodE_presult_serializedSizeZC(Protocol_ const* prot_, const service3_methodE_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodE_presult");
    if (obj->__isset.success) {
      xfer += prot_->serializedFieldSize("success", apache::thrift::protocol::T_STRUCT, 0);
      xfer += ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct2>::serializedSizeZC(prot_, &(*const_cast< ::test_cpp2::cpp_reflection::struct2*>(obj->success)));
    }
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodE_presult_write(Protocol_* prot_, const service3_methodE_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->writeStructBegin("service3_methodE_presult");
    if (obj->__isset.success) {
      xfer += prot_->writeFieldBegin("success", apache::thrift::protocol::T_STRUCT, 0);
      xfer += ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct2>::write(prot_, &(*const_cast< ::test_cpp2::cpp_reflection::struct2*>(obj->success)));
      xfer += prot_->writeFieldEnd();
    }
    xfer += prot_->writeFieldStop();
    xfer += prot_->writeStructEnd();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodF_pargs_read(Protocol_* iprot, service3_methodF_pargs* obj) {
    (void)obj;
    auto _xferStart = iprot->getCurrentPosition().getCurrentPosition();
    std::string _fname;
    apache::thrift::protocol::TType _ftype;
    int16_t fid;
  
    iprot->readStructBegin(_fname);
  
    using apache::thrift::TProtocolException;
  
  
    while (true) {
      iprot->readFieldBegin(_fname, _ftype, fid);
      if (_ftype == apache::thrift::protocol::T_STOP) {
        break;
      }
      if (iprot->kUsesFieldNames()) {
        obj->translateFieldName(_fname, fid, _ftype);
      }
      switch (fid) {
        case 1:
        {
          if (_ftype == apache::thrift::protocol::T_I32) {
            iprot->readI32((*const_cast<int32_t*>(obj->l)));
          } else {
            iprot->skip(_ftype);
          }
          break;
        }
        case 2:
        {
          if (_ftype == apache::thrift::protocol::T_STRUCT) {
            ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct1>::read(iprot, &(*const_cast< ::test_cpp2::cpp_reflection::struct1*>(obj->m)));
          } else {
            iprot->skip(_ftype);
          }
          break;
        }
        case 3:
        {
          if (_ftype == apache::thrift::protocol::T_DOUBLE) {
            iprot->readDouble((*const_cast<double*>(obj->n)));
          } else {
            iprot->skip(_ftype);
          }
          break;
        }
        default:
        {
          iprot->skip(_ftype);
          break;
        }
      }
      iprot->readFieldEnd();
    }
    iprot->readStructEnd();
  
    return iprot->getCurrentPosition().getCurrentPosition() - _xferStart;
  }
  
  template <class Protocol_>
  uint32_t service3_methodF_pargs_serializedSize(Protocol_ const* prot_, const service3_methodF_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodF_pargs");
    xfer += prot_->serializedFieldSize("l", apache::thrift::protocol::T_I32, 1);
    xfer += prot_->serializedSizeI32((*const_cast<int32_t*>(obj->l)));
    xfer += prot_->serializedFieldSize("m", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct1>::serializedSize(prot_, &(*const_cast< ::test_cpp2::cpp_reflection::struct1*>(obj->m)));
    xfer += prot_->serializedFieldSize("n", apache::thrift::protocol::T_DOUBLE, 3);
    xfer += prot_->serializedSizeDouble((*const_cast<double*>(obj->n)));
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodF_pargs_serializedSizeZC(Protocol_ const* prot_, const service3_methodF_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodF_pargs");
    xfer += prot_->serializedFieldSize("l", apache::thrift::protocol::T_I32, 1);
    xfer += prot_->serializedSizeI32((*const_cast<int32_t*>(obj->l)));
    xfer += prot_->serializedFieldSize("m", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct1>::serializedSizeZC(prot_, &(*const_cast< ::test_cpp2::cpp_reflection::struct1*>(obj->m)));
    xfer += prot_->serializedFieldSize("n", apache::thrift::protocol::T_DOUBLE, 3);
    xfer += prot_->serializedSizeDouble((*const_cast<double*>(obj->n)));
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodF_pargs_write(Protocol_* prot_, const service3_methodF_pargs* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->writeStructBegin("service3_methodF_pargs");
    xfer += prot_->writeFieldBegin("l", apache::thrift::protocol::T_I32, 1);
    xfer += prot_->writeI32((*const_cast<int32_t*>(obj->l)));
    xfer += prot_->writeFieldEnd();
    xfer += prot_->writeFieldBegin("m", apache::thrift::protocol::T_STRUCT, 2);
    xfer += ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct1>::write(prot_, &(*const_cast< ::test_cpp2::cpp_reflection::struct1*>(obj->m)));
    xfer += prot_->writeFieldEnd();
    xfer += prot_->writeFieldBegin("n", apache::thrift::protocol::T_DOUBLE, 3);
    xfer += prot_->writeDouble((*const_cast<double*>(obj->n)));
    xfer += prot_->writeFieldEnd();
    xfer += prot_->writeFieldStop();
    xfer += prot_->writeStructEnd();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodF_presult_read(Protocol_* iprot, service3_methodF_presult* obj) {
    (void)obj;
    auto _xferStart = iprot->getCurrentPosition().getCurrentPosition();
    std::string _fname;
    apache::thrift::protocol::TType _ftype;
    int16_t fid;
  
    iprot->readStructBegin(_fname);
  
    using apache::thrift::TProtocolException;
  
  
    while (true) {
      iprot->readFieldBegin(_fname, _ftype, fid);
      if (_ftype == apache::thrift::protocol::T_STOP) {
        break;
      }
      if (iprot->kUsesFieldNames()) {
        obj->translateFieldName(_fname, fid, _ftype);
      }
      switch (fid) {
        case 0:
        {
          if (_ftype == apache::thrift::protocol::T_STRUCT) {
            ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct3>::read(iprot, &(*const_cast< ::test_cpp2::cpp_reflection::struct3*>(obj->success)));
            obj->__isset.success = true;
          } else {
            iprot->skip(_ftype);
          }
          break;
        }
        default:
        {
          iprot->skip(_ftype);
          break;
        }
      }
      iprot->readFieldEnd();
    }
    iprot->readStructEnd();
  
    return iprot->getCurrentPosition().getCurrentPosition() - _xferStart;
  }
  
  template <class Protocol_>
  uint32_t service3_methodF_presult_serializedSize(Protocol_ const* prot_, const service3_methodF_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodF_presult");
    if (obj->__isset.success) {
      xfer += prot_->serializedFieldSize("success", apache::thrift::protocol::T_STRUCT, 0);
      xfer += ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct3>::serializedSize(prot_, &(*const_cast< ::test_cpp2::cpp_reflection::struct3*>(obj->success)));
    }
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodF_presult_serializedSizeZC(Protocol_ const* prot_, const service3_methodF_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->serializedStructSize("service3_methodF_presult");
    if (obj->__isset.success) {
      xfer += prot_->serializedFieldSize("success", apache::thrift::protocol::T_STRUCT, 0);
      xfer += ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct3>::serializedSizeZC(prot_, &(*const_cast< ::test_cpp2::cpp_reflection::struct3*>(obj->success)));
    }
    xfer += prot_->serializedSizeStop();
    return xfer;
  }
  
  template <class Protocol_>
  uint32_t service3_methodF_presult_write(Protocol_* prot_, const service3_methodF_presult* obj) {
    (void)obj;
    uint32_t xfer = 0;
    xfer += prot_->writeStructBegin("service3_methodF_presult");
    if (obj->__isset.success) {
      xfer += prot_->writeFieldBegin("success", apache::thrift::protocol::T_STRUCT, 0);
      xfer += ::apache::thrift::Cpp2Ops<  ::test_cpp2::cpp_reflection::struct3>::write(prot_, &(*const_cast< ::test_cpp2::cpp_reflection::struct3*>(obj->success)));
      xfer += prot_->writeFieldEnd();
    }
    xfer += prot_->writeFieldStop();
    xfer += prot_->writeStructEnd();
    return xfer;
  }
  
  template <typename ProtocolIn_, typename ProtocolOut_>
  void service3AsyncProcessor::_processInThread_methodA(std::unique_ptr<apache::thrift::ResponseChannel::Request> req, std::unique_ptr<folly::IOBuf> buf, std::unique_ptr<ProtocolIn_> iprot, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
    auto pri = iface_->getRequestPriority(ctx, apache::thrift::concurrency::NORMAL);
    processInThread<ProtocolIn_, ProtocolOut_>(std::move(req), std::move(buf),std::move(iprot), ctx, eb, tm, pri, false, &service3AsyncProcessor::process_methodA<ProtocolIn_, ProtocolOut_>, this);
  }
  
  template <typename ProtocolIn_, typename ProtocolOut_>
  void service3AsyncProcessor::process_methodA(std::unique_ptr<apache::thrift::ResponseChannel::Request> req, std::unique_ptr<folly::IOBuf> buf, std::unique_ptr<ProtocolIn_> iprot,apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
    // make sure getConnectionContext is null
    // so async calls don't accidentally use it
    iface_->setConnectionContext(nullptr);
    service3_methodA_pargs args;
    std::unique_ptr<apache::thrift::ContextStack> c(this->getContextStack(this->getServiceName(), "service3.methodA", ctx));
    try {
      deserializeRequest(args, buf.get(), iprot.get(), c.get());
    }
    catch (const std::exception& ex) {
      ProtocolOut_ prot;
      if (req) {
        LOG(ERROR) << ex.what() << " in function methodA";
        apache::thrift::TApplicationException x(apache::thrift::TApplicationException::TApplicationExceptionType::PROTOCOL_ERROR, ex.what());
        folly::IOBufQueue queue = serializeException("methodA", &prot, ctx->getProtoSeqId(), nullptr, x);
        queue.append(apache::thrift::transport::THeader::transform(queue.move(), ctx->getHeader()->getWriteTransforms(), ctx->getHeader()->getMinCompressBytes()));
        eb->runInEventBaseThread([queue = std::move(queue), req = std::move(req)]() mutable {
          req->sendReply(queue.move());
        }
        );
        return;
      }
      else {
        LOG(ERROR) << ex.what() << " in oneway function methodA";
      }
    }
    auto callback = std::make_unique<apache::thrift::HandlerCallback<void>>(std::move(req), std::move(c), return_methodA<ProtocolIn_,ProtocolOut_>, throw_wrapped_methodA<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
    if (!callback->isRequestActive()) {
      callback.release()->deleteInThread();
      return;
    }
    ctx->setStartedProcessing();
    iface_->async_tm_methodA(std::move(callback));
  }
  
  template <class ProtocolIn_, class ProtocolOut_>
  folly::IOBufQueue service3AsyncProcessor::return_methodA(int32_t protoSeqId, apache::thrift::ContextStack* ctx) {
    ProtocolOut_ prot;
    service3_methodA_presult result;
    return serializeResponse("methodA", &prot, protoSeqId, ctx, result);
  }
  
  template <class ProtocolIn_, class ProtocolOut_>
  void service3AsyncProcessor::throw_wrapped_methodA(std::unique_ptr<apache::thrift::ResponseChannel::Request> req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
    if (!ew) {
      return;
    }
    ProtocolOut_ prot;
     {
      if (req) {
        LOG(ERROR) << ew.what().toStdString() << " in function methodA";
        apache::thrift::TApplicationException x(ew.what().toStdString());
        ctx->userExceptionWrapped(false, ew);
        ctx->handlerErrorWrapped(ew);
        folly::IOBufQueue queue = serializeException("methodA", &prot, protoSeqId, ctx, x);
        queue.append(apache::thrift::transport::THeader::transform(queue.move(), reqCtx->getHeader()->getWriteTransforms(), reqCtx->getHeader()->getMinCompressBytes()));
        req->sendReply(queue.move());
        return;
      }
      else {
        LOG(ERROR) << ew.what().toStdString() << " in oneway function methodA";
      }
    }
  }
  
  template <typename ProtocolIn_, typename ProtocolOut_>
  void service3AsyncProcessor::_processInThread_methodB(std::unique_ptr<apache::thrift::ResponseChannel::Request> req, std::unique_ptr<folly::IOBuf> buf, std::unique_ptr<ProtocolIn_> iprot, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
    auto pri = iface_->getRequestPriority(ctx, apache::thrift::concurrency::NORMAL);
    processInThread<ProtocolIn_, ProtocolOut_>(std::move(req), std::move(buf),std::move(iprot), ctx, eb, tm, pri, false, &service3AsyncProcessor::process_methodB<ProtocolIn_, ProtocolOut_>, this);
  }
  
  template <typename ProtocolIn_, typename ProtocolOut_>
  void service3AsyncProcessor::process_methodB(std::unique_ptr<apache::thrift::ResponseChannel::Request> req, std::unique_ptr<folly::IOBuf> buf, std::unique_ptr<ProtocolIn_> iprot,apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
    // make sure getConnectionContext is null
    // so async calls don't accidentally use it
    iface_->setConnectionContext(nullptr);
    service3_methodB_pargs args;
    int32_t uarg_x{0};
    args.x = &uarg_x;
    std::unique_ptr< ::test_cpp2::cpp_reflection::struct1> uarg_y(new  ::test_cpp2::cpp_reflection::struct1());
    args.y = uarg_y.get();
    double uarg_z{0};
    args.z = &uarg_z;
    std::unique_ptr<apache::thrift::ContextStack> c(this->getContextStack(this->getServiceName(), "service3.methodB", ctx));
    try {
      deserializeRequest(args, buf.get(), iprot.get(), c.get());
    }
    catch (const std::exception& ex) {
      ProtocolOut_ prot;
      if (req) {
        LOG(ERROR) << ex.what() << " in function methodB";
        apache::thrift::TApplicationException x(apache::thrift::TApplicationException::TApplicationExceptionType::PROTOCOL_ERROR, ex.what());
        folly::IOBufQueue queue = serializeException("methodB", &prot, ctx->getProtoSeqId(), nullptr, x);
        queue.append(apache::thrift::transport::THeader::transform(queue.move(), ctx->getHeader()->getWriteTransforms(), ctx->getHeader()->getMinCompressBytes()));
        eb->runInEventBaseThread([queue = std::move(queue), req = std::move(req)]() mutable {
          req->sendReply(queue.move());
        }
        );
        return;
      }
      else {
        LOG(ERROR) << ex.what() << " in oneway function methodB";
      }
    }
    auto callback = std::make_unique<apache::thrift::HandlerCallback<void>>(std::move(req), std::move(c), return_methodB<ProtocolIn_,ProtocolOut_>, throw_wrapped_methodB<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
    if (!callback->isRequestActive()) {
      callback.release()->deleteInThread();
      return;
    }
    ctx->setStartedProcessing();
    iface_->async_tm_methodB(std::move(callback), *args.x, std::move(uarg_y), *args.z);
  }
  
  template <class ProtocolIn_, class ProtocolOut_>
  folly::IOBufQueue service3AsyncProcessor::return_methodB(int32_t protoSeqId, apache::thrift::ContextStack* ctx) {
    ProtocolOut_ prot;
    service3_methodB_presult result;
    return serializeResponse("methodB", &prot, protoSeqId, ctx, result);
  }
  
  template <class ProtocolIn_, class ProtocolOut_>
  void service3AsyncProcessor::throw_wrapped_methodB(std::unique_ptr<apache::thrift::ResponseChannel::Request> req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
    if (!ew) {
      return;
    }
    ProtocolOut_ prot;
     {
      if (req) {
        LOG(ERROR) << ew.what().toStdString() << " in function methodB";
        apache::thrift::TApplicationException x(ew.what().toStdString());
        ctx->userExceptionWrapped(false, ew);
        ctx->handlerErrorWrapped(ew);
        folly::IOBufQueue queue = serializeException("methodB", &prot, protoSeqId, ctx, x);
        queue.append(apache::thrift::transport::THeader::transform(queue.move(), reqCtx->getHeader()->getWriteTransforms(), reqCtx->getHeader()->getMinCompressBytes()));
        req->sendReply(queue.move());
        return;
      }
      else {
        LOG(ERROR) << ew.what().toStdString() << " in oneway function methodB";
      }
    }
  }
  
  template <typename ProtocolIn_, typename ProtocolOut_>
  void service3AsyncProcessor::_processInThread_methodC(std::unique_ptr<apache::thrift::ResponseChannel::Request> req, std::unique_ptr<folly::IOBuf> buf, std::unique_ptr<ProtocolIn_> iprot, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
    auto pri = iface_->getRequestPriority(ctx, apache::thrift::concurrency::NORMAL);
    processInThread<ProtocolIn_, ProtocolOut_>(std::move(req), std::move(buf),std::move(iprot), ctx, eb, tm, pri, false, &service3AsyncProcessor::process_methodC<ProtocolIn_, ProtocolOut_>, this);
  }
  
  template <typename ProtocolIn_, typename ProtocolOut_>
  void service3AsyncProcessor::process_methodC(std::unique_ptr<apache::thrift::ResponseChannel::Request> req, std::unique_ptr<folly::IOBuf> buf, std::unique_ptr<ProtocolIn_> iprot,apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
    // make sure getConnectionContext is null
    // so async calls don't accidentally use it
    iface_->setConnectionContext(nullptr);
    service3_methodC_pargs args;
    std::unique_ptr<apache::thrift::ContextStack> c(this->getContextStack(this->getServiceName(), "service3.methodC", ctx));
    try {
      deserializeRequest(args, buf.get(), iprot.get(), c.get());
    }
    catch (const std::exception& ex) {
      ProtocolOut_ prot;
      if (req) {
        LOG(ERROR) << ex.what() << " in function methodC";
        apache::thrift::TApplicationException x(apache::thrift::TApplicationException::TApplicationExceptionType::PROTOCOL_ERROR, ex.what());
        folly::IOBufQueue queue = serializeException("methodC", &prot, ctx->getProtoSeqId(), nullptr, x);
        queue.append(apache::thrift::transport::THeader::transform(queue.move(), ctx->getHeader()->getWriteTransforms(), ctx->getHeader()->getMinCompressBytes()));
        eb->runInEventBaseThread([queue = std::move(queue), req = std::move(req)]() mutable {
          req->sendReply(queue.move());
        }
        );
        return;
      }
      else {
        LOG(ERROR) << ex.what() << " in oneway function methodC";
      }
    }
    auto callback = std::make_unique<apache::thrift::HandlerCallback<int32_t>>(std::move(req), std::move(c), return_methodC<ProtocolIn_,ProtocolOut_>, throw_wrapped_methodC<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
    if (!callback->isRequestActive()) {
      callback.release()->deleteInThread();
      return;
    }
    ctx->setStartedProcessing();
    iface_->async_tm_methodC(std::move(callback));
  }
  
  template <class ProtocolIn_, class ProtocolOut_>
  folly::IOBufQueue service3AsyncProcessor::return_methodC(int32_t protoSeqId, apache::thrift::ContextStack* ctx, int32_t const& _return) {
    ProtocolOut_ prot;
    service3_methodC_presult result;
    result.success = const_cast<int32_t*>(&_return);
    result.__isset.success = true;
    return serializeResponse("methodC", &prot, protoSeqId, ctx, result);
  }
  
  template <class ProtocolIn_, class ProtocolOut_>
  void service3AsyncProcessor::throw_wrapped_methodC(std::unique_ptr<apache::thrift::ResponseChannel::Request> req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
    if (!ew) {
      return;
    }
    ProtocolOut_ prot;
     {
      if (req) {
        LOG(ERROR) << ew.what().toStdString() << " in function methodC";
        apache::thrift::TApplicationException x(ew.what().toStdString());
        ctx->userExceptionWrapped(false, ew);
        ctx->handlerErrorWrapped(ew);
        folly::IOBufQueue queue = serializeException("methodC", &prot, protoSeqId, ctx, x);
        queue.append(apache::thrift::transport::THeader::transform(queue.move(), reqCtx->getHeader()->getWriteTransforms(), reqCtx->getHeader()->getMinCompressBytes()));
        req->sendReply(queue.move());
        return;
      }
      else {
        LOG(ERROR) << ew.what().toStdString() << " in oneway function methodC";
      }
    }
  }
  
  template <typename ProtocolIn_, typename ProtocolOut_>
  void service3AsyncProcessor::_processInThread_methodD(std::unique_ptr<apache::thrift::ResponseChannel::Request> req, std::unique_ptr<folly::IOBuf> buf, std::unique_ptr<ProtocolIn_> iprot, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
    auto pri = iface_->getRequestPriority(ctx, apache::thrift::concurrency::NORMAL);
    processInThread<ProtocolIn_, ProtocolOut_>(std::move(req), std::move(buf),std::move(iprot), ctx, eb, tm, pri, false, &service3AsyncProcessor::process_methodD<ProtocolIn_, ProtocolOut_>, this);
  }
  
  template <typename ProtocolIn_, typename ProtocolOut_>
  void service3AsyncProcessor::process_methodD(std::unique_ptr<apache::thrift::ResponseChannel::Request> req, std::unique_ptr<folly::IOBuf> buf, std::unique_ptr<ProtocolIn_> iprot,apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
    // make sure getConnectionContext is null
    // so async calls don't accidentally use it
    iface_->setConnectionContext(nullptr);
    service3_methodD_pargs args;
    int32_t uarg_i{0};
    args.i = &uarg_i;
    std::unique_ptr< ::test_cpp2::cpp_reflection::struct1> uarg_j(new  ::test_cpp2::cpp_reflection::struct1());
    args.j = uarg_j.get();
    double uarg_k{0};
    args.k = &uarg_k;
    std::unique_ptr<apache::thrift::ContextStack> c(this->getContextStack(this->getServiceName(), "service3.methodD", ctx));
    try {
      deserializeRequest(args, buf.get(), iprot.get(), c.get());
    }
    catch (const std::exception& ex) {
      ProtocolOut_ prot;
      if (req) {
        LOG(ERROR) << ex.what() << " in function methodD";
        apache::thrift::TApplicationException x(apache::thrift::TApplicationException::TApplicationExceptionType::PROTOCOL_ERROR, ex.what());
        folly::IOBufQueue queue = serializeException("methodD", &prot, ctx->getProtoSeqId(), nullptr, x);
        queue.append(apache::thrift::transport::THeader::transform(queue.move(), ctx->getHeader()->getWriteTransforms(), ctx->getHeader()->getMinCompressBytes()));
        eb->runInEventBaseThread([queue = std::move(queue), req = std::move(req)]() mutable {
          req->sendReply(queue.move());
        }
        );
        return;
      }
      else {
        LOG(ERROR) << ex.what() << " in oneway function methodD";
      }
    }
    auto callback = std::make_unique<apache::thrift::HandlerCallback<int32_t>>(std::move(req), std::move(c), return_methodD<ProtocolIn_,ProtocolOut_>, throw_wrapped_methodD<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
    if (!callback->isRequestActive()) {
      callback.release()->deleteInThread();
      return;
    }
    ctx->setStartedProcessing();
    iface_->async_tm_methodD(std::move(callback), *args.i, std::move(uarg_j), *args.k);
  }
  
  template <class ProtocolIn_, class ProtocolOut_>
  folly::IOBufQueue service3AsyncProcessor::return_methodD(int32_t protoSeqId, apache::thrift::ContextStack* ctx, int32_t const& _return) {
    ProtocolOut_ prot;
    service3_methodD_presult result;
    result.success = const_cast<int32_t*>(&_return);
    result.__isset.success = true;
    return serializeResponse("methodD", &prot, protoSeqId, ctx, result);
  }
  
  template <class ProtocolIn_, class ProtocolOut_>
  void service3AsyncProcessor::throw_wrapped_methodD(std::unique_ptr<apache::thrift::ResponseChannel::Request> req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
    if (!ew) {
      return;
    }
    ProtocolOut_ prot;
     {
      if (req) {
        LOG(ERROR) << ew.what().toStdString() << " in function methodD";
        apache::thrift::TApplicationException x(ew.what().toStdString());
        ctx->userExceptionWrapped(false, ew);
        ctx->handlerErrorWrapped(ew);
        folly::IOBufQueue queue = serializeException("methodD", &prot, protoSeqId, ctx, x);
        queue.append(apache::thrift::transport::THeader::transform(queue.move(), reqCtx->getHeader()->getWriteTransforms(), reqCtx->getHeader()->getMinCompressBytes()));
        req->sendReply(queue.move());
        return;
      }
      else {
        LOG(ERROR) << ew.what().toStdString() << " in oneway function methodD";
      }
    }
  }
  
  template <typename ProtocolIn_, typename ProtocolOut_>
  void service3AsyncProcessor::_processInThread_methodE(std::unique_ptr<apache::thrift::ResponseChannel::Request> req, std::unique_ptr<folly::IOBuf> buf, std::unique_ptr<ProtocolIn_> iprot, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
    auto pri = iface_->getRequestPriority(ctx, apache::thrift::concurrency::NORMAL);
    processInThread<ProtocolIn_, ProtocolOut_>(std::move(req), std::move(buf),std::move(iprot), ctx, eb, tm, pri, false, &service3AsyncProcessor::process_methodE<ProtocolIn_, ProtocolOut_>, this);
  }
  
  template <typename ProtocolIn_, typename ProtocolOut_>
  void service3AsyncProcessor::process_methodE(std::unique_ptr<apache::thrift::ResponseChannel::Request> req, std::unique_ptr<folly::IOBuf> buf, std::unique_ptr<ProtocolIn_> iprot,apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
    // make sure getConnectionContext is null
    // so async calls don't accidentally use it
    iface_->setConnectionContext(nullptr);
    service3_methodE_pargs args;
    std::unique_ptr<apache::thrift::ContextStack> c(this->getContextStack(this->getServiceName(), "service3.methodE", ctx));
    try {
      deserializeRequest(args, buf.get(), iprot.get(), c.get());
    }
    catch (const std::exception& ex) {
      ProtocolOut_ prot;
      if (req) {
        LOG(ERROR) << ex.what() << " in function methodE";
        apache::thrift::TApplicationException x(apache::thrift::TApplicationException::TApplicationExceptionType::PROTOCOL_ERROR, ex.what());
        folly::IOBufQueue queue = serializeException("methodE", &prot, ctx->getProtoSeqId(), nullptr, x);
        queue.append(apache::thrift::transport::THeader::transform(queue.move(), ctx->getHeader()->getWriteTransforms(), ctx->getHeader()->getMinCompressBytes()));
        eb->runInEventBaseThread([queue = std::move(queue), req = std::move(req)]() mutable {
          req->sendReply(queue.move());
        }
        );
        return;
      }
      else {
        LOG(ERROR) << ex.what() << " in oneway function methodE";
      }
    }
    auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr< ::test_cpp2::cpp_reflection::struct2>>>(std::move(req), std::move(c), return_methodE<ProtocolIn_,ProtocolOut_>, throw_wrapped_methodE<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
    if (!callback->isRequestActive()) {
      callback.release()->deleteInThread();
      return;
    }
    ctx->setStartedProcessing();
    iface_->async_tm_methodE(std::move(callback));
  }
  
  template <class ProtocolIn_, class ProtocolOut_>
  folly::IOBufQueue service3AsyncProcessor::return_methodE(int32_t protoSeqId, apache::thrift::ContextStack* ctx,  ::test_cpp2::cpp_reflection::struct2 const& _return) {
    ProtocolOut_ prot;
    service3_methodE_presult result;
    result.success = const_cast< ::test_cpp2::cpp_reflection::struct2*>(&_return);
    result.__isset.success = true;
    return serializeResponse("methodE", &prot, protoSeqId, ctx, result);
  }
  
  template <class ProtocolIn_, class ProtocolOut_>
  void service3AsyncProcessor::throw_wrapped_methodE(std::unique_ptr<apache::thrift::ResponseChannel::Request> req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
    if (!ew) {
      return;
    }
    ProtocolOut_ prot;
     {
      if (req) {
        LOG(ERROR) << ew.what().toStdString() << " in function methodE";
        apache::thrift::TApplicationException x(ew.what().toStdString());
        ctx->userExceptionWrapped(false, ew);
        ctx->handlerErrorWrapped(ew);
        folly::IOBufQueue queue = serializeException("methodE", &prot, protoSeqId, ctx, x);
        queue.append(apache::thrift::transport::THeader::transform(queue.move(), reqCtx->getHeader()->getWriteTransforms(), reqCtx->getHeader()->getMinCompressBytes()));
        req->sendReply(queue.move());
        return;
      }
      else {
        LOG(ERROR) << ew.what().toStdString() << " in oneway function methodE";
      }
    }
  }
  
  template <typename ProtocolIn_, typename ProtocolOut_>
  void service3AsyncProcessor::_processInThread_methodF(std::unique_ptr<apache::thrift::ResponseChannel::Request> req, std::unique_ptr<folly::IOBuf> buf, std::unique_ptr<ProtocolIn_> iprot, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
    auto pri = iface_->getRequestPriority(ctx, apache::thrift::concurrency::NORMAL);
    processInThread<ProtocolIn_, ProtocolOut_>(std::move(req), std::move(buf),std::move(iprot), ctx, eb, tm, pri, false, &service3AsyncProcessor::process_methodF<ProtocolIn_, ProtocolOut_>, this);
  }
  
  template <typename ProtocolIn_, typename ProtocolOut_>
  void service3AsyncProcessor::process_methodF(std::unique_ptr<apache::thrift::ResponseChannel::Request> req, std::unique_ptr<folly::IOBuf> buf, std::unique_ptr<ProtocolIn_> iprot,apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
    // make sure getConnectionContext is null
    // so async calls don't accidentally use it
    iface_->setConnectionContext(nullptr);
    service3_methodF_pargs args;
    int32_t uarg_l{0};
    args.l = &uarg_l;
    std::unique_ptr< ::test_cpp2::cpp_reflection::struct1> uarg_m(new  ::test_cpp2::cpp_reflection::struct1());
    args.m = uarg_m.get();
    double uarg_n{0};
    args.n = &uarg_n;
    std::unique_ptr<apache::thrift::ContextStack> c(this->getContextStack(this->getServiceName(), "service3.methodF", ctx));
    try {
      deserializeRequest(args, buf.get(), iprot.get(), c.get());
    }
    catch (const std::exception& ex) {
      ProtocolOut_ prot;
      if (req) {
        LOG(ERROR) << ex.what() << " in function methodF";
        apache::thrift::TApplicationException x(apache::thrift::TApplicationException::TApplicationExceptionType::PROTOCOL_ERROR, ex.what());
        folly::IOBufQueue queue = serializeException("methodF", &prot, ctx->getProtoSeqId(), nullptr, x);
        queue.append(apache::thrift::transport::THeader::transform(queue.move(), ctx->getHeader()->getWriteTransforms(), ctx->getHeader()->getMinCompressBytes()));
        eb->runInEventBaseThread([queue = std::move(queue), req = std::move(req)]() mutable {
          req->sendReply(queue.move());
        }
        );
        return;
      }
      else {
        LOG(ERROR) << ex.what() << " in oneway function methodF";
      }
    }
    auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr< ::test_cpp2::cpp_reflection::struct3>>>(std::move(req), std::move(c), return_methodF<ProtocolIn_,ProtocolOut_>, throw_wrapped_methodF<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
    if (!callback->isRequestActive()) {
      callback.release()->deleteInThread();
      return;
    }
    ctx->setStartedProcessing();
    iface_->async_tm_methodF(std::move(callback), *args.l, std::move(uarg_m), *args.n);
  }
  
  template <class ProtocolIn_, class ProtocolOut_>
  folly::IOBufQueue service3AsyncProcessor::return_methodF(int32_t protoSeqId, apache::thrift::ContextStack* ctx,  ::test_cpp2::cpp_reflection::struct3 const& _return) {
    ProtocolOut_ prot;
    service3_methodF_presult result;
    result.success = const_cast< ::test_cpp2::cpp_reflection::struct3*>(&_return);
    result.__isset.success = true;
    return serializeResponse("methodF", &prot, protoSeqId, ctx, result);
  }
  
  template <class ProtocolIn_, class ProtocolOut_>
  void service3AsyncProcessor::throw_wrapped_methodF(std::unique_ptr<apache::thrift::ResponseChannel::Request> req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
    if (!ew) {
      return;
    }
    ProtocolOut_ prot;
     {
      if (req) {
        LOG(ERROR) << ew.what().toStdString() << " in function methodF";
        apache::thrift::TApplicationException x(ew.what().toStdString());
        ctx->userExceptionWrapped(false, ew);
        ctx->handlerErrorWrapped(ew);
        folly::IOBufQueue queue = serializeException("methodF", &prot, protoSeqId, ctx, x);
        queue.append(apache::thrift::transport::THeader::transform(queue.move(), reqCtx->getHeader()->getWriteTransforms(), reqCtx->getHeader()->getMinCompressBytes()));
        req->sendReply(queue.move());
        return;
      }
      else {
        LOG(ERROR) << ew.what().toStdString() << " in oneway function methodF";
      }
    }
  }
  
  template <typename Protocol_>
  void service3AsyncClient::methodAT(Protocol_* prot, bool useSync, apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
    auto header = std::make_shared<apache::thrift::transport::THeader>(apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
    header->setProtocolId(getChannel()->getProtocolId());
    header->setHeaders(rpcOptions.releaseWriteHeaders());
    connectionContext_->setRequestHeader(header.get());
    std::unique_ptr<apache::thrift::ContextStack> ctx = this->getContextStack(this->getServiceName(), "service3.methodA", connectionContext_.get());
    service3_methodA_pargs args;
    auto sizer = [&](Protocol_* p) { return service3_methodA_pargs_serializedSizeZC(p, &args); };
    auto writer = [&](Protocol_* p) { service3_methodA_pargs_write(p, &args); };
    apache::thrift::clientSendT<Protocol_>(prot, rpcOptions, std::move(callback), std::move(ctx), header, channel_.get(), "methodA", writer, sizer, false, useSync);
    connectionContext_->setRequestHeader(nullptr);
  }
  
  template <typename Protocol_>
  folly::exception_wrapper service3AsyncClient::recv_wrapped_methodAT(Protocol_* prot, ::apache::thrift::ClientReceiveState& state) {
    if (state.isException()) {
      return std::move(state.exception());
    }
    prot->setInput(state.buf());
    auto guard = folly::makeGuard([&] {prot->setInput(nullptr);});
    apache::thrift::ContextStack* ctx = state.ctx();
    std::string _fname;
    int32_t protoSeqId = 0;
    apache::thrift::MessageType mtype;
    ctx->preRead();
    folly::exception_wrapper interior_ew;
    auto caught_ew = folly::try_and_catch<std::exception, apache::thrift::TException, apache::thrift::protocol::TProtocolException>([&]() {
      prot->readMessageBegin(_fname, mtype, protoSeqId);
      if (mtype == apache::thrift::T_EXCEPTION) {
        apache::thrift::TApplicationException x;
        x.read(prot);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(x);
        return; // from try_and_catch
      }
      if (mtype != apache::thrift::T_REPLY) {
        prot->skip(apache::thrift::protocol::T_STRUCT);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(apache::thrift::TApplicationException::TApplicationExceptionType::INVALID_MESSAGE_TYPE);
        return; // from try_and_catch
      }
      if (_fname.compare("methodA") != 0) {
        prot->skip(apache::thrift::protocol::T_STRUCT);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(apache::thrift::TApplicationException::TApplicationExceptionType::WRONG_METHOD_NAME);
        return; // from try_and_catch
      }
      ::apache::thrift::SerializedMessage smsg;
      smsg.protocolType = prot->protocolType();
      smsg.buffer = state.buf();
      ctx->onReadData(smsg);
      service3_methodA_presult result;
      service3_methodA_presult_read(prot, &result);
      prot->readMessageEnd();
      ctx->postRead(state.header(), state.buf()->length());
    }
    );
    auto ew = interior_ew ? std::move(interior_ew) : std::move(caught_ew);
    if (ew) {
      ctx->handlerErrorWrapped(ew);
    }
    return ew;
  }
  
  template <typename Protocol_>
  void service3AsyncClient::recv_methodAT(Protocol_* prot, ::apache::thrift::ClientReceiveState& state) {
    auto ew = recv_wrapped_methodAT(prot, state);
    if (ew) {
      ew.throw_exception();
    }
  }
  
  template <typename Protocol_>
  void service3AsyncClient::methodBT(Protocol_* prot, bool useSync, apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback, int32_t x, const  ::test_cpp2::cpp_reflection::struct1& y, double z) {
    auto header = std::make_shared<apache::thrift::transport::THeader>(apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
    header->setProtocolId(getChannel()->getProtocolId());
    header->setHeaders(rpcOptions.releaseWriteHeaders());
    connectionContext_->setRequestHeader(header.get());
    std::unique_ptr<apache::thrift::ContextStack> ctx = this->getContextStack(this->getServiceName(), "service3.methodB", connectionContext_.get());
    service3_methodB_pargs args;
    args.x = &x;
    args.y = const_cast< ::test_cpp2::cpp_reflection::struct1*>(&y);
    args.z = &z;
    auto sizer = [&](Protocol_* p) { return service3_methodB_pargs_serializedSizeZC(p, &args); };
    auto writer = [&](Protocol_* p) { service3_methodB_pargs_write(p, &args); };
    apache::thrift::clientSendT<Protocol_>(prot, rpcOptions, std::move(callback), std::move(ctx), header, channel_.get(), "methodB", writer, sizer, false, useSync);
    connectionContext_->setRequestHeader(nullptr);
  }
  
  template <typename Protocol_>
  folly::exception_wrapper service3AsyncClient::recv_wrapped_methodBT(Protocol_* prot, ::apache::thrift::ClientReceiveState& state) {
    if (state.isException()) {
      return std::move(state.exception());
    }
    prot->setInput(state.buf());
    auto guard = folly::makeGuard([&] {prot->setInput(nullptr);});
    apache::thrift::ContextStack* ctx = state.ctx();
    std::string _fname;
    int32_t protoSeqId = 0;
    apache::thrift::MessageType mtype;
    ctx->preRead();
    folly::exception_wrapper interior_ew;
    auto caught_ew = folly::try_and_catch<std::exception, apache::thrift::TException, apache::thrift::protocol::TProtocolException>([&]() {
      prot->readMessageBegin(_fname, mtype, protoSeqId);
      if (mtype == apache::thrift::T_EXCEPTION) {
        apache::thrift::TApplicationException x;
        x.read(prot);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(x);
        return; // from try_and_catch
      }
      if (mtype != apache::thrift::T_REPLY) {
        prot->skip(apache::thrift::protocol::T_STRUCT);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(apache::thrift::TApplicationException::TApplicationExceptionType::INVALID_MESSAGE_TYPE);
        return; // from try_and_catch
      }
      if (_fname.compare("methodB") != 0) {
        prot->skip(apache::thrift::protocol::T_STRUCT);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(apache::thrift::TApplicationException::TApplicationExceptionType::WRONG_METHOD_NAME);
        return; // from try_and_catch
      }
      ::apache::thrift::SerializedMessage smsg;
      smsg.protocolType = prot->protocolType();
      smsg.buffer = state.buf();
      ctx->onReadData(smsg);
      service3_methodB_presult result;
      service3_methodB_presult_read(prot, &result);
      prot->readMessageEnd();
      ctx->postRead(state.header(), state.buf()->length());
    }
    );
    auto ew = interior_ew ? std::move(interior_ew) : std::move(caught_ew);
    if (ew) {
      ctx->handlerErrorWrapped(ew);
    }
    return ew;
  }
  
  template <typename Protocol_>
  void service3AsyncClient::recv_methodBT(Protocol_* prot, ::apache::thrift::ClientReceiveState& state) {
    auto ew = recv_wrapped_methodBT(prot, state);
    if (ew) {
      ew.throw_exception();
    }
  }
  
  template <typename Protocol_>
  void service3AsyncClient::methodCT(Protocol_* prot, bool useSync, apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
    auto header = std::make_shared<apache::thrift::transport::THeader>(apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
    header->setProtocolId(getChannel()->getProtocolId());
    header->setHeaders(rpcOptions.releaseWriteHeaders());
    connectionContext_->setRequestHeader(header.get());
    std::unique_ptr<apache::thrift::ContextStack> ctx = this->getContextStack(this->getServiceName(), "service3.methodC", connectionContext_.get());
    service3_methodC_pargs args;
    auto sizer = [&](Protocol_* p) { return service3_methodC_pargs_serializedSizeZC(p, &args); };
    auto writer = [&](Protocol_* p) { service3_methodC_pargs_write(p, &args); };
    apache::thrift::clientSendT<Protocol_>(prot, rpcOptions, std::move(callback), std::move(ctx), header, channel_.get(), "methodC", writer, sizer, false, useSync);
    connectionContext_->setRequestHeader(nullptr);
  }
  
  template <typename Protocol_>
  folly::exception_wrapper service3AsyncClient::recv_wrapped_methodCT(Protocol_* prot, int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
    if (state.isException()) {
      return std::move(state.exception());
    }
    prot->setInput(state.buf());
    auto guard = folly::makeGuard([&] {prot->setInput(nullptr);});
    apache::thrift::ContextStack* ctx = state.ctx();
    std::string _fname;
    int32_t protoSeqId = 0;
    apache::thrift::MessageType mtype;
    ctx->preRead();
    folly::exception_wrapper interior_ew;
    auto caught_ew = folly::try_and_catch<std::exception, apache::thrift::TException, apache::thrift::protocol::TProtocolException>([&]() {
      prot->readMessageBegin(_fname, mtype, protoSeqId);
      if (mtype == apache::thrift::T_EXCEPTION) {
        apache::thrift::TApplicationException x;
        x.read(prot);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(x);
        return; // from try_and_catch
      }
      if (mtype != apache::thrift::T_REPLY) {
        prot->skip(apache::thrift::protocol::T_STRUCT);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(apache::thrift::TApplicationException::TApplicationExceptionType::INVALID_MESSAGE_TYPE);
        return; // from try_and_catch
      }
      if (_fname.compare("methodC") != 0) {
        prot->skip(apache::thrift::protocol::T_STRUCT);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(apache::thrift::TApplicationException::TApplicationExceptionType::WRONG_METHOD_NAME);
        return; // from try_and_catch
      }
      ::apache::thrift::SerializedMessage smsg;
      smsg.protocolType = prot->protocolType();
      smsg.buffer = state.buf();
      ctx->onReadData(smsg);
      service3_methodC_presult result;
      result.success = &_return;
      service3_methodC_presult_read(prot, &result);
      prot->readMessageEnd();
      ctx->postRead(state.header(), state.buf()->length());
      if (result.__isset.success) {
        // _return pointer has been filled
        return; // from try_and_catch
      }
      else {
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(apache::thrift::TApplicationException::TApplicationExceptionType::MISSING_RESULT, "failed: unknown result");
        return; // from try_and_catch
      }
    }
    );
    auto ew = interior_ew ? std::move(interior_ew) : std::move(caught_ew);
    if (ew) {
      ctx->handlerErrorWrapped(ew);
    }
    return ew;
  }
  
  template <typename Protocol_>
  int32_t service3AsyncClient::recv_methodCT(Protocol_* prot, ::apache::thrift::ClientReceiveState& state) {
    int32_t _return;
    auto ew = recv_wrapped_methodCT(prot, _return, state);
    if (ew) {
      ew.throw_exception();
    }
    return _return;
  }
  
  template <typename Protocol_>
  void service3AsyncClient::methodDT(Protocol_* prot, bool useSync, apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback, int32_t i, const  ::test_cpp2::cpp_reflection::struct1& j, double k) {
    auto header = std::make_shared<apache::thrift::transport::THeader>(apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
    header->setProtocolId(getChannel()->getProtocolId());
    header->setHeaders(rpcOptions.releaseWriteHeaders());
    connectionContext_->setRequestHeader(header.get());
    std::unique_ptr<apache::thrift::ContextStack> ctx = this->getContextStack(this->getServiceName(), "service3.methodD", connectionContext_.get());
    service3_methodD_pargs args;
    args.i = &i;
    args.j = const_cast< ::test_cpp2::cpp_reflection::struct1*>(&j);
    args.k = &k;
    auto sizer = [&](Protocol_* p) { return service3_methodD_pargs_serializedSizeZC(p, &args); };
    auto writer = [&](Protocol_* p) { service3_methodD_pargs_write(p, &args); };
    apache::thrift::clientSendT<Protocol_>(prot, rpcOptions, std::move(callback), std::move(ctx), header, channel_.get(), "methodD", writer, sizer, false, useSync);
    connectionContext_->setRequestHeader(nullptr);
  }
  
  template <typename Protocol_>
  folly::exception_wrapper service3AsyncClient::recv_wrapped_methodDT(Protocol_* prot, int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
    if (state.isException()) {
      return std::move(state.exception());
    }
    prot->setInput(state.buf());
    auto guard = folly::makeGuard([&] {prot->setInput(nullptr);});
    apache::thrift::ContextStack* ctx = state.ctx();
    std::string _fname;
    int32_t protoSeqId = 0;
    apache::thrift::MessageType mtype;
    ctx->preRead();
    folly::exception_wrapper interior_ew;
    auto caught_ew = folly::try_and_catch<std::exception, apache::thrift::TException, apache::thrift::protocol::TProtocolException>([&]() {
      prot->readMessageBegin(_fname, mtype, protoSeqId);
      if (mtype == apache::thrift::T_EXCEPTION) {
        apache::thrift::TApplicationException x;
        x.read(prot);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(x);
        return; // from try_and_catch
      }
      if (mtype != apache::thrift::T_REPLY) {
        prot->skip(apache::thrift::protocol::T_STRUCT);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(apache::thrift::TApplicationException::TApplicationExceptionType::INVALID_MESSAGE_TYPE);
        return; // from try_and_catch
      }
      if (_fname.compare("methodD") != 0) {
        prot->skip(apache::thrift::protocol::T_STRUCT);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(apache::thrift::TApplicationException::TApplicationExceptionType::WRONG_METHOD_NAME);
        return; // from try_and_catch
      }
      ::apache::thrift::SerializedMessage smsg;
      smsg.protocolType = prot->protocolType();
      smsg.buffer = state.buf();
      ctx->onReadData(smsg);
      service3_methodD_presult result;
      result.success = &_return;
      service3_methodD_presult_read(prot, &result);
      prot->readMessageEnd();
      ctx->postRead(state.header(), state.buf()->length());
      if (result.__isset.success) {
        // _return pointer has been filled
        return; // from try_and_catch
      }
      else {
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(apache::thrift::TApplicationException::TApplicationExceptionType::MISSING_RESULT, "failed: unknown result");
        return; // from try_and_catch
      }
    }
    );
    auto ew = interior_ew ? std::move(interior_ew) : std::move(caught_ew);
    if (ew) {
      ctx->handlerErrorWrapped(ew);
    }
    return ew;
  }
  
  template <typename Protocol_>
  int32_t service3AsyncClient::recv_methodDT(Protocol_* prot, ::apache::thrift::ClientReceiveState& state) {
    int32_t _return;
    auto ew = recv_wrapped_methodDT(prot, _return, state);
    if (ew) {
      ew.throw_exception();
    }
    return _return;
  }
  
  template <typename Protocol_>
  void service3AsyncClient::methodET(Protocol_* prot, bool useSync, apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
    auto header = std::make_shared<apache::thrift::transport::THeader>(apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
    header->setProtocolId(getChannel()->getProtocolId());
    header->setHeaders(rpcOptions.releaseWriteHeaders());
    connectionContext_->setRequestHeader(header.get());
    std::unique_ptr<apache::thrift::ContextStack> ctx = this->getContextStack(this->getServiceName(), "service3.methodE", connectionContext_.get());
    service3_methodE_pargs args;
    auto sizer = [&](Protocol_* p) { return service3_methodE_pargs_serializedSizeZC(p, &args); };
    auto writer = [&](Protocol_* p) { service3_methodE_pargs_write(p, &args); };
    apache::thrift::clientSendT<Protocol_>(prot, rpcOptions, std::move(callback), std::move(ctx), header, channel_.get(), "methodE", writer, sizer, false, useSync);
    connectionContext_->setRequestHeader(nullptr);
  }
  
  template <typename Protocol_>
  folly::exception_wrapper service3AsyncClient::recv_wrapped_methodET(Protocol_* prot,  ::test_cpp2::cpp_reflection::struct2& _return, ::apache::thrift::ClientReceiveState& state) {
    if (state.isException()) {
      return std::move(state.exception());
    }
    prot->setInput(state.buf());
    auto guard = folly::makeGuard([&] {prot->setInput(nullptr);});
    apache::thrift::ContextStack* ctx = state.ctx();
    std::string _fname;
    int32_t protoSeqId = 0;
    apache::thrift::MessageType mtype;
    ctx->preRead();
    folly::exception_wrapper interior_ew;
    auto caught_ew = folly::try_and_catch<std::exception, apache::thrift::TException, apache::thrift::protocol::TProtocolException>([&]() {
      prot->readMessageBegin(_fname, mtype, protoSeqId);
      if (mtype == apache::thrift::T_EXCEPTION) {
        apache::thrift::TApplicationException x;
        x.read(prot);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(x);
        return; // from try_and_catch
      }
      if (mtype != apache::thrift::T_REPLY) {
        prot->skip(apache::thrift::protocol::T_STRUCT);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(apache::thrift::TApplicationException::TApplicationExceptionType::INVALID_MESSAGE_TYPE);
        return; // from try_and_catch
      }
      if (_fname.compare("methodE") != 0) {
        prot->skip(apache::thrift::protocol::T_STRUCT);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(apache::thrift::TApplicationException::TApplicationExceptionType::WRONG_METHOD_NAME);
        return; // from try_and_catch
      }
      ::apache::thrift::SerializedMessage smsg;
      smsg.protocolType = prot->protocolType();
      smsg.buffer = state.buf();
      ctx->onReadData(smsg);
      service3_methodE_presult result;
      result.success = &_return;
      service3_methodE_presult_read(prot, &result);
      prot->readMessageEnd();
      ctx->postRead(state.header(), state.buf()->length());
      if (result.__isset.success) {
        // _return pointer has been filled
        return; // from try_and_catch
      }
      else {
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(apache::thrift::TApplicationException::TApplicationExceptionType::MISSING_RESULT, "failed: unknown result");
        return; // from try_and_catch
      }
    }
    );
    auto ew = interior_ew ? std::move(interior_ew) : std::move(caught_ew);
    if (ew) {
      ctx->handlerErrorWrapped(ew);
    }
    return ew;
  }
  
  template <typename Protocol_>
  void service3AsyncClient::recv_methodET(Protocol_* prot,  ::test_cpp2::cpp_reflection::struct2& _return, ::apache::thrift::ClientReceiveState& state) {
    auto ew = recv_wrapped_methodET(prot, _return, state);
    if (ew) {
      ew.throw_exception();
    }
  }
  
  template <typename Protocol_>
  void service3AsyncClient::methodFT(Protocol_* prot, bool useSync, apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback, int32_t l, const  ::test_cpp2::cpp_reflection::struct1& m, double n) {
    auto header = std::make_shared<apache::thrift::transport::THeader>(apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
    header->setProtocolId(getChannel()->getProtocolId());
    header->setHeaders(rpcOptions.releaseWriteHeaders());
    connectionContext_->setRequestHeader(header.get());
    std::unique_ptr<apache::thrift::ContextStack> ctx = this->getContextStack(this->getServiceName(), "service3.methodF", connectionContext_.get());
    service3_methodF_pargs args;
    args.l = &l;
    args.m = const_cast< ::test_cpp2::cpp_reflection::struct1*>(&m);
    args.n = &n;
    auto sizer = [&](Protocol_* p) { return service3_methodF_pargs_serializedSizeZC(p, &args); };
    auto writer = [&](Protocol_* p) { service3_methodF_pargs_write(p, &args); };
    apache::thrift::clientSendT<Protocol_>(prot, rpcOptions, std::move(callback), std::move(ctx), header, channel_.get(), "methodF", writer, sizer, false, useSync);
    connectionContext_->setRequestHeader(nullptr);
  }
  
  template <typename Protocol_>
  folly::exception_wrapper service3AsyncClient::recv_wrapped_methodFT(Protocol_* prot,  ::test_cpp2::cpp_reflection::struct3& _return, ::apache::thrift::ClientReceiveState& state) {
    if (state.isException()) {
      return std::move(state.exception());
    }
    prot->setInput(state.buf());
    auto guard = folly::makeGuard([&] {prot->setInput(nullptr);});
    apache::thrift::ContextStack* ctx = state.ctx();
    std::string _fname;
    int32_t protoSeqId = 0;
    apache::thrift::MessageType mtype;
    ctx->preRead();
    folly::exception_wrapper interior_ew;
    auto caught_ew = folly::try_and_catch<std::exception, apache::thrift::TException, apache::thrift::protocol::TProtocolException>([&]() {
      prot->readMessageBegin(_fname, mtype, protoSeqId);
      if (mtype == apache::thrift::T_EXCEPTION) {
        apache::thrift::TApplicationException x;
        x.read(prot);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(x);
        return; // from try_and_catch
      }
      if (mtype != apache::thrift::T_REPLY) {
        prot->skip(apache::thrift::protocol::T_STRUCT);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(apache::thrift::TApplicationException::TApplicationExceptionType::INVALID_MESSAGE_TYPE);
        return; // from try_and_catch
      }
      if (_fname.compare("methodF") != 0) {
        prot->skip(apache::thrift::protocol::T_STRUCT);
        prot->readMessageEnd();
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(apache::thrift::TApplicationException::TApplicationExceptionType::WRONG_METHOD_NAME);
        return; // from try_and_catch
      }
      ::apache::thrift::SerializedMessage smsg;
      smsg.protocolType = prot->protocolType();
      smsg.buffer = state.buf();
      ctx->onReadData(smsg);
      service3_methodF_presult result;
      result.success = &_return;
      service3_methodF_presult_read(prot, &result);
      prot->readMessageEnd();
      ctx->postRead(state.header(), state.buf()->length());
      if (result.__isset.success) {
        // _return pointer has been filled
        return; // from try_and_catch
      }
      else {
        interior_ew = folly::make_exception_wrapper<apache::thrift::TApplicationException>(apache::thrift::TApplicationException::TApplicationExceptionType::MISSING_RESULT, "failed: unknown result");
        return; // from try_and_catch
      }
    }
    );
    auto ew = interior_ew ? std::move(interior_ew) : std::move(caught_ew);
    if (ew) {
      ctx->handlerErrorWrapped(ew);
    }
    return ew;
  }
  
  template <typename Protocol_>
  void service3AsyncClient::recv_methodFT(Protocol_* prot,  ::test_cpp2::cpp_reflection::struct3& _return, ::apache::thrift::ClientReceiveState& state) {
    auto ew = recv_wrapped_methodFT(prot, _return, state);
    if (ew) {
      ew.throw_exception();
    }
  }
  
  }} // test_cpp2::cpp_reflection
  namespace apache { namespace thrift {
  
  }} // apache::thrift
  