/** * Autogenerated by Thrift for thrift/compiler/test/fixtures/visitation/src/module.thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @nocommit */ #include "thrift/compiler/test/fixtures/visitation/gen-cpp2/service3AsyncClient.h" #include namespace test_cpp2::cpp_reflection { typedef apache::thrift::ThriftPresult service3_methodA_pargs; typedef apache::thrift::ThriftPresult service3_methodA_presult; typedef apache::thrift::ThriftPresult, apache::thrift::FieldData<2, ::apache::thrift::type_class::structure, ::test_cpp2::cpp_reflection::struct1*>, apache::thrift::FieldData<3, ::apache::thrift::type_class::floating_point, double*>> service3_methodB_pargs; typedef apache::thrift::ThriftPresult service3_methodB_presult; typedef apache::thrift::ThriftPresult service3_methodC_pargs; typedef apache::thrift::ThriftPresult> service3_methodC_presult; typedef apache::thrift::ThriftPresult, apache::thrift::FieldData<2, ::apache::thrift::type_class::structure, ::test_cpp2::cpp_reflection::struct1*>, apache::thrift::FieldData<3, ::apache::thrift::type_class::floating_point, double*>> service3_methodD_pargs; typedef apache::thrift::ThriftPresult> service3_methodD_presult; typedef apache::thrift::ThriftPresult service3_methodE_pargs; typedef apache::thrift::ThriftPresult> service3_methodE_presult; typedef apache::thrift::ThriftPresult, apache::thrift::FieldData<2, ::apache::thrift::type_class::structure, ::test_cpp2::cpp_reflection::struct1*>, apache::thrift::FieldData<3, ::apache::thrift::type_class::floating_point, double*>> service3_methodF_pargs; typedef apache::thrift::ThriftPresult> service3_methodF_presult; } // namespace test_cpp2::cpp_reflection template void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodAT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) { ::test_cpp2::cpp_reflection::service3_methodA_pargs args; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "methodA", ::apache::thrift::FunctionQualifier::Unspecified, "service3"); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodBT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { ::test_cpp2::cpp_reflection::service3_methodB_pargs args; args.get<0>().value = &p_x; args.get<1>().value = const_cast<::test_cpp2::cpp_reflection::struct1*>(&p_y); args.get<2>().value = &p_z; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "methodB", ::apache::thrift::FunctionQualifier::Unspecified, "service3"); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodCT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) { ::test_cpp2::cpp_reflection::service3_methodC_pargs args; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "methodC", ::apache::thrift::FunctionQualifier::Unspecified, "service3"); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodDT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { ::test_cpp2::cpp_reflection::service3_methodD_pargs args; args.get<0>().value = &p_i; args.get<1>().value = const_cast<::test_cpp2::cpp_reflection::struct1*>(&p_j); args.get<2>().value = &p_k; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "methodD", ::apache::thrift::FunctionQualifier::Unspecified, "service3"); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodET(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) { ::test_cpp2::cpp_reflection::service3_methodE_pargs args; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "methodE", ::apache::thrift::FunctionQualifier::Unspecified, "service3"); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } template void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodFT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { ::test_cpp2::cpp_reflection::service3_methodF_pargs args; args.get<0>().value = &p_l; args.get<1>().value = const_cast<::test_cpp2::cpp_reflection::struct1*>(&p_m); args.get<2>().value = &p_n; auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; auto writer = [&](Protocol_* p) { args.write(p); }; static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "methodF", ::apache::thrift::FunctionQualifier::Unspecified, "service3"); apache::thrift::clientSendT(prot, std::forward(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodA(std::unique_ptr callback) { ::apache::thrift::RpcOptions rpcOptions; methodA(rpcOptions, std::move(callback)); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodA(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback) { auto [ctx, header] = methodACtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); methodAImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback)); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodAImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { methodAT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { methodAT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback)); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { methodAT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { methodAT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback)); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodACtx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, getServiceName(), "service3.methodA", *header); return {std::move(ctx), std::move(header)}; } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::sync_methodA() { ::apache::thrift::RpcOptions rpcOptions; sync_methodA(rpcOptions); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::sync_methodA(apache::thrift::RpcOptions& rpcOptions) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = methodACtx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); callback.waitUntilDone( evb, [&] { methodAImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback)); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { recv_methodA(returnState); }); } folly::Future apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::future_methodA() { ::apache::thrift::RpcOptions rpcOptions; return future_methodA(rpcOptions); } folly::SemiFuture apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::semifuture_methodA() { ::apache::thrift::RpcOptions rpcOptions; return semifuture_methodA(rpcOptions); } folly::Future apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::future_methodA(apache::thrift::RpcOptions& rpcOptions) { folly::Promise promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_methodA, channel_); methodA(rpcOptions, std::move(callback)); return future; } folly::SemiFuture apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::semifuture_methodA(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_methodA, channel_); auto callback = std::move(callbackAndFuture.first); methodA(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } folly::Future>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::header_future_methodA(apache::thrift::RpcOptions& rpcOptions) { folly::Promise>> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_methodA, channel_); methodA(rpcOptions, std::move(callback)); return future; } folly::SemiFuture>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::header_semifuture_methodA(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_methodA, channel_); auto callback = std::move(callbackAndFuture.first); methodA(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodA(folly::Function callback) { methodA(std::make_unique(std::move(callback))); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_wrapped_methodA(::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = ::test_cpp2::cpp_reflection::service3_methodA_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_methodA(::apache::thrift::ClientReceiveState& state) { auto ew = recv_wrapped_methodA(state); if (ew) { ew.throw_exception(); } } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_instance_methodA(::apache::thrift::ClientReceiveState& state) { recv_methodA(state); } folly::exception_wrapper apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_instance_wrapped_methodA(::apache::thrift::ClientReceiveState& state) { return recv_wrapped_methodA(state); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodB(std::unique_ptr callback, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { ::apache::thrift::RpcOptions rpcOptions; methodB(rpcOptions, std::move(callback), p_x, p_y, p_z); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodB(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { auto [ctx, header] = methodBCtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); methodBImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_x, p_y, p_z); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodBImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { methodBT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_x, p_y, p_z); } else { methodBT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_x, p_y, p_z); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { methodBT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_x, p_y, p_z); } else { methodBT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_x, p_y, p_z); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodBCtx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, getServiceName(), "service3.methodB", *header); return {std::move(ctx), std::move(header)}; } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::sync_methodB(::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { ::apache::thrift::RpcOptions rpcOptions; sync_methodB(rpcOptions, p_x, p_y, p_z); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::sync_methodB(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = methodBCtx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); callback.waitUntilDone( evb, [&] { methodBImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback), p_x, p_y, p_z); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { recv_methodB(returnState); }); } folly::Future apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::future_methodB(::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { ::apache::thrift::RpcOptions rpcOptions; return future_methodB(rpcOptions, p_x, p_y, p_z); } folly::SemiFuture apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::semifuture_methodB(::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { ::apache::thrift::RpcOptions rpcOptions; return semifuture_methodB(rpcOptions, p_x, p_y, p_z); } folly::Future apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::future_methodB(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { folly::Promise promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_methodB, channel_); methodB(rpcOptions, std::move(callback), p_x, p_y, p_z); return future; } folly::SemiFuture apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::semifuture_methodB(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_methodB, channel_); auto callback = std::move(callbackAndFuture.first); methodB(rpcOptions, std::move(callback), p_x, p_y, p_z); return std::move(callbackAndFuture.second); } folly::Future>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::header_future_methodB(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { folly::Promise>> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_methodB, channel_); methodB(rpcOptions, std::move(callback), p_x, p_y, p_z); return future; } folly::SemiFuture>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::header_semifuture_methodB(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_methodB, channel_); auto callback = std::move(callbackAndFuture.first); methodB(rpcOptions, std::move(callback), p_x, p_y, p_z); return std::move(callbackAndFuture.second); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodB(folly::Function callback, ::std::int32_t p_x, const ::test_cpp2::cpp_reflection::struct1& p_y, double p_z) { methodB(std::make_unique(std::move(callback)), p_x, p_y, p_z); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_wrapped_methodB(::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = ::test_cpp2::cpp_reflection::service3_methodB_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_methodB(::apache::thrift::ClientReceiveState& state) { auto ew = recv_wrapped_methodB(state); if (ew) { ew.throw_exception(); } } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_instance_methodB(::apache::thrift::ClientReceiveState& state) { recv_methodB(state); } folly::exception_wrapper apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_instance_wrapped_methodB(::apache::thrift::ClientReceiveState& state) { return recv_wrapped_methodB(state); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodC(std::unique_ptr callback) { ::apache::thrift::RpcOptions rpcOptions; methodC(rpcOptions, std::move(callback)); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodC(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback) { auto [ctx, header] = methodCCtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); methodCImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback)); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodCImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { methodCT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { methodCT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback)); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { methodCT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { methodCT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback)); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodCCtx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, getServiceName(), "service3.methodC", *header); return {std::move(ctx), std::move(header)}; } ::std::int32_t apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::sync_methodC() { ::apache::thrift::RpcOptions rpcOptions; return sync_methodC(rpcOptions); } ::std::int32_t apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::sync_methodC(apache::thrift::RpcOptions& rpcOptions) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = methodCCtx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); callback.waitUntilDone( evb, [&] { methodCImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback)); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { return recv_methodC(returnState); }); } folly::Future<::std::int32_t> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::future_methodC() { ::apache::thrift::RpcOptions rpcOptions; return future_methodC(rpcOptions); } folly::SemiFuture<::std::int32_t> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::semifuture_methodC() { ::apache::thrift::RpcOptions rpcOptions; return semifuture_methodC(rpcOptions); } folly::Future<::std::int32_t> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::future_methodC(apache::thrift::RpcOptions& rpcOptions) { folly::Promise<::std::int32_t> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_methodC, channel_); methodC(rpcOptions, std::move(callback)); return future; } folly::SemiFuture<::std::int32_t> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::semifuture_methodC(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_methodC, channel_); auto callback = std::move(callbackAndFuture.first); methodC(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } folly::Future>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::header_future_methodC(apache::thrift::RpcOptions& rpcOptions) { folly::Promise>> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_methodC, channel_); methodC(rpcOptions, std::move(callback)); return future; } folly::SemiFuture>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::header_semifuture_methodC(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_methodC, channel_); auto callback = std::move(callbackAndFuture.first); methodC(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodC(folly::Function callback) { methodC(std::make_unique(std::move(callback))); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_wrapped_methodC(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = ::test_cpp2::cpp_reflection::service3_methodC_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } ::std::int32_t apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_methodC(::apache::thrift::ClientReceiveState& state) { ::std::int32_t _return; auto ew = recv_wrapped_methodC(_return, state); if (ew) { ew.throw_exception(); } return _return; } ::std::int32_t apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_instance_methodC(::apache::thrift::ClientReceiveState& state) { return recv_methodC(state); } folly::exception_wrapper apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_instance_wrapped_methodC(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_methodC(_return, state); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodD(std::unique_ptr callback, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { ::apache::thrift::RpcOptions rpcOptions; methodD(rpcOptions, std::move(callback), p_i, p_j, p_k); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodD(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { auto [ctx, header] = methodDCtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); methodDImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_i, p_j, p_k); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodDImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { methodDT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_i, p_j, p_k); } else { methodDT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_i, p_j, p_k); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { methodDT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_i, p_j, p_k); } else { methodDT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_i, p_j, p_k); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodDCtx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, getServiceName(), "service3.methodD", *header); return {std::move(ctx), std::move(header)}; } ::std::int32_t apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::sync_methodD(::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { ::apache::thrift::RpcOptions rpcOptions; return sync_methodD(rpcOptions, p_i, p_j, p_k); } ::std::int32_t apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::sync_methodD(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = methodDCtx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); callback.waitUntilDone( evb, [&] { methodDImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback), p_i, p_j, p_k); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { return recv_methodD(returnState); }); } folly::Future<::std::int32_t> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::future_methodD(::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { ::apache::thrift::RpcOptions rpcOptions; return future_methodD(rpcOptions, p_i, p_j, p_k); } folly::SemiFuture<::std::int32_t> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::semifuture_methodD(::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { ::apache::thrift::RpcOptions rpcOptions; return semifuture_methodD(rpcOptions, p_i, p_j, p_k); } folly::Future<::std::int32_t> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::future_methodD(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { folly::Promise<::std::int32_t> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_methodD, channel_); methodD(rpcOptions, std::move(callback), p_i, p_j, p_k); return future; } folly::SemiFuture<::std::int32_t> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::semifuture_methodD(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_methodD, channel_); auto callback = std::move(callbackAndFuture.first); methodD(rpcOptions, std::move(callback), p_i, p_j, p_k); return std::move(callbackAndFuture.second); } folly::Future>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::header_future_methodD(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { folly::Promise>> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_methodD, channel_); methodD(rpcOptions, std::move(callback), p_i, p_j, p_k); return future; } folly::SemiFuture>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::header_semifuture_methodD(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_methodD, channel_); auto callback = std::move(callbackAndFuture.first); methodD(rpcOptions, std::move(callback), p_i, p_j, p_k); return std::move(callbackAndFuture.second); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodD(folly::Function callback, ::std::int32_t p_i, const ::test_cpp2::cpp_reflection::struct1& p_j, double p_k) { methodD(std::make_unique(std::move(callback)), p_i, p_j, p_k); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_wrapped_methodD(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = ::test_cpp2::cpp_reflection::service3_methodD_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } ::std::int32_t apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_methodD(::apache::thrift::ClientReceiveState& state) { ::std::int32_t _return; auto ew = recv_wrapped_methodD(_return, state); if (ew) { ew.throw_exception(); } return _return; } ::std::int32_t apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_instance_methodD(::apache::thrift::ClientReceiveState& state) { return recv_methodD(state); } folly::exception_wrapper apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_instance_wrapped_methodD(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_methodD(_return, state); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodE(std::unique_ptr callback) { ::apache::thrift::RpcOptions rpcOptions; methodE(rpcOptions, std::move(callback)); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodE(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback) { auto [ctx, header] = methodECtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); methodEImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback)); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodEImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { methodET(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { methodET(&writer, rpcOptions, std::move(header), contextStack, std::move(callback)); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { methodET(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { methodET(&writer, rpcOptions, std::move(header), contextStack, std::move(callback)); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodECtx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, getServiceName(), "service3.methodE", *header); return {std::move(ctx), std::move(header)}; } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::sync_methodE(::test_cpp2::cpp_reflection::struct2& _return) { ::apache::thrift::RpcOptions rpcOptions; sync_methodE(rpcOptions, _return); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::sync_methodE(apache::thrift::RpcOptions& rpcOptions, ::test_cpp2::cpp_reflection::struct2& _return) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = methodECtx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); callback.waitUntilDone( evb, [&] { methodEImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback)); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { recv_methodE(_return, returnState); }); } folly::Future<::test_cpp2::cpp_reflection::struct2> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::future_methodE() { ::apache::thrift::RpcOptions rpcOptions; return future_methodE(rpcOptions); } folly::SemiFuture<::test_cpp2::cpp_reflection::struct2> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::semifuture_methodE() { ::apache::thrift::RpcOptions rpcOptions; return semifuture_methodE(rpcOptions); } folly::Future<::test_cpp2::cpp_reflection::struct2> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::future_methodE(apache::thrift::RpcOptions& rpcOptions) { folly::Promise<::test_cpp2::cpp_reflection::struct2> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_methodE, channel_); methodE(rpcOptions, std::move(callback)); return future; } folly::SemiFuture<::test_cpp2::cpp_reflection::struct2> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::semifuture_methodE(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_methodE, channel_); auto callback = std::move(callbackAndFuture.first); methodE(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } folly::Future>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::header_future_methodE(apache::thrift::RpcOptions& rpcOptions) { folly::Promise>> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_methodE, channel_); methodE(rpcOptions, std::move(callback)); return future; } folly::SemiFuture>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::header_semifuture_methodE(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_methodE, channel_); auto callback = std::move(callbackAndFuture.first); methodE(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodE(folly::Function callback) { methodE(std::make_unique(std::move(callback))); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_wrapped_methodE(::test_cpp2::cpp_reflection::struct2& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = ::test_cpp2::cpp_reflection::service3_methodE_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_methodE(::test_cpp2::cpp_reflection::struct2& _return, ::apache::thrift::ClientReceiveState& state) { auto ew = recv_wrapped_methodE(_return, state); if (ew) { ew.throw_exception(); } } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_instance_methodE(::test_cpp2::cpp_reflection::struct2& _return, ::apache::thrift::ClientReceiveState& state) { return recv_methodE(_return, state); } folly::exception_wrapper apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_instance_wrapped_methodE(::test_cpp2::cpp_reflection::struct2& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_methodE(_return, state); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodF(std::unique_ptr callback, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { ::apache::thrift::RpcOptions rpcOptions; methodF(rpcOptions, std::move(callback), p_l, p_m, p_n); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodF(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { auto [ctx, header] = methodFCtx(&rpcOptions); apache::thrift::RequestCallback::Context callbackContext; callbackContext.protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto* contextStack = ctx.get(); if (callback) { callbackContext.ctx = std::move(ctx); } auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext)); methodFImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_l, p_m, p_n); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodFImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n, bool stealRpcOptions) { switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolWriter writer; if (stealRpcOptions) { methodFT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_l, p_m, p_n); } else { methodFT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_l, p_m, p_n); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { methodFT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback), p_l, p_m, p_n); } else { methodFT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback), p_l, p_m, p_n); } break; } default: { apache::thrift::detail::ac::throw_app_exn("Could not find Protocol"); } } } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodFCtx(apache::thrift::RpcOptions* rpcOptions) { auto header = std::make_shared( apache::thrift::transport::THeader::ALLOW_BIG_FRAMES); header->setProtocolId(channel_->getProtocolId()); if (rpcOptions) { header->setHeaders(rpcOptions->releaseWriteHeaders()); } auto ctx = apache::thrift::ContextStack::createWithClientContext( handlers_, getServiceName(), "service3.methodF", *header); return {std::move(ctx), std::move(header)}; } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::sync_methodF(::test_cpp2::cpp_reflection::struct3& _return, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { ::apache::thrift::RpcOptions rpcOptions; sync_methodF(rpcOptions, _return, p_l, p_m, p_n); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::sync_methodF(apache::thrift::RpcOptions& rpcOptions, ::test_cpp2::cpp_reflection::struct3& _return, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { apache::thrift::ClientReceiveState returnState; apache::thrift::ClientSyncCallback callback(&returnState); auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(); auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase(); auto ctxAndHeader = methodFCtx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); callback.waitUntilDone( evb, [&] { methodFImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback), p_l, p_m, p_n); }); if (returnState.isException()) { returnState.exception().throw_exception(); } returnState.resetProtocolId(protocolId); returnState.resetCtx(std::move(ctxAndHeader.first)); SCOPE_EXIT { if (returnState.header() && !returnState.header()->getHeaders().empty()) { rpcOptions.setReadHeaders(returnState.header()->releaseHeaders()); } }; return folly::fibers::runInMainContext([&] { recv_methodF(_return, returnState); }); } folly::Future<::test_cpp2::cpp_reflection::struct3> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::future_methodF(::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { ::apache::thrift::RpcOptions rpcOptions; return future_methodF(rpcOptions, p_l, p_m, p_n); } folly::SemiFuture<::test_cpp2::cpp_reflection::struct3> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::semifuture_methodF(::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { ::apache::thrift::RpcOptions rpcOptions; return semifuture_methodF(rpcOptions, p_l, p_m, p_n); } folly::Future<::test_cpp2::cpp_reflection::struct3> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::future_methodF(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { folly::Promise<::test_cpp2::cpp_reflection::struct3> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_methodF, channel_); methodF(rpcOptions, std::move(callback), p_l, p_m, p_n); return future; } folly::SemiFuture<::test_cpp2::cpp_reflection::struct3> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::semifuture_methodF(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_methodF, channel_); auto callback = std::move(callbackAndFuture.first); methodF(rpcOptions, std::move(callback), p_l, p_m, p_n); return std::move(callbackAndFuture.second); } folly::Future>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::header_future_methodF(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { folly::Promise>> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_methodF, channel_); methodF(rpcOptions, std::move(callback), p_l, p_m, p_n); return future; } folly::SemiFuture>> apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::header_semifuture_methodF(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_methodF, channel_); auto callback = std::move(callbackAndFuture.first); methodF(rpcOptions, std::move(callback), p_l, p_m, p_n); return std::move(callbackAndFuture.second); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::methodF(folly::Function callback, ::std::int32_t p_l, const ::test_cpp2::cpp_reflection::struct1& p_m, double p_n) { methodF(std::make_unique(std::move(callback)), p_l, p_m, p_n); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_wrapped_methodF(::test_cpp2::cpp_reflection::struct3& _return, ::apache::thrift::ClientReceiveState& state) { if (state.isException()) { return std::move(state.exception()); } if (!state.hasResponseBuffer()) { return folly::make_exception_wrapper("recv_ called without result"); } using result = ::test_cpp2::cpp_reflection::service3_methodF_presult; switch (state.protocolId()) { case apache::thrift::protocol::T_BINARY_PROTOCOL: { apache::thrift::BinaryProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolReader reader; return apache::thrift::detail::ac::recv_wrapped( &reader, state, _return); } default: { } } return folly::make_exception_wrapper("Could not find Protocol"); } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_methodF(::test_cpp2::cpp_reflection::struct3& _return, ::apache::thrift::ClientReceiveState& state) { auto ew = recv_wrapped_methodF(_return, state); if (ew) { ew.throw_exception(); } } void apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_instance_methodF(::test_cpp2::cpp_reflection::struct3& _return, ::apache::thrift::ClientReceiveState& state) { return recv_methodF(_return, state); } folly::exception_wrapper apache::thrift::Client<::test_cpp2::cpp_reflection::service3>::recv_instance_wrapped_methodF(::test_cpp2::cpp_reflection::struct3& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_methodF(_return, state); }