/** * Autogenerated by Thrift for thrift/compiler/test/fixtures/doctext/src/module.thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @nocommit */ #include "thrift/compiler/test/fixtures/doctext/gen-cpp2/CAsyncClient.h" #include namespace cpp2 { typedef apache::thrift::ThriftPresult C_f_pargs; typedef apache::thrift::ThriftPresult C_f_presult; typedef apache::thrift::ThriftPresult C_numbers_pargs; typedef apache::thrift::ThriftPResultStream< apache::thrift::ThriftPresult, apache::thrift::ThriftPresult> > C_numbers_presult; typedef apache::thrift::ThriftPresult, apache::thrift::FieldData<2, ::apache::thrift::type_class::string, ::std::string*>, apache::thrift::FieldData<3, ::apache::thrift::type_class::set<::apache::thrift::type_class::integral>, ::std::set<::std::int32_t>*>> C_thing_pargs; typedef apache::thrift::ThriftPresult, apache::thrift::FieldData<1, ::apache::thrift::type_class::structure, ::cpp2::Bang>> C_thing_presult; } // namespace cpp2 template apache::thrift::SerializedRequest apache::thrift::Client<::cpp2::C>::fbthrift_serialize_f(Protocol_* prot, const RpcOptions& rpcOptions, apache::thrift::transport::THeader& header, apache::thrift::ContextStack* contextStack) { ::cpp2::C_f_pargs args; const auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; const auto writer = [&](Protocol_* p) { args.write(p); }; return apache::thrift::preprocessSendT( prot, rpcOptions, contextStack, header, "f", writer, sizer, channel_->getChecksumSamplingRate()); } template void apache::thrift::Client<::cpp2::C>::fbthrift_send_f(apache::thrift::SerializedRequest&& request, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::RequestClientCallback::Ptr callback) { static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "f", ::apache::thrift::FunctionQualifier::Unspecified, "C"); apache::thrift::clientSendT(std::move(request), std::forward(rpcOptions), std::move(callback), std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata)); } template apache::thrift::SerializedRequest apache::thrift::Client<::cpp2::C>::fbthrift_serialize_numbers(Protocol_* prot, const RpcOptions& rpcOptions, apache::thrift::transport::THeader& header, apache::thrift::ContextStack* contextStack) { ::cpp2::C_numbers_pargs args; const auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; const auto writer = [&](Protocol_* p) { args.write(p); }; return apache::thrift::preprocessSendT( prot, rpcOptions, contextStack, header, "numbers", writer, sizer, channel_->getChecksumSamplingRate()); } template void apache::thrift::Client<::cpp2::C>::fbthrift_send_numbers(apache::thrift::SerializedRequest&& request, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::StreamClientCallback* callback) { static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "numbers", ::apache::thrift::FunctionQualifier::Unspecified, "C"); apache::thrift::clientSendT(std::move(request), std::forward(rpcOptions), std::move(callback), std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata)); } template apache::thrift::SerializedRequest apache::thrift::Client<::cpp2::C>::fbthrift_serialize_thing(Protocol_* prot, const RpcOptions& rpcOptions, apache::thrift::transport::THeader& header, apache::thrift::ContextStack* contextStack, ::std::int32_t p_a, const ::std::string& p_b, const ::std::set<::std::int32_t>& p_c) { ::cpp2::C_thing_pargs args; args.get<0>().value = &p_a; args.get<1>().value = const_cast<::std::string*>(&p_b); args.get<2>().value = const_cast<::std::set<::std::int32_t>*>(&p_c); const auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); }; const auto writer = [&](Protocol_* p) { args.write(p); }; return apache::thrift::preprocessSendT( prot, rpcOptions, contextStack, header, "thing", writer, sizer, channel_->getChecksumSamplingRate()); } template void apache::thrift::Client<::cpp2::C>::fbthrift_send_thing(apache::thrift::SerializedRequest&& request, RpcOptions&& rpcOptions, std::shared_ptr header, apache::thrift::RequestClientCallback::Ptr callback) { static ::apache::thrift::MethodMetadata::Data* methodMetadata = new ::apache::thrift::MethodMetadata::Data( "thing", ::apache::thrift::FunctionQualifier::Unspecified, "C"); apache::thrift::clientSendT(std::move(request), std::forward(rpcOptions), std::move(callback), std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata)); } void apache::thrift::Client<::cpp2::C>::f(std::unique_ptr callback) { ::apache::thrift::RpcOptions rpcOptions; f(rpcOptions, std::move(callback)); } void apache::thrift::Client<::cpp2::C>::f(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback) { auto [ctx, header] = fCtx(&rpcOptions); auto [wrappedCallback, contextStack] = apache::thrift::GeneratedAsyncClient::template prepareRequestClientCallback(std::move(callback), std::move(ctx)); fbthrift_serialize_and_send_f(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback)); } void apache::thrift::Client<::cpp2::C>::fbthrift_serialize_and_send_f(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) { apache::thrift::detail::ac::withProtocolWriter(apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(), [&](auto&& writer) { apache::thrift::SerializedRequest request = fbthrift_serialize_f(&writer, rpcOptions, *header, contextStack); if (stealRpcOptions) { fbthrift_send_f(std::move(request), std::move(rpcOptions), std::move(header), std::move(callback)); } else { fbthrift_send_f(std::move(request), rpcOptions, std::move(header), std::move(callback)); } }); } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::C>::fCtx(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_, interceptors_, getServiceName(), "C.f", *header); return {std::move(ctx), std::move(header)}; } void apache::thrift::Client<::cpp2::C>::sync_f() { ::apache::thrift::RpcOptions rpcOptions; sync_f(rpcOptions); } void apache::thrift::Client<::cpp2::C>::sync_f(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 = fCtx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); #if FOLLY_HAS_COROUTINES const bool shouldProcessClientInterceptors = ctxAndHeader.first && ctxAndHeader.first->shouldProcessClientInterceptors(); if (shouldProcessClientInterceptors) { folly::coro::blockingWait(ctxAndHeader.first->processClientInterceptorsOnRequest()); } #endif callback.waitUntilDone( evb, [&] { fbthrift_serialize_and_send_f(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback)); }); #if FOLLY_HAS_COROUTINES if (shouldProcessClientInterceptors) { folly::coro::blockingWait(ctxAndHeader.first->processClientInterceptorsOnResponse()); } #endif 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_f(returnState); }); } folly::Future apache::thrift::Client<::cpp2::C>::future_f() { ::apache::thrift::RpcOptions rpcOptions; return future_f(rpcOptions); } folly::SemiFuture apache::thrift::Client<::cpp2::C>::semifuture_f() { ::apache::thrift::RpcOptions rpcOptions; return semifuture_f(rpcOptions); } folly::Future apache::thrift::Client<::cpp2::C>::future_f(apache::thrift::RpcOptions& rpcOptions) { using CallbackHelper = apache::thrift::detail::FutureCallbackHelper; folly::Promise promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_f, channel_); f(rpcOptions, std::move(callback)); return std::move(future).thenValue(CallbackHelper::extractResult); } folly::SemiFuture apache::thrift::Client<::cpp2::C>::semifuture_f(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_f, channel_); auto callback = std::move(callbackAndFuture.first); f(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } folly::Future>> apache::thrift::Client<::cpp2::C>::header_future_f(apache::thrift::RpcOptions& rpcOptions) { using CallbackHelper = apache::thrift::detail::FutureCallbackHelper>>; folly::Promise promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_f, channel_); f(rpcOptions, std::move(callback)); return std::move(future).thenValue(CallbackHelper::extractResult); } folly::SemiFuture>> apache::thrift::Client<::cpp2::C>::header_semifuture_f(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_f, channel_); auto callback = std::move(callbackAndFuture.first); f(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } void apache::thrift::Client<::cpp2::C>::f(folly::Function callback) { f(std::make_unique(std::move(callback))); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::C>::recv_wrapped_f(::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::C_f_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::C>::recv_f(::apache::thrift::ClientReceiveState& state) { auto ew = recv_wrapped_f(state); if (ew) { ew.throw_exception(); } } void apache::thrift::Client<::cpp2::C>::recv_instance_f(::apache::thrift::ClientReceiveState& state) { recv_f(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::C>::recv_instance_wrapped_f(::apache::thrift::ClientReceiveState& state) { return recv_wrapped_f(state); } void apache::thrift::Client<::cpp2::C>::numbers(std::unique_ptr callback) { ::apache::thrift::RpcOptions rpcOptions; numbers(rpcOptions, std::move(callback)); } void apache::thrift::Client<::cpp2::C>::numbers(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback) { auto [ctx, header] = numbersCtx(&rpcOptions); auto [wrappedCallback, contextStack] = apache::thrift::GeneratedAsyncClient::template prepareRequestClientCallback(std::move(callback), std::move(ctx)); auto streamCallback = apache::thrift::createStreamClientCallback(std::move(wrappedCallback), rpcOptions.getBufferOptions()); fbthrift_serialize_and_send_numbers(rpcOptions, std::move(header), contextStack, std::move(streamCallback)); } void apache::thrift::Client<::cpp2::C>::fbthrift_serialize_and_send_numbers(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::StreamClientCallback* callback, bool stealRpcOptions) { apache::thrift::detail::ac::withProtocolWriter(apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(), [&](auto&& writer) { apache::thrift::SerializedRequest request = fbthrift_serialize_numbers(&writer, rpcOptions, *header, contextStack); if (stealRpcOptions) { fbthrift_send_numbers(std::move(request), std::move(rpcOptions), std::move(header), std::move(callback)); } else { fbthrift_send_numbers(std::move(request), rpcOptions, std::move(header), std::move(callback)); } }); } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::C>::numbersCtx(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_, interceptors_, getServiceName(), "C.numbers", *header); return {std::move(ctx), std::move(header)}; } apache::thrift::ClientBufferedStream<::cpp2::number> apache::thrift::Client<::cpp2::C>::sync_numbers() { ::apache::thrift::RpcOptions rpcOptions; return sync_numbers(rpcOptions); } apache::thrift::ClientBufferedStream<::cpp2::number> apache::thrift::Client<::cpp2::C>::sync_numbers(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 = numbersCtx(&rpcOptions); auto wrappedCallback = apache::thrift::createStreamClientCallback( apache::thrift::RequestClientCallback::Ptr(&callback), rpcOptions.getBufferOptions()); #if FOLLY_HAS_COROUTINES const bool shouldProcessClientInterceptors = ctxAndHeader.first && ctxAndHeader.first->shouldProcessClientInterceptors(); if (shouldProcessClientInterceptors) { folly::coro::blockingWait(ctxAndHeader.first->processClientInterceptorsOnRequest()); } #endif callback.waitUntilDone( evb, [&] { fbthrift_serialize_and_send_numbers(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback)); }); #if FOLLY_HAS_COROUTINES if (shouldProcessClientInterceptors) { folly::coro::blockingWait(ctxAndHeader.first->processClientInterceptorsOnResponse()); } #endif 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_numbers(returnState); }); } folly::SemiFuture> apache::thrift::Client<::cpp2::C>::semifuture_numbers() { ::apache::thrift::RpcOptions rpcOptions; return semifuture_numbers(rpcOptions); } folly::SemiFuture> apache::thrift::Client<::cpp2::C>::semifuture_numbers(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_numbers, channel_); auto callback = std::move(callbackAndFuture.first); numbers(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } folly::SemiFuture, std::unique_ptr>> apache::thrift::Client<::cpp2::C>::header_semifuture_numbers(apache::thrift::RpcOptions& rpcOptions) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_numbers, channel_); auto callback = std::move(callbackAndFuture.first); numbers(rpcOptions, std::move(callback)); return std::move(callbackAndFuture.second); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::C>::recv_wrapped_numbers(apache::thrift::ClientBufferedStream<::cpp2::number>& _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 = ::cpp2::C_numbers_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"); } apache::thrift::ClientBufferedStream<::cpp2::number> apache::thrift::Client<::cpp2::C>::recv_numbers(::apache::thrift::ClientReceiveState& state) { apache::thrift::ClientBufferedStream<::cpp2::number> _return; auto ew = recv_wrapped_numbers(_return, state); if (ew) { ew.throw_exception(); } return _return; } apache::thrift::ClientBufferedStream<::cpp2::number> apache::thrift::Client<::cpp2::C>::recv_instance_numbers(::apache::thrift::ClientReceiveState& state) { return recv_numbers(state); } folly::exception_wrapper apache::thrift::Client<::cpp2::C>::recv_instance_wrapped_numbers(apache::thrift::ClientBufferedStream<::cpp2::number>& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_numbers(_return, state); } void apache::thrift::Client<::cpp2::C>::thing(std::unique_ptr callback, ::std::int32_t p_a, const ::std::string& p_b, const ::std::set<::std::int32_t>& p_c) { ::apache::thrift::RpcOptions rpcOptions; thing(rpcOptions, std::move(callback), p_a, p_b, p_c); } void apache::thrift::Client<::cpp2::C>::thing(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr callback, ::std::int32_t p_a, const ::std::string& p_b, const ::std::set<::std::int32_t>& p_c) { auto [ctx, header] = thingCtx(&rpcOptions); auto [wrappedCallback, contextStack] = apache::thrift::GeneratedAsyncClient::template prepareRequestClientCallback(std::move(callback), std::move(ctx)); fbthrift_serialize_and_send_thing(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback), p_a, p_b, p_c); } void apache::thrift::Client<::cpp2::C>::fbthrift_serialize_and_send_thing(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, ::std::int32_t p_a, const ::std::string& p_b, const ::std::set<::std::int32_t>& p_c, bool stealRpcOptions) { apache::thrift::detail::ac::withProtocolWriter(apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId(), [&](auto&& writer) { apache::thrift::SerializedRequest request = fbthrift_serialize_thing(&writer, rpcOptions, *header, contextStack, p_a, p_b, p_c); if (stealRpcOptions) { fbthrift_send_thing(std::move(request), std::move(rpcOptions), std::move(header), std::move(callback)); } else { fbthrift_send_thing(std::move(request), rpcOptions, std::move(header), std::move(callback)); } }); } std::pair<::apache::thrift::ContextStack::UniquePtr, std::shared_ptr<::apache::thrift::transport::THeader>> apache::thrift::Client<::cpp2::C>::thingCtx(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_, interceptors_, getServiceName(), "C.thing", *header); return {std::move(ctx), std::move(header)}; } void apache::thrift::Client<::cpp2::C>::sync_thing(::std::string& _return, ::std::int32_t p_a, const ::std::string& p_b, const ::std::set<::std::int32_t>& p_c) { ::apache::thrift::RpcOptions rpcOptions; sync_thing(rpcOptions, _return, p_a, p_b, p_c); } void apache::thrift::Client<::cpp2::C>::sync_thing(apache::thrift::RpcOptions& rpcOptions, ::std::string& _return, ::std::int32_t p_a, const ::std::string& p_b, const ::std::set<::std::int32_t>& p_c) { 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 = thingCtx(&rpcOptions); auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback); #if FOLLY_HAS_COROUTINES const bool shouldProcessClientInterceptors = ctxAndHeader.first && ctxAndHeader.first->shouldProcessClientInterceptors(); if (shouldProcessClientInterceptors) { folly::coro::blockingWait(ctxAndHeader.first->processClientInterceptorsOnRequest()); } #endif callback.waitUntilDone( evb, [&] { fbthrift_serialize_and_send_thing(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback), p_a, p_b, p_c); }); #if FOLLY_HAS_COROUTINES if (shouldProcessClientInterceptors) { folly::coro::blockingWait(ctxAndHeader.first->processClientInterceptorsOnResponse()); } #endif 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_thing(_return, returnState); }); } folly::Future<::std::string> apache::thrift::Client<::cpp2::C>::future_thing(::std::int32_t p_a, const ::std::string& p_b, const ::std::set<::std::int32_t>& p_c) { ::apache::thrift::RpcOptions rpcOptions; return future_thing(rpcOptions, p_a, p_b, p_c); } folly::SemiFuture<::std::string> apache::thrift::Client<::cpp2::C>::semifuture_thing(::std::int32_t p_a, const ::std::string& p_b, const ::std::set<::std::int32_t>& p_c) { ::apache::thrift::RpcOptions rpcOptions; return semifuture_thing(rpcOptions, p_a, p_b, p_c); } folly::Future<::std::string> apache::thrift::Client<::cpp2::C>::future_thing(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_a, const ::std::string& p_b, const ::std::set<::std::int32_t>& p_c) { using CallbackHelper = apache::thrift::detail::FutureCallbackHelper<::std::string>; folly::Promise promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_thing, channel_); thing(rpcOptions, std::move(callback), p_a, p_b, p_c); return std::move(future).thenValue(CallbackHelper::extractResult); } folly::SemiFuture<::std::string> apache::thrift::Client<::cpp2::C>::semifuture_thing(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_a, const ::std::string& p_b, const ::std::set<::std::int32_t>& p_c) { auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_thing, channel_); auto callback = std::move(callbackAndFuture.first); thing(rpcOptions, std::move(callback), p_a, p_b, p_c); return std::move(callbackAndFuture.second); } folly::Future>> apache::thrift::Client<::cpp2::C>::header_future_thing(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_a, const ::std::string& p_b, const ::std::set<::std::int32_t>& p_c) { using CallbackHelper = apache::thrift::detail::FutureCallbackHelper>>; folly::Promise promise; auto future = promise.getFuture(); auto callback = std::make_unique>(std::move(promise), recv_wrapped_thing, channel_); thing(rpcOptions, std::move(callback), p_a, p_b, p_c); return std::move(future).thenValue(CallbackHelper::extractResult); } folly::SemiFuture>> apache::thrift::Client<::cpp2::C>::header_semifuture_thing(apache::thrift::RpcOptions& rpcOptions, ::std::int32_t p_a, const ::std::string& p_b, const ::std::set<::std::int32_t>& p_c) { auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_thing, channel_); auto callback = std::move(callbackAndFuture.first); thing(rpcOptions, std::move(callback), p_a, p_b, p_c); return std::move(callbackAndFuture.second); } void apache::thrift::Client<::cpp2::C>::thing(folly::Function callback, ::std::int32_t p_a, const ::std::string& p_b, const ::std::set<::std::int32_t>& p_c) { thing(std::make_unique(std::move(callback)), p_a, p_b, p_c); } #if FOLLY_HAS_COROUTINES #endif // FOLLY_HAS_COROUTINES folly::exception_wrapper apache::thrift::Client<::cpp2::C>::recv_wrapped_thing(::std::string& _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 = ::cpp2::C_thing_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<::cpp2::C>::recv_thing(::std::string& _return, ::apache::thrift::ClientReceiveState& state) { auto ew = recv_wrapped_thing(_return, state); if (ew) { ew.throw_exception(); } } void apache::thrift::Client<::cpp2::C>::recv_instance_thing(::std::string& _return, ::apache::thrift::ClientReceiveState& state) { return recv_thing(_return, state); } folly::exception_wrapper apache::thrift::Client<::cpp2::C>::recv_instance_wrapped_thing(::std::string& _return, ::apache::thrift::ClientReceiveState& state) { return recv_wrapped_thing(_return, state); }