/** * Autogenerated by Thrift for thrift/compiler/test/fixtures/basic-annotations/src/module.thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @nocommit */ #include "thrift/compiler/test/fixtures/basic-annotations/gen-cpp2/FooBarBazServiceAsyncClient.h" #include namespace cpp2 { typedef apache::thrift::ThriftPresult FooBarBazService_foo_pargs; typedef apache::thrift::ThriftPresult FooBarBazService_foo_presult; typedef apache::thrift::ThriftPresult FooBarBazService_bar_pargs; typedef apache::thrift::ThriftPresult FooBarBazService_bar_presult; typedef apache::thrift::ThriftPresult FooBarBazService_baz_pargs; typedef apache::thrift::ThriftPresult FooBarBazService_baz_presult; } // namespace cpp2 template void apache::thrift::Client<::cpp2::FooBarBazService>::fooT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) { ::cpp2::FooBarBazService_foo_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( "foo", ::apache::thrift::FunctionQualifier::Unspecified, "FooBarBazService"); 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<::cpp2::FooBarBazService>::barT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) { ::cpp2::FooBarBazService_bar_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( "bar", ::apache::thrift::FunctionQualifier::Unspecified, "FooBarBazService"); 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<::cpp2::FooBarBazService>::bazT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) { ::cpp2::FooBarBazService_baz_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( "baz", ::apache::thrift::FunctionQualifier::Unspecified, "FooBarBazService"); 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<::cpp2::FooBarBazService>::foo(std::unique_ptr callback) { ::apache::thrift::RpcOptions rpcOptions; foo(rpcOptions, std::move(callback)); } void apache::thrift::Client<::cpp2::FooBarBazService>::foo(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback) { auto [ctx, header] = fooCtx(&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)); fooImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback)); } void apache::thrift::Client<::cpp2::FooBarBazService>::fooImpl(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) { fooT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { fooT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback)); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { fooT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { fooT(&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<::cpp2::FooBarBazService>::fooCtx(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(), "FooBarBazService.foo", *header); return {std::move(ctx), std::move(header)}; } void apache::thrift::Client<::cpp2::FooBarBazService>::sync_foo() { ::apache::thrift::RpcOptions rpcOptions; sync_foo(rpcOptions); } void apache::thrift::Client<::cpp2::FooBarBazService>::sync_foo(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 = fooCtx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); callback.waitUntilDone( evb, [&] { fooImpl(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_foo(returnState); }); } folly::Future apache::thrift::Client<::cpp2::FooBarBazService>::future_foo() { ::apache::thrift::RpcOptions rpcOptions; return future_foo(rpcOptions); } folly::SemiFuture apache::thrift::Client<::cpp2::FooBarBazService>::semifuture_foo() { ::apache::thrift::RpcOptions rpcOptions; return semifuture_foo(rpcOptions); } folly::Future apache::thrift::Client<::cpp2::FooBarBazService>::future_foo(apache::thrift::RpcOptions& rpcOptions) { folly::Promise promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_foo, channel_); foo(rpcOptions, std::move(callback)); return future; } folly::SemiFuture apache::thrift::Client<::cpp2::FooBarBazService>::semifuture_foo(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_foo, channel_); auto callback = std::move(callbackAndFuture.first); foo(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } folly::Future>> apache::thrift::Client<::cpp2::FooBarBazService>::header_future_foo(apache::thrift::RpcOptions& rpcOptions) { folly::Promise>> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_foo, channel_); foo(rpcOptions, std::move(callback)); return future; } folly::SemiFuture>> apache::thrift::Client<::cpp2::FooBarBazService>::header_semifuture_foo(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_foo, channel_); auto callback = std::move(callbackAndFuture.first); foo(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } void apache::thrift::Client<::cpp2::FooBarBazService>::foo(folly::Function callback) { foo(std::make_unique(std::move(callback))); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::FooBarBazService>::recv_wrapped_foo(::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 = ::cpp2::FooBarBazService_foo_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<::cpp2::FooBarBazService>::recv_foo(::apache::thrift::ClientReceiveState& state) { auto ew = recv_wrapped_foo(state); if (ew) { ew.throw_exception(); } } void apache::thrift::Client<::cpp2::FooBarBazService>::recv_instance_foo(::apache::thrift::ClientReceiveState& state) { recv_foo(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::FooBarBazService>::recv_instance_wrapped_foo(::apache::thrift::ClientReceiveState& state) { return recv_wrapped_foo(state); } void apache::thrift::Client<::cpp2::FooBarBazService>::bar(std::unique_ptr callback) { ::apache::thrift::RpcOptions rpcOptions; bar(rpcOptions, std::move(callback)); } void apache::thrift::Client<::cpp2::FooBarBazService>::bar(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback) { auto [ctx, header] = barCtx(&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)); barImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback)); } void apache::thrift::Client<::cpp2::FooBarBazService>::barImpl(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) { barT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { barT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback)); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { barT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { barT(&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<::cpp2::FooBarBazService>::barCtx(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(), "FooBarBazService.bar", *header); return {std::move(ctx), std::move(header)}; } void apache::thrift::Client<::cpp2::FooBarBazService>::sync_bar() { ::apache::thrift::RpcOptions rpcOptions; sync_bar(rpcOptions); } void apache::thrift::Client<::cpp2::FooBarBazService>::sync_bar(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 = barCtx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); callback.waitUntilDone( evb, [&] { barImpl(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_bar(returnState); }); } folly::Future apache::thrift::Client<::cpp2::FooBarBazService>::future_bar() { ::apache::thrift::RpcOptions rpcOptions; return future_bar(rpcOptions); } folly::SemiFuture apache::thrift::Client<::cpp2::FooBarBazService>::semifuture_bar() { ::apache::thrift::RpcOptions rpcOptions; return semifuture_bar(rpcOptions); } folly::Future apache::thrift::Client<::cpp2::FooBarBazService>::future_bar(apache::thrift::RpcOptions& rpcOptions) { folly::Promise promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_bar, channel_); bar(rpcOptions, std::move(callback)); return future; } folly::SemiFuture apache::thrift::Client<::cpp2::FooBarBazService>::semifuture_bar(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_bar, channel_); auto callback = std::move(callbackAndFuture.first); bar(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } folly::Future>> apache::thrift::Client<::cpp2::FooBarBazService>::header_future_bar(apache::thrift::RpcOptions& rpcOptions) { folly::Promise>> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_bar, channel_); bar(rpcOptions, std::move(callback)); return future; } folly::SemiFuture>> apache::thrift::Client<::cpp2::FooBarBazService>::header_semifuture_bar(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_bar, channel_); auto callback = std::move(callbackAndFuture.first); bar(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } void apache::thrift::Client<::cpp2::FooBarBazService>::bar(folly::Function callback) { bar(std::make_unique(std::move(callback))); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::FooBarBazService>::recv_wrapped_bar(::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 = ::cpp2::FooBarBazService_bar_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<::cpp2::FooBarBazService>::recv_bar(::apache::thrift::ClientReceiveState& state) { auto ew = recv_wrapped_bar(state); if (ew) { ew.throw_exception(); } } void apache::thrift::Client<::cpp2::FooBarBazService>::recv_instance_bar(::apache::thrift::ClientReceiveState& state) { recv_bar(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::FooBarBazService>::recv_instance_wrapped_bar(::apache::thrift::ClientReceiveState& state) { return recv_wrapped_bar(state); } void apache::thrift::Client<::cpp2::FooBarBazService>::baz(std::unique_ptr callback) { ::apache::thrift::RpcOptions rpcOptions; baz(rpcOptions, std::move(callback)); } void apache::thrift::Client<::cpp2::FooBarBazService>::baz(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback) { auto [ctx, header] = bazCtx(&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)); bazImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback)); } void apache::thrift::Client<::cpp2::FooBarBazService>::bazImpl(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) { bazT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { bazT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback)); } break; } case apache::thrift::protocol::T_COMPACT_PROTOCOL: { apache::thrift::CompactProtocolWriter writer; if (stealRpcOptions) { bazT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback)); } else { bazT(&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<::cpp2::FooBarBazService>::bazCtx(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(), "FooBarBazService.baz", *header); return {std::move(ctx), std::move(header)}; } void apache::thrift::Client<::cpp2::FooBarBazService>::sync_baz() { ::apache::thrift::RpcOptions rpcOptions; sync_baz(rpcOptions); } void apache::thrift::Client<::cpp2::FooBarBazService>::sync_baz(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 = bazCtx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); callback.waitUntilDone( evb, [&] { bazImpl(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_baz(returnState); }); } folly::Future apache::thrift::Client<::cpp2::FooBarBazService>::future_baz() { ::apache::thrift::RpcOptions rpcOptions; return future_baz(rpcOptions); } folly::SemiFuture apache::thrift::Client<::cpp2::FooBarBazService>::semifuture_baz() { ::apache::thrift::RpcOptions rpcOptions; return semifuture_baz(rpcOptions); } folly::Future apache::thrift::Client<::cpp2::FooBarBazService>::future_baz(apache::thrift::RpcOptions& rpcOptions) { folly::Promise promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_baz, channel_); baz(rpcOptions, std::move(callback)); return future; } folly::SemiFuture apache::thrift::Client<::cpp2::FooBarBazService>::semifuture_baz(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_baz, channel_); auto callback = std::move(callbackAndFuture.first); baz(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } folly::Future>> apache::thrift::Client<::cpp2::FooBarBazService>::header_future_baz(apache::thrift::RpcOptions& rpcOptions) { folly::Promise>> promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_baz, channel_); baz(rpcOptions, std::move(callback)); return future; } folly::SemiFuture>> apache::thrift::Client<::cpp2::FooBarBazService>::header_semifuture_baz(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_baz, channel_); auto callback = std::move(callbackAndFuture.first); baz(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } void apache::thrift::Client<::cpp2::FooBarBazService>::baz(folly::Function callback) { baz(std::make_unique(std::move(callback))); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::FooBarBazService>::recv_wrapped_baz(::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 = ::cpp2::FooBarBazService_baz_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<::cpp2::FooBarBazService>::recv_baz(::apache::thrift::ClientReceiveState& state) { auto ew = recv_wrapped_baz(state); if (ew) { ew.throw_exception(); } } void apache::thrift::Client<::cpp2::FooBarBazService>::recv_instance_baz(::apache::thrift::ClientReceiveState& state) { recv_baz(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::FooBarBazService>::recv_instance_wrapped_baz(::apache::thrift::ClientReceiveState& state) { return recv_wrapped_baz(state); }