1 /** 2 * Autogenerated by Thrift for src/module.thrift 3 * 4 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 5 * @generated @nocommit 6 */ 7 #pragma once 8 9 #include <thrift/lib/cpp2/gen/service_h.h> 10 11 #include "thrift/compiler/test/fixtures/fatal/gen-cpp2/service3AsyncClient.h" 12 #include "thrift/compiler/test/fixtures/fatal/gen-cpp2/module_types.h" 13 #include "thrift/compiler/test/fixtures/fatal/gen-cpp2/reflection_dep_B_types.h" 14 #include "thrift/compiler/test/fixtures/fatal/gen-cpp2/reflection_dep_C_types.h" 15 #include "thrift/test/fatal_custom_types.h" 16 17 namespace folly { 18 class IOBuf; 19 class IOBufQueue; 20 } 21 namespace apache { namespace thrift { 22 class Cpp2RequestContext; 23 class BinaryProtocolReader; 24 class CompactProtocolReader; 25 namespace transport { class THeader; } 26 }} 27 28 namespace test_cpp2 { namespace cpp_reflection { 29 30 class service3SvAsyncIf { 31 public: ~service3SvAsyncIf()32 virtual ~service3SvAsyncIf() {} 33 virtual void async_tm_methodA(std::unique_ptr<apache::thrift::HandlerCallback<void>> callback) = 0; 34 virtual folly::Future<folly::Unit> future_methodA() = 0; 35 virtual folly::SemiFuture<folly::Unit> semifuture_methodA() = 0; 36 virtual void async_tm_methodB(std::unique_ptr<apache::thrift::HandlerCallback<void>> callback, ::std::int32_t p_x, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_y, double p_z) = 0; 37 virtual folly::Future<folly::Unit> future_methodB(::std::int32_t p_x, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_y, double p_z) = 0; 38 virtual folly::SemiFuture<folly::Unit> semifuture_methodB(::std::int32_t p_x, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_y, double p_z) = 0; 39 virtual void async_tm_methodC(std::unique_ptr<apache::thrift::HandlerCallback<::std::int32_t>> callback) = 0; 40 virtual folly::Future<::std::int32_t> future_methodC() = 0; 41 virtual folly::SemiFuture<::std::int32_t> semifuture_methodC() = 0; 42 virtual void async_tm_methodD(std::unique_ptr<apache::thrift::HandlerCallback<::std::int32_t>> callback, ::std::int32_t p_i, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_j, double p_k) = 0; 43 virtual folly::Future<::std::int32_t> future_methodD(::std::int32_t p_i, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_j, double p_k) = 0; 44 virtual folly::SemiFuture<::std::int32_t> semifuture_methodD(::std::int32_t p_i, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_j, double p_k) = 0; 45 virtual void async_tm_methodE(std::unique_ptr<apache::thrift::HandlerCallback<std::unique_ptr<::test_cpp2::cpp_reflection::struct2>>> callback) = 0; 46 virtual folly::Future<std::unique_ptr<::test_cpp2::cpp_reflection::struct2>> future_methodE() = 0; 47 virtual folly::SemiFuture<std::unique_ptr<::test_cpp2::cpp_reflection::struct2>> semifuture_methodE() = 0; 48 virtual void async_tm_methodF(std::unique_ptr<apache::thrift::HandlerCallback<std::unique_ptr<::test_cpp2::cpp_reflection::struct3>>> callback, ::std::int32_t p_l, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_m, double p_n) = 0; 49 virtual folly::Future<std::unique_ptr<::test_cpp2::cpp_reflection::struct3>> future_methodF(::std::int32_t p_l, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_m, double p_n) = 0; 50 virtual folly::SemiFuture<std::unique_ptr<::test_cpp2::cpp_reflection::struct3>> semifuture_methodF(::std::int32_t p_l, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_m, double p_n) = 0; 51 }; 52 53 class service3AsyncProcessor; 54 55 class service3SvIf : public service3SvAsyncIf, public apache::thrift::ServerInterface { 56 public: getGeneratedName()57 std::string_view getGeneratedName() const override { return "service3"; } 58 59 typedef service3AsyncProcessor ProcessorType; 60 std::unique_ptr<apache::thrift::AsyncProcessor> getProcessor() override; 61 CreateMethodMetadataResult createMethodMetadata() override; 62 63 64 virtual void methodA(); 65 folly::Future<folly::Unit> future_methodA() override; 66 folly::SemiFuture<folly::Unit> semifuture_methodA() override; 67 void async_tm_methodA(std::unique_ptr<apache::thrift::HandlerCallback<void>> callback) override; 68 virtual void methodB(::std::int32_t /*x*/, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> /*y*/, double /*z*/); 69 folly::Future<folly::Unit> future_methodB(::std::int32_t p_x, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_y, double p_z) override; 70 folly::SemiFuture<folly::Unit> semifuture_methodB(::std::int32_t p_x, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_y, double p_z) override; 71 void async_tm_methodB(std::unique_ptr<apache::thrift::HandlerCallback<void>> callback, ::std::int32_t p_x, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_y, double p_z) override; 72 virtual ::std::int32_t methodC(); 73 folly::Future<::std::int32_t> future_methodC() override; 74 folly::SemiFuture<::std::int32_t> semifuture_methodC() override; 75 void async_tm_methodC(std::unique_ptr<apache::thrift::HandlerCallback<::std::int32_t>> callback) override; 76 virtual ::std::int32_t methodD(::std::int32_t /*i*/, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> /*j*/, double /*k*/); 77 folly::Future<::std::int32_t> future_methodD(::std::int32_t p_i, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_j, double p_k) override; 78 folly::SemiFuture<::std::int32_t> semifuture_methodD(::std::int32_t p_i, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_j, double p_k) override; 79 void async_tm_methodD(std::unique_ptr<apache::thrift::HandlerCallback<::std::int32_t>> callback, ::std::int32_t p_i, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_j, double p_k) override; 80 virtual void methodE(::test_cpp2::cpp_reflection::struct2& /*_return*/); 81 folly::Future<std::unique_ptr<::test_cpp2::cpp_reflection::struct2>> future_methodE() override; 82 folly::SemiFuture<std::unique_ptr<::test_cpp2::cpp_reflection::struct2>> semifuture_methodE() override; 83 void async_tm_methodE(std::unique_ptr<apache::thrift::HandlerCallback<std::unique_ptr<::test_cpp2::cpp_reflection::struct2>>> callback) override; 84 virtual void methodF(::test_cpp2::cpp_reflection::struct3& /*_return*/, ::std::int32_t /*l*/, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> /*m*/, double /*n*/); 85 folly::Future<std::unique_ptr<::test_cpp2::cpp_reflection::struct3>> future_methodF(::std::int32_t p_l, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_m, double p_n) override; 86 folly::SemiFuture<std::unique_ptr<::test_cpp2::cpp_reflection::struct3>> semifuture_methodF(::std::int32_t p_l, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_m, double p_n) override; 87 void async_tm_methodF(std::unique_ptr<apache::thrift::HandlerCallback<std::unique_ptr<::test_cpp2::cpp_reflection::struct3>>> callback, ::std::int32_t p_l, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> p_m, double p_n) override; 88 private: 89 std::atomic<apache::thrift::detail::si::InvocationType> __fbthrift_invocation_methodA{apache::thrift::detail::si::InvocationType::AsyncTm}; 90 std::atomic<apache::thrift::detail::si::InvocationType> __fbthrift_invocation_methodB{apache::thrift::detail::si::InvocationType::AsyncTm}; 91 std::atomic<apache::thrift::detail::si::InvocationType> __fbthrift_invocation_methodC{apache::thrift::detail::si::InvocationType::AsyncTm}; 92 std::atomic<apache::thrift::detail::si::InvocationType> __fbthrift_invocation_methodD{apache::thrift::detail::si::InvocationType::AsyncTm}; 93 std::atomic<apache::thrift::detail::si::InvocationType> __fbthrift_invocation_methodE{apache::thrift::detail::si::InvocationType::AsyncTm}; 94 std::atomic<apache::thrift::detail::si::InvocationType> __fbthrift_invocation_methodF{apache::thrift::detail::si::InvocationType::AsyncTm}; 95 }; 96 97 class service3SvNull : public service3SvIf { 98 public: 99 void methodA() override; 100 void methodB(::std::int32_t /*x*/, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> /*y*/, double /*z*/) override; 101 ::std::int32_t methodC() override; 102 ::std::int32_t methodD(::std::int32_t /*i*/, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> /*j*/, double /*k*/) override; 103 void methodE(::test_cpp2::cpp_reflection::struct2& /*_return*/) override; 104 void methodF(::test_cpp2::cpp_reflection::struct3& /*_return*/, ::std::int32_t /*l*/, std::unique_ptr<::test_cpp2::cpp_reflection::struct1> /*m*/, double /*n*/) override; 105 }; 106 107 class service3AsyncProcessor : public ::apache::thrift::GeneratedAsyncProcessor { 108 public: 109 const char* getServiceName() override; 110 void getServiceMetadata(apache::thrift::metadata::ThriftServiceMetadataResponse& response) override; 111 using BaseAsyncProcessor = void; 112 protected: 113 service3SvIf* iface_; 114 public: 115 // This is implemented in case the corresponding AsyncProcessorFactory did not implement createMethodMetadata. 116 // This can happen if the service is using a custom AsyncProcessorFactory but re-using the same AsyncProcessor. 117 void processSerializedCompressedRequest(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::protocol::PROTOCOL_TYPES protType, apache::thrift::Cpp2RequestContext* context, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) override; 118 // By default, this overload will be called for generated services 119 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; 120 public: 121 using ProcessFuncs = GeneratedAsyncProcessor::ProcessFuncs<service3AsyncProcessor>; 122 using ProcessMap = GeneratedAsyncProcessor::ProcessMap<ProcessFuncs>; 123 static const service3AsyncProcessor::ProcessMap& getOwnProcessMap(); 124 private: 125 static const service3AsyncProcessor::ProcessMap kOwnProcessMap_; 126 private: 127 template <typename ProtocolIn_, typename ProtocolOut_> 128 void setUpAndProcess_methodA(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); 129 template <typename ProtocolIn_, typename ProtocolOut_> 130 void process_methodA(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); 131 template <class ProtocolIn_, class ProtocolOut_> 132 static apache::thrift::SerializedResponse return_methodA(apache::thrift::ContextStack* ctx); 133 template <class ProtocolIn_, class ProtocolOut_> 134 static void throw_wrapped_methodA(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); 135 template <typename ProtocolIn_, typename ProtocolOut_> 136 void setUpAndProcess_methodB(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); 137 template <typename ProtocolIn_, typename ProtocolOut_> 138 void process_methodB(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); 139 template <class ProtocolIn_, class ProtocolOut_> 140 static apache::thrift::SerializedResponse return_methodB(apache::thrift::ContextStack* ctx); 141 template <class ProtocolIn_, class ProtocolOut_> 142 static void throw_wrapped_methodB(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); 143 template <typename ProtocolIn_, typename ProtocolOut_> 144 void setUpAndProcess_methodC(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); 145 template <typename ProtocolIn_, typename ProtocolOut_> 146 void process_methodC(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); 147 template <class ProtocolIn_, class ProtocolOut_> 148 static apache::thrift::SerializedResponse return_methodC(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return); 149 template <class ProtocolIn_, class ProtocolOut_> 150 static void throw_wrapped_methodC(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); 151 template <typename ProtocolIn_, typename ProtocolOut_> 152 void setUpAndProcess_methodD(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); 153 template <typename ProtocolIn_, typename ProtocolOut_> 154 void process_methodD(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); 155 template <class ProtocolIn_, class ProtocolOut_> 156 static apache::thrift::SerializedResponse return_methodD(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return); 157 template <class ProtocolIn_, class ProtocolOut_> 158 static void throw_wrapped_methodD(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); 159 template <typename ProtocolIn_, typename ProtocolOut_> 160 void setUpAndProcess_methodE(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); 161 template <typename ProtocolIn_, typename ProtocolOut_> 162 void process_methodE(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); 163 template <class ProtocolIn_, class ProtocolOut_> 164 static apache::thrift::SerializedResponse return_methodE(apache::thrift::ContextStack* ctx, ::test_cpp2::cpp_reflection::struct2 const& _return); 165 template <class ProtocolIn_, class ProtocolOut_> 166 static void throw_wrapped_methodE(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); 167 template <typename ProtocolIn_, typename ProtocolOut_> 168 void setUpAndProcess_methodF(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); 169 template <typename ProtocolIn_, typename ProtocolOut_> 170 void process_methodF(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx,folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm); 171 template <class ProtocolIn_, class ProtocolOut_> 172 static apache::thrift::SerializedResponse return_methodF(apache::thrift::ContextStack* ctx, ::test_cpp2::cpp_reflection::struct3 const& _return); 173 template <class ProtocolIn_, class ProtocolOut_> 174 static void throw_wrapped_methodF(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx); 175 public: service3AsyncProcessor(service3SvIf * iface)176 service3AsyncProcessor(service3SvIf* iface) : 177 iface_(iface) {} ~service3AsyncProcessor()178 ~service3AsyncProcessor() override {} 179 }; 180 181 }} // test_cpp2::cpp_reflection 182