/**
 * Autogenerated by Thrift for thrift/compiler/test/fixtures/adapter/src/module.thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated @nocommit
 */
#pragma once

#include <thrift/lib/cpp2/gen/service_h.h>

#include "thrift/compiler/test/fixtures/adapter/gen-cpp2/AdapterServiceAsyncClient.h"
#include "thrift/compiler/test/fixtures/adapter/gen-cpp2/module_types.h"

namespace folly {
  class IOBuf;
  class IOBufQueue;
}
namespace apache { namespace thrift {
  class Cpp2RequestContext;
  class BinaryProtocolReader;
  class CompactProtocolReader;
  namespace transport { class THeader; }
}}

namespace facebook::thrift::test {
class AdapterService;
class AdapterServiceAsyncProcessor;

class AdapterServiceServiceInfoHolder : public apache::thrift::ServiceInfoHolder {
  public:
   apache::thrift::ServiceRequestInfoMap const& requestInfoMap() const override;
   static apache::thrift::ServiceRequestInfoMap staticRequestInfoMap();
};
} // namespace facebook::thrift::test

namespace apache::thrift {
template <>
class ServiceHandler<::facebook::thrift::test::AdapterService> : public apache::thrift::ServerInterface {
 public:
  std::string_view getGeneratedName() const override { return "AdapterService"; }

  static const char* __fbthrift_thrift_uri() {
    return "facebook.com/thrift/test/AdapterService";
  }

  typedef ::facebook::thrift::test::AdapterServiceAsyncProcessor ProcessorType;
  std::unique_ptr<apache::thrift::AsyncProcessor> getProcessor() override;
  CreateMethodMetadataResult createMethodMetadata() override;
  bool isThriftGenerated() const override final { return true; }
 private:
  std::optional<std::reference_wrapper<apache::thrift::ServiceRequestInfoMap const>> getServiceRequestInfoMap() const;
 public:

  virtual void sync_count(::facebook::thrift::test::CountingStruct& /*_return*/);
  [[deprecated("Use sync_count instead")]] virtual void count(::facebook::thrift::test::CountingStruct& /*_return*/);
  virtual folly::Future<std::unique_ptr<::facebook::thrift::test::CountingStruct>> future_count();
  virtual folly::SemiFuture<std::unique_ptr<::facebook::thrift::test::CountingStruct>> semifuture_count();
#if FOLLY_HAS_COROUTINES
  virtual folly::coro::Task<std::unique_ptr<::facebook::thrift::test::CountingStruct>> co_count();
  virtual folly::coro::Task<std::unique_ptr<::facebook::thrift::test::CountingStruct>> co_count(apache::thrift::RequestParams params);
#endif
  virtual void async_tm_count(apache::thrift::HandlerCallbackPtr<std::unique_ptr<::facebook::thrift::test::CountingStruct>> callback);
  virtual void sync_adaptedTypes(::facebook::thrift::test::HeapAllocated& /*_return*/, std::unique_ptr<::facebook::thrift::test::HeapAllocated> /*arg*/);
  [[deprecated("Use sync_adaptedTypes instead")]] virtual void adaptedTypes(::facebook::thrift::test::HeapAllocated& /*_return*/, std::unique_ptr<::facebook::thrift::test::HeapAllocated> /*arg*/);
  virtual folly::Future<std::unique_ptr<::facebook::thrift::test::HeapAllocated>> future_adaptedTypes(std::unique_ptr<::facebook::thrift::test::HeapAllocated> p_arg);
  virtual folly::SemiFuture<std::unique_ptr<::facebook::thrift::test::HeapAllocated>> semifuture_adaptedTypes(std::unique_ptr<::facebook::thrift::test::HeapAllocated> p_arg);
#if FOLLY_HAS_COROUTINES
  virtual folly::coro::Task<std::unique_ptr<::facebook::thrift::test::HeapAllocated>> co_adaptedTypes(std::unique_ptr<::facebook::thrift::test::HeapAllocated> p_arg);
  virtual folly::coro::Task<std::unique_ptr<::facebook::thrift::test::HeapAllocated>> co_adaptedTypes(apache::thrift::RequestParams params, std::unique_ptr<::facebook::thrift::test::HeapAllocated> p_arg);
#endif
  virtual void async_tm_adaptedTypes(apache::thrift::HandlerCallbackPtr<std::unique_ptr<::facebook::thrift::test::HeapAllocated>> callback, std::unique_ptr<::facebook::thrift::test::HeapAllocated> p_arg);
 private:
  static ::facebook::thrift::test::AdapterServiceServiceInfoHolder __fbthrift_serviceInfoHolder;
  std::atomic<apache::thrift::detail::si::InvocationType> __fbthrift_invocation_count{apache::thrift::detail::si::InvocationType::AsyncTm};
  std::atomic<apache::thrift::detail::si::InvocationType> __fbthrift_invocation_adaptedTypes{apache::thrift::detail::si::InvocationType::AsyncTm};
};

} // namespace apache::thrift

