/**
 * Autogenerated by Thrift for thrift/compiler/test/fixtures/inheritance/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/inheritance/gen-cpp2/MyLeafAsyncClient.h"
#include "thrift/compiler/test/fixtures/inheritance/gen-cpp2/module_types.h"
#if __has_include("thrift/compiler/test/fixtures/inheritance/gen-cpp2/MyNode.h")
#include "thrift/compiler/test/fixtures/inheritance/gen-cpp2/MyNode.h"
#else
#include "thrift/compiler/test/fixtures/inheritance/gen-cpp2/module_handlers.h"
#endif

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

namespace cpp2 {
class MyLeaf;
class MyLeafAsyncProcessor;

class MyLeafServiceInfoHolder : 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::MyLeaf> : virtual public ::cpp2::MyNodeSvIf {
 public:
  std::string_view getGeneratedName() const override { return "MyLeaf"; }

  typedef ::cpp2::MyLeafAsyncProcessor ProcessorType;
  std::unique_ptr<apache::thrift::AsyncProcessor> getProcessor() override;
  CreateMethodMetadataResult createMethodMetadata() override;
 private:
  std::optional<std::reference_wrapper<apache::thrift::ServiceRequestInfoMap const>> getServiceRequestInfoMap() const;
 public:

  virtual void sync_do_leaf();
  [[deprecated("Use sync_do_leaf instead")]] virtual void do_leaf();
  virtual folly::Future<folly::Unit> future_do_leaf();
  virtual folly::SemiFuture<folly::Unit> semifuture_do_leaf();
#if FOLLY_HAS_COROUTINES
  virtual folly::coro::Task<void> co_do_leaf();
  virtual folly::coro::Task<void> co_do_leaf(apache::thrift::RequestParams params);
#endif
  virtual void async_tm_do_leaf(apache::thrift::HandlerCallbackPtr<void> callback);
 private:
  static ::cpp2::MyLeafServiceInfoHolder __fbthrift_serviceInfoHolder;
  std::atomic<apache::thrift::detail::si::InvocationType> __fbthrift_invocation_do_leaf{apache::thrift::detail::si::InvocationType::AsyncTm};
};

} // namespace apache::thrift

namespace cpp2 {
using MyLeafSvIf [[deprecated("Use apache::thrift::ServiceHandler<MyLeaf> instead")]] = ::apache::thrift::ServiceHandler<MyLeaf>;
} // namespace cpp2

namespace cpp2 {
class MyLeafSvNull : public ::apache::thrift::ServiceHandler<MyLeaf>, virtual public ::apache::thrift::ServiceHandler<::cpp2::MyNode> {
 public:
  void do_leaf() override;
};

class MyLeafAsyncProcessor : public ::cpp2::MyNodeAsyncProcessor {
 public:
  const char* getServiceName() override;
  void getServiceMetadata(apache::thrift::metadata::ThriftServiceMetadataResponse& response) override;
  using BaseAsyncProcessor = ::cpp2::MyNodeAsyncProcessor;
 protected:
  ::apache::thrift::ServiceHandler<::cpp2::MyLeaf>* 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<MyLeafAsyncProcessor>;
  using ProcessMap = GeneratedAsyncProcessorBase::ProcessMap<ProcessFuncs>;
  static const MyLeafAsyncProcessor::ProcessMap& getOwnProcessMap();
 private:
  static const MyLeafAsyncProcessor::ProcessMap kOwnProcessMap_;
 private:
  template <typename ProtocolIn_, typename ProtocolOut_>
  void setUpAndProcess_do_leaf(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_do_leaf(apache::thrift::ServerRequest&& serverRequest);
  template <class ProtocolIn_, class ProtocolOut_>
  static apache::thrift::SerializedResponse return_do_leaf(apache::thrift::ContextStack* ctx);
  template <class ProtocolIn_, class ProtocolOut_>
  static void throw_wrapped_do_leaf(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx);
 public:
  MyLeafAsyncProcessor(::apache::thrift::ServiceHandler<::cpp2::MyLeaf>* iface) :
      ::cpp2::MyNodeAsyncProcessor(iface),
      iface_(iface) {}
  ~MyLeafAsyncProcessor() override {}
};

} // namespace cpp2
