/** * 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 */ #pragma once #include #include "thrift/compiler/test/fixtures/basic-annotations/gen-cpp2/BadServiceAsyncClient.h" #include "thrift/compiler/test/fixtures/basic-annotations/gen-cpp2/module_types.h" #include #include namespace folly { class IOBuf; class IOBufQueue; } namespace apache { namespace thrift { class Cpp2RequestContext; class BinaryProtocolReader; class CompactProtocolReader; namespace transport { class THeader; } }} namespace cpp2 { class GoodService; class GoodServiceAsyncProcessor; class GoodServiceServiceInfoHolder : public apache::thrift::ServiceInfoHolder { public: apache::thrift::ServiceRequestInfoMap const& requestInfoMap() const override; static apache::thrift::ServiceRequestInfoMap staticRequestInfoMap(); }; } // namespace cpp2 namespace apache::thrift { template <> class ServiceHandler<::cpp2::GoodService> : public apache::thrift::ServerInterface { public: std::string_view getGeneratedName() const override { return "BadService"; } typedef ::cpp2::GoodServiceAsyncProcessor ProcessorType; std::unique_ptr getProcessor() override; CreateMethodMetadataResult createMethodMetadata() override; bool isThriftGenerated() const override final { return true; } private: std::optional> getServiceRequestInfoMap() const; public: class BadInteractionServiceInfoHolder : public apache::thrift::ServiceInfoHolder { public: apache::thrift::ServiceRequestInfoMap const& requestInfoMap() const override; static apache::thrift::ServiceRequestInfoMap staticRequestInfoMap(); }; class BadInteractionIf : public apache::thrift::Tile, public apache::thrift::ServerInterface { public: std::string_view getGeneratedName() const override { return "BadInteraction"; } typedef ::cpp2::GoodServiceAsyncProcessor ProcessorType; std::unique_ptr getProcessor() override { std::terminate(); } CreateMethodMetadataResult createMethodMetadata() override { std::terminate(); } virtual void sync_foo(); [[deprecated("Use sync_foo instead")]] virtual void foo(); virtual folly::SemiFuture semifuture_foo(); #if FOLLY_HAS_COROUTINES virtual folly::coro::Task co_foo(); virtual folly::coro::Task co_foo(apache::thrift::RequestParams params); #endif virtual void async_tm_foo(apache::thrift::HandlerCallbackPtr callback); private: std::atomic __fbthrift_invocation_foo{apache::thrift::detail::si::InvocationType::AsyncTm}; }; virtual std::unique_ptr createBadInteraction(); virtual ::std::int32_t sync_bar(); [[deprecated("Use sync_bar instead")]] virtual ::std::int32_t bar(); virtual folly::Future<::std::int32_t> future_bar(); virtual folly::SemiFuture<::std::int32_t> semifuture_bar(); #if FOLLY_HAS_COROUTINES virtual folly::coro::Task<::std::int32_t> co_bar(); virtual folly::coro::Task<::std::int32_t> co_bar(apache::thrift::RequestParams params); #endif virtual void async_tm_bar(apache::thrift::HandlerCallbackPtr<::std::int32_t> callback); private: static ::cpp2::GoodServiceServiceInfoHolder __fbthrift_serviceInfoHolder; std::atomic __fbthrift_invocation_createBadInteraction{apache::thrift::detail::si::InvocationType::AsyncTm}; std::atomic __fbthrift_invocation_bar{apache::thrift::detail::si::InvocationType::AsyncTm}; }; } // namespace apache::thrift namespace cpp2 { using GoodServiceSvIf [[deprecated("Use apache::thrift::ServiceHandler instead")]] = ::apache::thrift::ServiceHandler; } // namespace cpp2 namespace cpp2 { class GoodServiceSvNull : public ::apache::thrift::ServiceHandler { public: ::std::int32_t bar() override; }; class GoodServiceAsyncProcessor : public ::apache::thrift::GeneratedAsyncProcessorBase { public: const char* getServiceName() override; void getServiceMetadata(apache::thrift::metadata::ThriftServiceMetadataResponse& response) override; using BaseAsyncProcessor = void; protected: ::apache::thrift::ServiceHandler<::cpp2::GoodService>* iface_; public: void processSerializedCompressedRequestWithMetadata(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, const apache::thrift::AsyncProcessorFactory::MethodMetadata& methodMetadata, apache::thrift::protocol::PROTOCOL_TYPES protType, apache::thrift::Cpp2RequestContext* context, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) override; void executeRequest(apache::thrift::ServerRequest&& serverRequest, const apache::thrift::AsyncProcessorFactory::MethodMetadata& methodMetadata) override; public: using ProcessFuncs = GeneratedAsyncProcessorBase::ProcessFuncs; using ProcessMap = GeneratedAsyncProcessorBase::ProcessMap; using InteractionConstructor = GeneratedAsyncProcessorBase::InteractionConstructor; using InteractionConstructorMap = GeneratedAsyncProcessorBase::InteractionConstructorMap; static const GoodServiceAsyncProcessor::ProcessMap& getOwnProcessMap(); static const GoodServiceAsyncProcessor::InteractionConstructorMap& getInteractionConstructorMap(); std::unique_ptr createInteractionImpl(const std::string& name) override; private: static const GoodServiceAsyncProcessor::ProcessMap kOwnProcessMap_; static const GoodServiceAsyncProcessor::InteractionConstructorMap interactionConstructorMap_; private: std::unique_ptr createBadInteraction() { return iface_->createBadInteraction(); } template void setUpAndProcess_bar(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); template void executeRequest_bar(apache::thrift::ServerRequest&& serverRequest); template static apache::thrift::SerializedResponse return_bar(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return); template static void throw_wrapped_bar(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); template void setUpAndProcess_BadInteraction_foo(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); template void executeRequest_BadInteraction_foo(apache::thrift::ServerRequest&& serverRequest); template static apache::thrift::SerializedResponse return_BadInteraction_foo(apache::thrift::ContextStack* ctx); template static void throw_wrapped_BadInteraction_foo(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); public: GoodServiceAsyncProcessor(::apache::thrift::ServiceHandler<::cpp2::GoodService>* iface) : iface_(iface) {} ~GoodServiceAsyncProcessor() override {} }; } // namespace cpp2