namespace facebook::thrift::test {
using AdapterServiceSvIf [[deprecated("Use apache::thrift::ServiceHandler<AdapterService> instead")]] = ::apache::thrift::ServiceHandler<AdapterService>;
} // namespace facebook::thrift::test

namespace facebook::thrift::test {
class AdapterServiceSvNull : public ::apache::thrift::ServiceHandler<AdapterService> {
 public:
  void count(::facebook::thrift::test::CountingStruct& /*_return*/) override;
  void adaptedTypes(::facebook::thrift::test::HeapAllocated& /*_return*/, std::unique_ptr<::facebook::thrift::test::HeapAllocated> /*arg*/) override;
};

class AdapterServiceAsyncProcessor : public ::apache::thrift::GeneratedAsyncProcessorBase {
 public:
  const char* getServiceName() override;
  void getServiceMetadata(apache::thrift::metadata::ThriftServiceMetadataResponse& response) override;
  using BaseAsyncProcessor = void;
 protected:
  ::apache::thrift::ServiceHandler<::facebook::thrift::test::AdapterService>* 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<AdapterServiceAsyncProcessor>;
  using ProcessMap = GeneratedAsyncProcessorBase::ProcessMap<ProcessFuncs>;
  static const AdapterServiceAsyncProcessor::ProcessMap& getOwnProcessMap();
 private:
  static const AdapterServiceAsyncProcessor::ProcessMap kOwnProcessMap_;
 private:
  template <typename ProtocolIn_, typename ProtocolOut_>
  void setUpAndProcess_count(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm);
  template <typename ProtocolIn_, typename ProtocolOut_>
  void executeRequest_count(apache::thrift::ServerRequest&& serverRequest);
  template <class ProtocolIn_, class ProtocolOut_>
  static apache::thrift::SerializedResponse return_count(apache::thrift::ContextStack* ctx, ::facebook::thrift::test::CountingStruct const& _return);
  template <class ProtocolIn_, class ProtocolOut_>
  static void throw_wrapped_count(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx);
  template <typename ProtocolIn_, typename ProtocolOut_>
  void setUpAndProcess_adaptedTypes(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm);
  template <typename ProtocolIn_, typename ProtocolOut_>
  void executeRequest_adaptedTypes(apache::thrift::ServerRequest&& serverRequest);
  template <class ProtocolIn_, class ProtocolOut_>
  static apache::thrift::SerializedResponse return_adaptedTypes(apache::thrift::ContextStack* ctx, ::facebook::thrift::test::HeapAllocated const& _return);
  template <class ProtocolIn_, class ProtocolOut_>
  static void throw_wrapped_adaptedTypes(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx);
 public:
  AdapterServiceAsyncProcessor(::apache::thrift::ServiceHandler<::facebook::thrift::test::AdapterService>* iface) :
      iface_(iface) {}
  ~AdapterServiceAsyncProcessor() override {}
};

} // namespace facebook::thrift::test
