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/compiler/test/fixtures/mcpp2-compare/gen-cpp2/ReturnService.h"
10
11 #include <thrift/lib/cpp2/gen/service_tcc.h>
12
13 namespace some { namespace valid { namespace ns {
14 typedef apache::thrift::ThriftPresult<false> ReturnService_noReturn_pargs;
15 typedef apache::thrift::ThriftPresult<true> ReturnService_noReturn_presult;
16 typedef apache::thrift::ThriftPresult<false> ReturnService_boolReturn_pargs;
17 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, bool*>> ReturnService_boolReturn_presult;
18 typedef apache::thrift::ThriftPresult<false> ReturnService_i16Return_pargs;
19 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int16_t*>> ReturnService_i16Return_presult;
20 typedef apache::thrift::ThriftPresult<false> ReturnService_i32Return_pargs;
21 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> ReturnService_i32Return_presult;
22 typedef apache::thrift::ThriftPresult<false> ReturnService_i64Return_pargs;
23 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int64_t*>> ReturnService_i64Return_presult;
24 typedef apache::thrift::ThriftPresult<false> ReturnService_floatReturn_pargs;
25 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::floating_point, float*>> ReturnService_floatReturn_presult;
26 typedef apache::thrift::ThriftPresult<false> ReturnService_doubleReturn_pargs;
27 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::floating_point, double*>> ReturnService_doubleReturn_presult;
28 typedef apache::thrift::ThriftPresult<false> ReturnService_stringReturn_pargs;
29 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::string, ::std::string*>> ReturnService_stringReturn_presult;
30 typedef apache::thrift::ThriftPresult<false> ReturnService_binaryReturn_pargs;
31 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::binary, ::std::string*>> ReturnService_binaryReturn_presult;
32 typedef apache::thrift::ThriftPresult<false> ReturnService_mapReturn_pargs;
33 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::integral>, ::std::map<::std::string, ::std::int64_t>*>> ReturnService_mapReturn_presult;
34 typedef apache::thrift::ThriftPresult<false> ReturnService_simpleTypedefReturn_pargs;
35 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::some::valid::ns::simpleTypeDef*>> ReturnService_simpleTypedefReturn_presult;
36 typedef apache::thrift::ThriftPresult<false> ReturnService_complexTypedefReturn_pargs;
37 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::list<::apache::thrift::type_class::map<::apache::thrift::type_class::structure, ::apache::thrift::type_class::structure>>, ::some::valid::ns::complexStructTypeDef*>> ReturnService_complexTypedefReturn_presult;
38 typedef apache::thrift::ThriftPresult<false> ReturnService_list_mostComplexTypedefReturn_pargs;
39 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::list<::apache::thrift::type_class::list<::apache::thrift::type_class::list<::apache::thrift::type_class::map<::apache::thrift::type_class::structure, ::apache::thrift::type_class::structure>>>>, ::std::vector<::some::valid::ns::mostComplexTypeDef>*>> ReturnService_list_mostComplexTypedefReturn_presult;
40 typedef apache::thrift::ThriftPresult<false> ReturnService_enumReturn_pargs;
41 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::enumeration, ::some::valid::ns::MyEnumA*>> ReturnService_enumReturn_presult;
42 typedef apache::thrift::ThriftPresult<false> ReturnService_list_EnumReturn_pargs;
43 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::list<::apache::thrift::type_class::enumeration>, ::std::vector<::some::valid::ns::MyEnumA>*>> ReturnService_list_EnumReturn_presult;
44 typedef apache::thrift::ThriftPresult<false> ReturnService_structReturn_pargs;
45 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::structure, ::some::valid::ns::MyStruct*>> ReturnService_structReturn_presult;
46 typedef apache::thrift::ThriftPresult<false> ReturnService_set_StructReturn_pargs;
47 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::set<::apache::thrift::type_class::structure>, ::std::set<::some::valid::ns::MyStruct>*>> ReturnService_set_StructReturn_presult;
48 typedef apache::thrift::ThriftPresult<false> ReturnService_unionReturn_pargs;
49 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::variant, ::some::valid::ns::ComplexUnion*>> ReturnService_unionReturn_presult;
50 typedef apache::thrift::ThriftPresult<false> ReturnService_list_UnionReturn_pargs;
51 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::list<::apache::thrift::type_class::variant>, ::std::vector<::some::valid::ns::ComplexUnion>*>> ReturnService_list_UnionReturn_presult;
52 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::integral, ::std::int64_t*>> ReturnService_readDataEb_pargs;
53 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::binary, ::some::valid::ns::IOBuf*>> ReturnService_readDataEb_presult;
54 typedef apache::thrift::ThriftPresult<false, apache::thrift::FieldData<1, ::apache::thrift::type_class::integral, ::std::int64_t*>> ReturnService_readData_pargs;
55 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::binary, ::some::valid::ns::IOBufPtr*>> ReturnService_readData_presult;
56 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_noReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)57 void ReturnServiceAsyncProcessor::setUpAndProcess_noReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
58 if (!setUpRequestProcessing(req, ctx, eb, nullptr, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
59 return;
60 }
61 process_noReturn<ProtocolIn_, ProtocolOut_>(std::move(req), std::move(serializedRequest), ctx, eb, tm);
62 }
63
64 template <typename ProtocolIn_, typename ProtocolOut_>
process_noReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)65 void ReturnServiceAsyncProcessor::process_noReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
66 if (!req->getShouldStartProcessing()) {
67 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
68 return;
69 }
70 // make sure getRequestContext is null
71 // so async calls don't accidentally use it
72 iface_->setRequestContext(nullptr);
73 ReturnService_noReturn_pargs args;
74 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.noReturn", ctx));
75 try {
76 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
77 }
78 catch (const std::exception& ex) {
79 folly::exception_wrapper ew(std::current_exception(), ex);
80 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
81 ew, std::move(req), ctx, eb, "noReturn");
82 return;
83 }
84 auto callback = std::make_unique<apache::thrift::HandlerCallback<void>>(std::move(req), std::move(ctxStack), return_noReturn<ProtocolIn_,ProtocolOut_>, throw_wrapped_noReturn<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
85 iface_->async_eb_noReturn(std::move(callback));
86 }
87
88 template <class ProtocolIn_, class ProtocolOut_>
return_noReturn(apache::thrift::ContextStack * ctx)89 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_noReturn(apache::thrift::ContextStack* ctx) {
90 ProtocolOut_ prot;
91 ReturnService_noReturn_presult result;
92 return serializeResponse(&prot, ctx, result);
93 }
94
95 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_noReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)96 void ReturnServiceAsyncProcessor::throw_wrapped_noReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
97 if (!ew) {
98 return;
99 }
100 {
101 (void)protoSeqId;
102 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
103 ew, std::move(req), reqCtx, ctx, "noReturn");
104 return;
105 }
106 }
107
108 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_boolReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)109 void ReturnServiceAsyncProcessor::setUpAndProcess_boolReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
110 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
111 return;
112 }
113 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
114 ctx->setRequestExecutionScope(std::move(scope));
115 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &ReturnServiceAsyncProcessor::process_boolReturn<ProtocolIn_, ProtocolOut_>, this);
116 }
117
118 template <typename ProtocolIn_, typename ProtocolOut_>
process_boolReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)119 void ReturnServiceAsyncProcessor::process_boolReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
120 if (!req->getShouldStartProcessing()) {
121 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
122 return;
123 }
124 // make sure getRequestContext is null
125 // so async calls don't accidentally use it
126 iface_->setRequestContext(nullptr);
127 ReturnService_boolReturn_pargs args;
128 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.boolReturn", ctx));
129 try {
130 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
131 }
132 catch (const std::exception& ex) {
133 folly::exception_wrapper ew(std::current_exception(), ex);
134 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
135 ew, std::move(req), ctx, eb, "boolReturn");
136 return;
137 }
138 auto callback = std::make_unique<apache::thrift::HandlerCallback<bool>>(std::move(req), std::move(ctxStack), return_boolReturn<ProtocolIn_,ProtocolOut_>, throw_wrapped_boolReturn<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
139 iface_->async_tm_boolReturn(std::move(callback));
140 }
141
142 template <class ProtocolIn_, class ProtocolOut_>
return_boolReturn(apache::thrift::ContextStack * ctx,bool const & _return)143 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_boolReturn(apache::thrift::ContextStack* ctx, bool const& _return) {
144 ProtocolOut_ prot;
145 ReturnService_boolReturn_presult result;
146 result.get<0>().value = const_cast<bool*>(&_return);
147 result.setIsSet(0, true);
148 return serializeResponse(&prot, ctx, result);
149 }
150
151 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_boolReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)152 void ReturnServiceAsyncProcessor::throw_wrapped_boolReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
153 if (!ew) {
154 return;
155 }
156 {
157 (void)protoSeqId;
158 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
159 ew, std::move(req), reqCtx, ctx, "boolReturn");
160 return;
161 }
162 }
163
164 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_i16Return(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)165 void ReturnServiceAsyncProcessor::setUpAndProcess_i16Return(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
166 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
167 return;
168 }
169 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
170 ctx->setRequestExecutionScope(std::move(scope));
171 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &ReturnServiceAsyncProcessor::process_i16Return<ProtocolIn_, ProtocolOut_>, this);
172 }
173
174 template <typename ProtocolIn_, typename ProtocolOut_>
process_i16Return(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)175 void ReturnServiceAsyncProcessor::process_i16Return(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
176 if (!req->getShouldStartProcessing()) {
177 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
178 return;
179 }
180 // make sure getRequestContext is null
181 // so async calls don't accidentally use it
182 iface_->setRequestContext(nullptr);
183 ReturnService_i16Return_pargs args;
184 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.i16Return", ctx));
185 try {
186 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
187 }
188 catch (const std::exception& ex) {
189 folly::exception_wrapper ew(std::current_exception(), ex);
190 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
191 ew, std::move(req), ctx, eb, "i16Return");
192 return;
193 }
194 auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int16_t>>(std::move(req), std::move(ctxStack), return_i16Return<ProtocolIn_,ProtocolOut_>, throw_wrapped_i16Return<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
195 iface_->async_tm_i16Return(std::move(callback));
196 }
197
198 template <class ProtocolIn_, class ProtocolOut_>
return_i16Return(apache::thrift::ContextStack * ctx,::std::int16_t const & _return)199 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_i16Return(apache::thrift::ContextStack* ctx, ::std::int16_t const& _return) {
200 ProtocolOut_ prot;
201 ReturnService_i16Return_presult result;
202 result.get<0>().value = const_cast<::std::int16_t*>(&_return);
203 result.setIsSet(0, true);
204 return serializeResponse(&prot, ctx, result);
205 }
206
207 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_i16Return(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)208 void ReturnServiceAsyncProcessor::throw_wrapped_i16Return(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
209 if (!ew) {
210 return;
211 }
212 {
213 (void)protoSeqId;
214 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
215 ew, std::move(req), reqCtx, ctx, "i16Return");
216 return;
217 }
218 }
219
220 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_i32Return(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)221 void ReturnServiceAsyncProcessor::setUpAndProcess_i32Return(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
222 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
223 return;
224 }
225 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
226 ctx->setRequestExecutionScope(std::move(scope));
227 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &ReturnServiceAsyncProcessor::process_i32Return<ProtocolIn_, ProtocolOut_>, this);
228 }
229
230 template <typename ProtocolIn_, typename ProtocolOut_>
process_i32Return(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)231 void ReturnServiceAsyncProcessor::process_i32Return(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
232 if (!req->getShouldStartProcessing()) {
233 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
234 return;
235 }
236 // make sure getRequestContext is null
237 // so async calls don't accidentally use it
238 iface_->setRequestContext(nullptr);
239 ReturnService_i32Return_pargs args;
240 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.i32Return", ctx));
241 try {
242 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
243 }
244 catch (const std::exception& ex) {
245 folly::exception_wrapper ew(std::current_exception(), ex);
246 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
247 ew, std::move(req), ctx, eb, "i32Return");
248 return;
249 }
250 auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int32_t>>(std::move(req), std::move(ctxStack), return_i32Return<ProtocolIn_,ProtocolOut_>, throw_wrapped_i32Return<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
251 iface_->async_tm_i32Return(std::move(callback));
252 }
253
254 template <class ProtocolIn_, class ProtocolOut_>
return_i32Return(apache::thrift::ContextStack * ctx,::std::int32_t const & _return)255 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_i32Return(apache::thrift::ContextStack* ctx, ::std::int32_t const& _return) {
256 ProtocolOut_ prot;
257 ReturnService_i32Return_presult result;
258 result.get<0>().value = const_cast<::std::int32_t*>(&_return);
259 result.setIsSet(0, true);
260 return serializeResponse(&prot, ctx, result);
261 }
262
263 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_i32Return(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)264 void ReturnServiceAsyncProcessor::throw_wrapped_i32Return(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
265 if (!ew) {
266 return;
267 }
268 {
269 (void)protoSeqId;
270 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
271 ew, std::move(req), reqCtx, ctx, "i32Return");
272 return;
273 }
274 }
275
276 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_i64Return(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)277 void ReturnServiceAsyncProcessor::setUpAndProcess_i64Return(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
278 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
279 return;
280 }
281 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
282 ctx->setRequestExecutionScope(std::move(scope));
283 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &ReturnServiceAsyncProcessor::process_i64Return<ProtocolIn_, ProtocolOut_>, this);
284 }
285
286 template <typename ProtocolIn_, typename ProtocolOut_>
process_i64Return(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)287 void ReturnServiceAsyncProcessor::process_i64Return(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
288 if (!req->getShouldStartProcessing()) {
289 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
290 return;
291 }
292 // make sure getRequestContext is null
293 // so async calls don't accidentally use it
294 iface_->setRequestContext(nullptr);
295 ReturnService_i64Return_pargs args;
296 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.i64Return", ctx));
297 try {
298 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
299 }
300 catch (const std::exception& ex) {
301 folly::exception_wrapper ew(std::current_exception(), ex);
302 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
303 ew, std::move(req), ctx, eb, "i64Return");
304 return;
305 }
306 auto callback = std::make_unique<apache::thrift::HandlerCallback<::std::int64_t>>(std::move(req), std::move(ctxStack), return_i64Return<ProtocolIn_,ProtocolOut_>, throw_wrapped_i64Return<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
307 iface_->async_tm_i64Return(std::move(callback));
308 }
309
310 template <class ProtocolIn_, class ProtocolOut_>
return_i64Return(apache::thrift::ContextStack * ctx,::std::int64_t const & _return)311 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_i64Return(apache::thrift::ContextStack* ctx, ::std::int64_t const& _return) {
312 ProtocolOut_ prot;
313 ReturnService_i64Return_presult result;
314 result.get<0>().value = const_cast<::std::int64_t*>(&_return);
315 result.setIsSet(0, true);
316 return serializeResponse(&prot, ctx, result);
317 }
318
319 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_i64Return(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)320 void ReturnServiceAsyncProcessor::throw_wrapped_i64Return(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
321 if (!ew) {
322 return;
323 }
324 {
325 (void)protoSeqId;
326 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
327 ew, std::move(req), reqCtx, ctx, "i64Return");
328 return;
329 }
330 }
331
332 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_floatReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)333 void ReturnServiceAsyncProcessor::setUpAndProcess_floatReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
334 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
335 return;
336 }
337 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
338 ctx->setRequestExecutionScope(std::move(scope));
339 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &ReturnServiceAsyncProcessor::process_floatReturn<ProtocolIn_, ProtocolOut_>, this);
340 }
341
342 template <typename ProtocolIn_, typename ProtocolOut_>
process_floatReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)343 void ReturnServiceAsyncProcessor::process_floatReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
344 if (!req->getShouldStartProcessing()) {
345 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
346 return;
347 }
348 // make sure getRequestContext is null
349 // so async calls don't accidentally use it
350 iface_->setRequestContext(nullptr);
351 ReturnService_floatReturn_pargs args;
352 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.floatReturn", ctx));
353 try {
354 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
355 }
356 catch (const std::exception& ex) {
357 folly::exception_wrapper ew(std::current_exception(), ex);
358 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
359 ew, std::move(req), ctx, eb, "floatReturn");
360 return;
361 }
362 auto callback = std::make_unique<apache::thrift::HandlerCallback<float>>(std::move(req), std::move(ctxStack), return_floatReturn<ProtocolIn_,ProtocolOut_>, throw_wrapped_floatReturn<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
363 iface_->async_tm_floatReturn(std::move(callback));
364 }
365
366 template <class ProtocolIn_, class ProtocolOut_>
return_floatReturn(apache::thrift::ContextStack * ctx,float const & _return)367 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_floatReturn(apache::thrift::ContextStack* ctx, float const& _return) {
368 ProtocolOut_ prot;
369 ReturnService_floatReturn_presult result;
370 result.get<0>().value = const_cast<float*>(&_return);
371 result.setIsSet(0, true);
372 return serializeResponse(&prot, ctx, result);
373 }
374
375 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_floatReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)376 void ReturnServiceAsyncProcessor::throw_wrapped_floatReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
377 if (!ew) {
378 return;
379 }
380 {
381 (void)protoSeqId;
382 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
383 ew, std::move(req), reqCtx, ctx, "floatReturn");
384 return;
385 }
386 }
387
388 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_doubleReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)389 void ReturnServiceAsyncProcessor::setUpAndProcess_doubleReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
390 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
391 return;
392 }
393 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
394 ctx->setRequestExecutionScope(std::move(scope));
395 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &ReturnServiceAsyncProcessor::process_doubleReturn<ProtocolIn_, ProtocolOut_>, this);
396 }
397
398 template <typename ProtocolIn_, typename ProtocolOut_>
process_doubleReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)399 void ReturnServiceAsyncProcessor::process_doubleReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
400 if (!req->getShouldStartProcessing()) {
401 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
402 return;
403 }
404 // make sure getRequestContext is null
405 // so async calls don't accidentally use it
406 iface_->setRequestContext(nullptr);
407 ReturnService_doubleReturn_pargs args;
408 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.doubleReturn", ctx));
409 try {
410 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
411 }
412 catch (const std::exception& ex) {
413 folly::exception_wrapper ew(std::current_exception(), ex);
414 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
415 ew, std::move(req), ctx, eb, "doubleReturn");
416 return;
417 }
418 auto callback = std::make_unique<apache::thrift::HandlerCallback<double>>(std::move(req), std::move(ctxStack), return_doubleReturn<ProtocolIn_,ProtocolOut_>, throw_wrapped_doubleReturn<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
419 iface_->async_tm_doubleReturn(std::move(callback));
420 }
421
422 template <class ProtocolIn_, class ProtocolOut_>
return_doubleReturn(apache::thrift::ContextStack * ctx,double const & _return)423 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_doubleReturn(apache::thrift::ContextStack* ctx, double const& _return) {
424 ProtocolOut_ prot;
425 ReturnService_doubleReturn_presult result;
426 result.get<0>().value = const_cast<double*>(&_return);
427 result.setIsSet(0, true);
428 return serializeResponse(&prot, ctx, result);
429 }
430
431 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_doubleReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)432 void ReturnServiceAsyncProcessor::throw_wrapped_doubleReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
433 if (!ew) {
434 return;
435 }
436 {
437 (void)protoSeqId;
438 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
439 ew, std::move(req), reqCtx, ctx, "doubleReturn");
440 return;
441 }
442 }
443
444 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_stringReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)445 void ReturnServiceAsyncProcessor::setUpAndProcess_stringReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
446 if (!setUpRequestProcessing(req, ctx, eb, nullptr, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
447 return;
448 }
449 process_stringReturn<ProtocolIn_, ProtocolOut_>(std::move(req), std::move(serializedRequest), ctx, eb, tm);
450 }
451
452 template <typename ProtocolIn_, typename ProtocolOut_>
process_stringReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)453 void ReturnServiceAsyncProcessor::process_stringReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
454 if (!req->getShouldStartProcessing()) {
455 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
456 return;
457 }
458 // make sure getRequestContext is null
459 // so async calls don't accidentally use it
460 iface_->setRequestContext(nullptr);
461 ReturnService_stringReturn_pargs args;
462 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.stringReturn", ctx));
463 try {
464 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
465 }
466 catch (const std::exception& ex) {
467 folly::exception_wrapper ew(std::current_exception(), ex);
468 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
469 ew, std::move(req), ctx, eb, "stringReturn");
470 return;
471 }
472 auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::string>>>(std::move(req), std::move(ctxStack), return_stringReturn<ProtocolIn_,ProtocolOut_>, throw_wrapped_stringReturn<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
473 iface_->async_eb_stringReturn(std::move(callback));
474 }
475
476 template <class ProtocolIn_, class ProtocolOut_>
return_stringReturn(apache::thrift::ContextStack * ctx,::std::string const & _return)477 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_stringReturn(apache::thrift::ContextStack* ctx, ::std::string const& _return) {
478 ProtocolOut_ prot;
479 ReturnService_stringReturn_presult result;
480 result.get<0>().value = const_cast<::std::string*>(&_return);
481 result.setIsSet(0, true);
482 return serializeResponse(&prot, ctx, result);
483 }
484
485 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_stringReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)486 void ReturnServiceAsyncProcessor::throw_wrapped_stringReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
487 if (!ew) {
488 return;
489 }
490 {
491 (void)protoSeqId;
492 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
493 ew, std::move(req), reqCtx, ctx, "stringReturn");
494 return;
495 }
496 }
497
498 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_binaryReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)499 void ReturnServiceAsyncProcessor::setUpAndProcess_binaryReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
500 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
501 return;
502 }
503 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
504 ctx->setRequestExecutionScope(std::move(scope));
505 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &ReturnServiceAsyncProcessor::process_binaryReturn<ProtocolIn_, ProtocolOut_>, this);
506 }
507
508 template <typename ProtocolIn_, typename ProtocolOut_>
process_binaryReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)509 void ReturnServiceAsyncProcessor::process_binaryReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
510 if (!req->getShouldStartProcessing()) {
511 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
512 return;
513 }
514 // make sure getRequestContext is null
515 // so async calls don't accidentally use it
516 iface_->setRequestContext(nullptr);
517 ReturnService_binaryReturn_pargs args;
518 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.binaryReturn", ctx));
519 try {
520 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
521 }
522 catch (const std::exception& ex) {
523 folly::exception_wrapper ew(std::current_exception(), ex);
524 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
525 ew, std::move(req), ctx, eb, "binaryReturn");
526 return;
527 }
528 auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::string>>>(std::move(req), std::move(ctxStack), return_binaryReturn<ProtocolIn_,ProtocolOut_>, throw_wrapped_binaryReturn<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
529 iface_->async_tm_binaryReturn(std::move(callback));
530 }
531
532 template <class ProtocolIn_, class ProtocolOut_>
return_binaryReturn(apache::thrift::ContextStack * ctx,::std::string const & _return)533 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_binaryReturn(apache::thrift::ContextStack* ctx, ::std::string const& _return) {
534 ProtocolOut_ prot;
535 ReturnService_binaryReturn_presult result;
536 result.get<0>().value = const_cast<::std::string*>(&_return);
537 result.setIsSet(0, true);
538 return serializeResponse(&prot, ctx, result);
539 }
540
541 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_binaryReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)542 void ReturnServiceAsyncProcessor::throw_wrapped_binaryReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
543 if (!ew) {
544 return;
545 }
546 {
547 (void)protoSeqId;
548 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
549 ew, std::move(req), reqCtx, ctx, "binaryReturn");
550 return;
551 }
552 }
553
554 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_mapReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)555 void ReturnServiceAsyncProcessor::setUpAndProcess_mapReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
556 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
557 return;
558 }
559 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
560 ctx->setRequestExecutionScope(std::move(scope));
561 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &ReturnServiceAsyncProcessor::process_mapReturn<ProtocolIn_, ProtocolOut_>, this);
562 }
563
564 template <typename ProtocolIn_, typename ProtocolOut_>
process_mapReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)565 void ReturnServiceAsyncProcessor::process_mapReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
566 if (!req->getShouldStartProcessing()) {
567 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
568 return;
569 }
570 // make sure getRequestContext is null
571 // so async calls don't accidentally use it
572 iface_->setRequestContext(nullptr);
573 ReturnService_mapReturn_pargs args;
574 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.mapReturn", ctx));
575 try {
576 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
577 }
578 catch (const std::exception& ex) {
579 folly::exception_wrapper ew(std::current_exception(), ex);
580 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
581 ew, std::move(req), ctx, eb, "mapReturn");
582 return;
583 }
584 auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::map<::std::string, ::std::int64_t>>>>(std::move(req), std::move(ctxStack), return_mapReturn<ProtocolIn_,ProtocolOut_>, throw_wrapped_mapReturn<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
585 iface_->async_tm_mapReturn(std::move(callback));
586 }
587
588 template <class ProtocolIn_, class ProtocolOut_>
return_mapReturn(apache::thrift::ContextStack * ctx,::std::map<::std::string,::std::int64_t> const & _return)589 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_mapReturn(apache::thrift::ContextStack* ctx, ::std::map<::std::string, ::std::int64_t> const& _return) {
590 ProtocolOut_ prot;
591 ReturnService_mapReturn_presult result;
592 result.get<0>().value = const_cast<::std::map<::std::string, ::std::int64_t>*>(&_return);
593 result.setIsSet(0, true);
594 return serializeResponse(&prot, ctx, result);
595 }
596
597 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_mapReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)598 void ReturnServiceAsyncProcessor::throw_wrapped_mapReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
599 if (!ew) {
600 return;
601 }
602 {
603 (void)protoSeqId;
604 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
605 ew, std::move(req), reqCtx, ctx, "mapReturn");
606 return;
607 }
608 }
609
610 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_simpleTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)611 void ReturnServiceAsyncProcessor::setUpAndProcess_simpleTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
612 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
613 return;
614 }
615 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
616 ctx->setRequestExecutionScope(std::move(scope));
617 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &ReturnServiceAsyncProcessor::process_simpleTypedefReturn<ProtocolIn_, ProtocolOut_>, this);
618 }
619
620 template <typename ProtocolIn_, typename ProtocolOut_>
process_simpleTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)621 void ReturnServiceAsyncProcessor::process_simpleTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
622 if (!req->getShouldStartProcessing()) {
623 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
624 return;
625 }
626 // make sure getRequestContext is null
627 // so async calls don't accidentally use it
628 iface_->setRequestContext(nullptr);
629 ReturnService_simpleTypedefReturn_pargs args;
630 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.simpleTypedefReturn", ctx));
631 try {
632 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
633 }
634 catch (const std::exception& ex) {
635 folly::exception_wrapper ew(std::current_exception(), ex);
636 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
637 ew, std::move(req), ctx, eb, "simpleTypedefReturn");
638 return;
639 }
640 auto callback = std::make_unique<apache::thrift::HandlerCallback<::some::valid::ns::simpleTypeDef>>(std::move(req), std::move(ctxStack), return_simpleTypedefReturn<ProtocolIn_,ProtocolOut_>, throw_wrapped_simpleTypedefReturn<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
641 iface_->async_tm_simpleTypedefReturn(std::move(callback));
642 }
643
644 template <class ProtocolIn_, class ProtocolOut_>
return_simpleTypedefReturn(apache::thrift::ContextStack * ctx,::some::valid::ns::simpleTypeDef const & _return)645 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_simpleTypedefReturn(apache::thrift::ContextStack* ctx, ::some::valid::ns::simpleTypeDef const& _return) {
646 ProtocolOut_ prot;
647 ReturnService_simpleTypedefReturn_presult result;
648 result.get<0>().value = const_cast<::some::valid::ns::simpleTypeDef*>(&_return);
649 result.setIsSet(0, true);
650 return serializeResponse(&prot, ctx, result);
651 }
652
653 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_simpleTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)654 void ReturnServiceAsyncProcessor::throw_wrapped_simpleTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
655 if (!ew) {
656 return;
657 }
658 {
659 (void)protoSeqId;
660 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
661 ew, std::move(req), reqCtx, ctx, "simpleTypedefReturn");
662 return;
663 }
664 }
665
666 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_complexTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)667 void ReturnServiceAsyncProcessor::setUpAndProcess_complexTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
668 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
669 return;
670 }
671 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
672 ctx->setRequestExecutionScope(std::move(scope));
673 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &ReturnServiceAsyncProcessor::process_complexTypedefReturn<ProtocolIn_, ProtocolOut_>, this);
674 }
675
676 template <typename ProtocolIn_, typename ProtocolOut_>
process_complexTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)677 void ReturnServiceAsyncProcessor::process_complexTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
678 if (!req->getShouldStartProcessing()) {
679 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
680 return;
681 }
682 // make sure getRequestContext is null
683 // so async calls don't accidentally use it
684 iface_->setRequestContext(nullptr);
685 ReturnService_complexTypedefReturn_pargs args;
686 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.complexTypedefReturn", ctx));
687 try {
688 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
689 }
690 catch (const std::exception& ex) {
691 folly::exception_wrapper ew(std::current_exception(), ex);
692 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
693 ew, std::move(req), ctx, eb, "complexTypedefReturn");
694 return;
695 }
696 auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::some::valid::ns::complexStructTypeDef>>>(std::move(req), std::move(ctxStack), return_complexTypedefReturn<ProtocolIn_,ProtocolOut_>, throw_wrapped_complexTypedefReturn<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
697 iface_->async_tm_complexTypedefReturn(std::move(callback));
698 }
699
700 template <class ProtocolIn_, class ProtocolOut_>
return_complexTypedefReturn(apache::thrift::ContextStack * ctx,::some::valid::ns::complexStructTypeDef const & _return)701 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_complexTypedefReturn(apache::thrift::ContextStack* ctx, ::some::valid::ns::complexStructTypeDef const& _return) {
702 ProtocolOut_ prot;
703 ReturnService_complexTypedefReturn_presult result;
704 result.get<0>().value = const_cast<::some::valid::ns::complexStructTypeDef*>(&_return);
705 result.setIsSet(0, true);
706 return serializeResponse(&prot, ctx, result);
707 }
708
709 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_complexTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)710 void ReturnServiceAsyncProcessor::throw_wrapped_complexTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
711 if (!ew) {
712 return;
713 }
714 {
715 (void)protoSeqId;
716 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
717 ew, std::move(req), reqCtx, ctx, "complexTypedefReturn");
718 return;
719 }
720 }
721
722 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_list_mostComplexTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)723 void ReturnServiceAsyncProcessor::setUpAndProcess_list_mostComplexTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
724 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
725 return;
726 }
727 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
728 ctx->setRequestExecutionScope(std::move(scope));
729 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &ReturnServiceAsyncProcessor::process_list_mostComplexTypedefReturn<ProtocolIn_, ProtocolOut_>, this);
730 }
731
732 template <typename ProtocolIn_, typename ProtocolOut_>
process_list_mostComplexTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)733 void ReturnServiceAsyncProcessor::process_list_mostComplexTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
734 if (!req->getShouldStartProcessing()) {
735 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
736 return;
737 }
738 // make sure getRequestContext is null
739 // so async calls don't accidentally use it
740 iface_->setRequestContext(nullptr);
741 ReturnService_list_mostComplexTypedefReturn_pargs args;
742 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.list_mostComplexTypedefReturn", ctx));
743 try {
744 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
745 }
746 catch (const std::exception& ex) {
747 folly::exception_wrapper ew(std::current_exception(), ex);
748 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
749 ew, std::move(req), ctx, eb, "list_mostComplexTypedefReturn");
750 return;
751 }
752 auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::vector<::some::valid::ns::mostComplexTypeDef>>>>(std::move(req), std::move(ctxStack), return_list_mostComplexTypedefReturn<ProtocolIn_,ProtocolOut_>, throw_wrapped_list_mostComplexTypedefReturn<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
753 iface_->async_tm_list_mostComplexTypedefReturn(std::move(callback));
754 }
755
756 template <class ProtocolIn_, class ProtocolOut_>
return_list_mostComplexTypedefReturn(apache::thrift::ContextStack * ctx,::std::vector<::some::valid::ns::mostComplexTypeDef> const & _return)757 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_list_mostComplexTypedefReturn(apache::thrift::ContextStack* ctx, ::std::vector<::some::valid::ns::mostComplexTypeDef> const& _return) {
758 ProtocolOut_ prot;
759 ReturnService_list_mostComplexTypedefReturn_presult result;
760 result.get<0>().value = const_cast<::std::vector<::some::valid::ns::mostComplexTypeDef>*>(&_return);
761 result.setIsSet(0, true);
762 return serializeResponse(&prot, ctx, result);
763 }
764
765 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_list_mostComplexTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)766 void ReturnServiceAsyncProcessor::throw_wrapped_list_mostComplexTypedefReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
767 if (!ew) {
768 return;
769 }
770 {
771 (void)protoSeqId;
772 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
773 ew, std::move(req), reqCtx, ctx, "list_mostComplexTypedefReturn");
774 return;
775 }
776 }
777
778 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_enumReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)779 void ReturnServiceAsyncProcessor::setUpAndProcess_enumReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
780 if (!setUpRequestProcessing(req, ctx, eb, nullptr, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
781 return;
782 }
783 process_enumReturn<ProtocolIn_, ProtocolOut_>(std::move(req), std::move(serializedRequest), ctx, eb, tm);
784 }
785
786 template <typename ProtocolIn_, typename ProtocolOut_>
process_enumReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)787 void ReturnServiceAsyncProcessor::process_enumReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
788 if (!req->getShouldStartProcessing()) {
789 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
790 return;
791 }
792 // make sure getRequestContext is null
793 // so async calls don't accidentally use it
794 iface_->setRequestContext(nullptr);
795 ReturnService_enumReturn_pargs args;
796 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.enumReturn", ctx));
797 try {
798 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
799 }
800 catch (const std::exception& ex) {
801 folly::exception_wrapper ew(std::current_exception(), ex);
802 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
803 ew, std::move(req), ctx, eb, "enumReturn");
804 return;
805 }
806 auto callback = std::make_unique<apache::thrift::HandlerCallback<::some::valid::ns::MyEnumA>>(std::move(req), std::move(ctxStack), return_enumReturn<ProtocolIn_,ProtocolOut_>, throw_wrapped_enumReturn<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
807 iface_->async_eb_enumReturn(std::move(callback));
808 }
809
810 template <class ProtocolIn_, class ProtocolOut_>
return_enumReturn(apache::thrift::ContextStack * ctx,::some::valid::ns::MyEnumA const & _return)811 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_enumReturn(apache::thrift::ContextStack* ctx, ::some::valid::ns::MyEnumA const& _return) {
812 ProtocolOut_ prot;
813 ReturnService_enumReturn_presult result;
814 result.get<0>().value = const_cast<::some::valid::ns::MyEnumA*>(&_return);
815 result.setIsSet(0, true);
816 return serializeResponse(&prot, ctx, result);
817 }
818
819 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_enumReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)820 void ReturnServiceAsyncProcessor::throw_wrapped_enumReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
821 if (!ew) {
822 return;
823 }
824 {
825 (void)protoSeqId;
826 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
827 ew, std::move(req), reqCtx, ctx, "enumReturn");
828 return;
829 }
830 }
831
832 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_list_EnumReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)833 void ReturnServiceAsyncProcessor::setUpAndProcess_list_EnumReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
834 if (!setUpRequestProcessing(req, ctx, eb, nullptr, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
835 return;
836 }
837 process_list_EnumReturn<ProtocolIn_, ProtocolOut_>(std::move(req), std::move(serializedRequest), ctx, eb, tm);
838 }
839
840 template <typename ProtocolIn_, typename ProtocolOut_>
process_list_EnumReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)841 void ReturnServiceAsyncProcessor::process_list_EnumReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
842 if (!req->getShouldStartProcessing()) {
843 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
844 return;
845 }
846 // make sure getRequestContext is null
847 // so async calls don't accidentally use it
848 iface_->setRequestContext(nullptr);
849 ReturnService_list_EnumReturn_pargs args;
850 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.list_EnumReturn", ctx));
851 try {
852 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
853 }
854 catch (const std::exception& ex) {
855 folly::exception_wrapper ew(std::current_exception(), ex);
856 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
857 ew, std::move(req), ctx, eb, "list_EnumReturn");
858 return;
859 }
860 auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::vector<::some::valid::ns::MyEnumA>>>>(std::move(req), std::move(ctxStack), return_list_EnumReturn<ProtocolIn_,ProtocolOut_>, throw_wrapped_list_EnumReturn<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
861 iface_->async_eb_list_EnumReturn(std::move(callback));
862 }
863
864 template <class ProtocolIn_, class ProtocolOut_>
return_list_EnumReturn(apache::thrift::ContextStack * ctx,::std::vector<::some::valid::ns::MyEnumA> const & _return)865 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_list_EnumReturn(apache::thrift::ContextStack* ctx, ::std::vector<::some::valid::ns::MyEnumA> const& _return) {
866 ProtocolOut_ prot;
867 ReturnService_list_EnumReturn_presult result;
868 result.get<0>().value = const_cast<::std::vector<::some::valid::ns::MyEnumA>*>(&_return);
869 result.setIsSet(0, true);
870 return serializeResponse(&prot, ctx, result);
871 }
872
873 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_list_EnumReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)874 void ReturnServiceAsyncProcessor::throw_wrapped_list_EnumReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
875 if (!ew) {
876 return;
877 }
878 {
879 (void)protoSeqId;
880 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
881 ew, std::move(req), reqCtx, ctx, "list_EnumReturn");
882 return;
883 }
884 }
885
886 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_structReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)887 void ReturnServiceAsyncProcessor::setUpAndProcess_structReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
888 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
889 return;
890 }
891 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
892 ctx->setRequestExecutionScope(std::move(scope));
893 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &ReturnServiceAsyncProcessor::process_structReturn<ProtocolIn_, ProtocolOut_>, this);
894 }
895
896 template <typename ProtocolIn_, typename ProtocolOut_>
process_structReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)897 void ReturnServiceAsyncProcessor::process_structReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
898 if (!req->getShouldStartProcessing()) {
899 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
900 return;
901 }
902 // make sure getRequestContext is null
903 // so async calls don't accidentally use it
904 iface_->setRequestContext(nullptr);
905 ReturnService_structReturn_pargs args;
906 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.structReturn", ctx));
907 try {
908 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
909 }
910 catch (const std::exception& ex) {
911 folly::exception_wrapper ew(std::current_exception(), ex);
912 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
913 ew, std::move(req), ctx, eb, "structReturn");
914 return;
915 }
916 auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::some::valid::ns::MyStruct>>>(std::move(req), std::move(ctxStack), return_structReturn<ProtocolIn_,ProtocolOut_>, throw_wrapped_structReturn<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
917 iface_->async_tm_structReturn(std::move(callback));
918 }
919
920 template <class ProtocolIn_, class ProtocolOut_>
return_structReturn(apache::thrift::ContextStack * ctx,::some::valid::ns::MyStruct const & _return)921 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_structReturn(apache::thrift::ContextStack* ctx, ::some::valid::ns::MyStruct const& _return) {
922 ProtocolOut_ prot;
923 ReturnService_structReturn_presult result;
924 result.get<0>().value = const_cast<::some::valid::ns::MyStruct*>(&_return);
925 result.setIsSet(0, true);
926 return serializeResponse(&prot, ctx, result);
927 }
928
929 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_structReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)930 void ReturnServiceAsyncProcessor::throw_wrapped_structReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
931 if (!ew) {
932 return;
933 }
934 {
935 (void)protoSeqId;
936 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
937 ew, std::move(req), reqCtx, ctx, "structReturn");
938 return;
939 }
940 }
941
942 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_set_StructReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)943 void ReturnServiceAsyncProcessor::setUpAndProcess_set_StructReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
944 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
945 return;
946 }
947 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
948 ctx->setRequestExecutionScope(std::move(scope));
949 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &ReturnServiceAsyncProcessor::process_set_StructReturn<ProtocolIn_, ProtocolOut_>, this);
950 }
951
952 template <typename ProtocolIn_, typename ProtocolOut_>
process_set_StructReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)953 void ReturnServiceAsyncProcessor::process_set_StructReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
954 if (!req->getShouldStartProcessing()) {
955 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
956 return;
957 }
958 // make sure getRequestContext is null
959 // so async calls don't accidentally use it
960 iface_->setRequestContext(nullptr);
961 ReturnService_set_StructReturn_pargs args;
962 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.set_StructReturn", ctx));
963 try {
964 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
965 }
966 catch (const std::exception& ex) {
967 folly::exception_wrapper ew(std::current_exception(), ex);
968 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
969 ew, std::move(req), ctx, eb, "set_StructReturn");
970 return;
971 }
972 auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::set<::some::valid::ns::MyStruct>>>>(std::move(req), std::move(ctxStack), return_set_StructReturn<ProtocolIn_,ProtocolOut_>, throw_wrapped_set_StructReturn<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
973 iface_->async_tm_set_StructReturn(std::move(callback));
974 }
975
976 template <class ProtocolIn_, class ProtocolOut_>
return_set_StructReturn(apache::thrift::ContextStack * ctx,::std::set<::some::valid::ns::MyStruct> const & _return)977 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_set_StructReturn(apache::thrift::ContextStack* ctx, ::std::set<::some::valid::ns::MyStruct> const& _return) {
978 ProtocolOut_ prot;
979 ReturnService_set_StructReturn_presult result;
980 result.get<0>().value = const_cast<::std::set<::some::valid::ns::MyStruct>*>(&_return);
981 result.setIsSet(0, true);
982 return serializeResponse(&prot, ctx, result);
983 }
984
985 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_set_StructReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)986 void ReturnServiceAsyncProcessor::throw_wrapped_set_StructReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
987 if (!ew) {
988 return;
989 }
990 {
991 (void)protoSeqId;
992 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
993 ew, std::move(req), reqCtx, ctx, "set_StructReturn");
994 return;
995 }
996 }
997
998 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_unionReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)999 void ReturnServiceAsyncProcessor::setUpAndProcess_unionReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1000 if (!setUpRequestProcessing(req, ctx, eb, nullptr, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1001 return;
1002 }
1003 process_unionReturn<ProtocolIn_, ProtocolOut_>(std::move(req), std::move(serializedRequest), ctx, eb, tm);
1004 }
1005
1006 template <typename ProtocolIn_, typename ProtocolOut_>
process_unionReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1007 void ReturnServiceAsyncProcessor::process_unionReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1008 if (!req->getShouldStartProcessing()) {
1009 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1010 return;
1011 }
1012 // make sure getRequestContext is null
1013 // so async calls don't accidentally use it
1014 iface_->setRequestContext(nullptr);
1015 ReturnService_unionReturn_pargs args;
1016 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.unionReturn", ctx));
1017 try {
1018 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1019 }
1020 catch (const std::exception& ex) {
1021 folly::exception_wrapper ew(std::current_exception(), ex);
1022 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1023 ew, std::move(req), ctx, eb, "unionReturn");
1024 return;
1025 }
1026 auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::some::valid::ns::ComplexUnion>>>(std::move(req), std::move(ctxStack), return_unionReturn<ProtocolIn_,ProtocolOut_>, throw_wrapped_unionReturn<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1027 iface_->async_eb_unionReturn(std::move(callback));
1028 }
1029
1030 template <class ProtocolIn_, class ProtocolOut_>
return_unionReturn(apache::thrift::ContextStack * ctx,::some::valid::ns::ComplexUnion const & _return)1031 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_unionReturn(apache::thrift::ContextStack* ctx, ::some::valid::ns::ComplexUnion const& _return) {
1032 ProtocolOut_ prot;
1033 ReturnService_unionReturn_presult result;
1034 result.get<0>().value = const_cast<::some::valid::ns::ComplexUnion*>(&_return);
1035 result.setIsSet(0, true);
1036 return serializeResponse(&prot, ctx, result);
1037 }
1038
1039 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_unionReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1040 void ReturnServiceAsyncProcessor::throw_wrapped_unionReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1041 if (!ew) {
1042 return;
1043 }
1044 {
1045 (void)protoSeqId;
1046 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1047 ew, std::move(req), reqCtx, ctx, "unionReturn");
1048 return;
1049 }
1050 }
1051
1052 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_list_UnionReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1053 void ReturnServiceAsyncProcessor::setUpAndProcess_list_UnionReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1054 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1055 return;
1056 }
1057 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1058 ctx->setRequestExecutionScope(std::move(scope));
1059 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &ReturnServiceAsyncProcessor::process_list_UnionReturn<ProtocolIn_, ProtocolOut_>, this);
1060 }
1061
1062 template <typename ProtocolIn_, typename ProtocolOut_>
process_list_UnionReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1063 void ReturnServiceAsyncProcessor::process_list_UnionReturn(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1064 if (!req->getShouldStartProcessing()) {
1065 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1066 return;
1067 }
1068 // make sure getRequestContext is null
1069 // so async calls don't accidentally use it
1070 iface_->setRequestContext(nullptr);
1071 ReturnService_list_UnionReturn_pargs args;
1072 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.list_UnionReturn", ctx));
1073 try {
1074 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1075 }
1076 catch (const std::exception& ex) {
1077 folly::exception_wrapper ew(std::current_exception(), ex);
1078 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1079 ew, std::move(req), ctx, eb, "list_UnionReturn");
1080 return;
1081 }
1082 auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::std::vector<::some::valid::ns::ComplexUnion>>>>(std::move(req), std::move(ctxStack), return_list_UnionReturn<ProtocolIn_,ProtocolOut_>, throw_wrapped_list_UnionReturn<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1083 iface_->async_tm_list_UnionReturn(std::move(callback));
1084 }
1085
1086 template <class ProtocolIn_, class ProtocolOut_>
return_list_UnionReturn(apache::thrift::ContextStack * ctx,::std::vector<::some::valid::ns::ComplexUnion> const & _return)1087 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_list_UnionReturn(apache::thrift::ContextStack* ctx, ::std::vector<::some::valid::ns::ComplexUnion> const& _return) {
1088 ProtocolOut_ prot;
1089 ReturnService_list_UnionReturn_presult result;
1090 result.get<0>().value = const_cast<::std::vector<::some::valid::ns::ComplexUnion>*>(&_return);
1091 result.setIsSet(0, true);
1092 return serializeResponse(&prot, ctx, result);
1093 }
1094
1095 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_list_UnionReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1096 void ReturnServiceAsyncProcessor::throw_wrapped_list_UnionReturn(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1097 if (!ew) {
1098 return;
1099 }
1100 {
1101 (void)protoSeqId;
1102 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1103 ew, std::move(req), reqCtx, ctx, "list_UnionReturn");
1104 return;
1105 }
1106 }
1107
1108 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_readDataEb(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1109 void ReturnServiceAsyncProcessor::setUpAndProcess_readDataEb(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1110 if (!setUpRequestProcessing(req, ctx, eb, nullptr, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1111 return;
1112 }
1113 process_readDataEb<ProtocolIn_, ProtocolOut_>(std::move(req), std::move(serializedRequest), ctx, eb, tm);
1114 }
1115
1116 template <typename ProtocolIn_, typename ProtocolOut_>
process_readDataEb(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1117 void ReturnServiceAsyncProcessor::process_readDataEb(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1118 if (!req->getShouldStartProcessing()) {
1119 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1120 return;
1121 }
1122 // make sure getRequestContext is null
1123 // so async calls don't accidentally use it
1124 iface_->setRequestContext(nullptr);
1125 ReturnService_readDataEb_pargs args;
1126 ::std::int64_t uarg_size{0};
1127 args.get<0>().value = &uarg_size;
1128 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.readDataEb", ctx));
1129 try {
1130 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1131 }
1132 catch (const std::exception& ex) {
1133 folly::exception_wrapper ew(std::current_exception(), ex);
1134 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1135 ew, std::move(req), ctx, eb, "readDataEb");
1136 return;
1137 }
1138 auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::some::valid::ns::IOBuf>>>(std::move(req), std::move(ctxStack), return_readDataEb<ProtocolIn_,ProtocolOut_>, throw_wrapped_readDataEb<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1139 iface_->async_eb_readDataEb(std::move(callback), args.get<0>().ref());
1140 }
1141
1142 template <class ProtocolIn_, class ProtocolOut_>
return_readDataEb(apache::thrift::ContextStack * ctx,::some::valid::ns::IOBuf const & _return)1143 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_readDataEb(apache::thrift::ContextStack* ctx, ::some::valid::ns::IOBuf const& _return) {
1144 ProtocolOut_ prot;
1145 ReturnService_readDataEb_presult result;
1146 result.get<0>().value = const_cast<::some::valid::ns::IOBuf*>(&_return);
1147 result.setIsSet(0, true);
1148 return serializeResponse(&prot, ctx, result);
1149 }
1150
1151 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_readDataEb(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1152 void ReturnServiceAsyncProcessor::throw_wrapped_readDataEb(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1153 if (!ew) {
1154 return;
1155 }
1156 {
1157 (void)protoSeqId;
1158 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1159 ew, std::move(req), reqCtx, ctx, "readDataEb");
1160 return;
1161 }
1162 }
1163
1164 template <typename ProtocolIn_, typename ProtocolOut_>
setUpAndProcess_readData(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1165 void ReturnServiceAsyncProcessor::setUpAndProcess_readData(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1166 if (!setUpRequestProcessing(req, ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, iface_)) {
1167 return;
1168 }
1169 auto scope = iface_->getRequestExecutionScope(ctx, apache::thrift::concurrency::NORMAL);
1170 ctx->setRequestExecutionScope(std::move(scope));
1171 processInThread(std::move(req), std::move(serializedRequest), ctx, eb, tm, apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, &ReturnServiceAsyncProcessor::process_readData<ProtocolIn_, ProtocolOut_>, this);
1172 }
1173
1174 template <typename ProtocolIn_, typename ProtocolOut_>
process_readData(apache::thrift::ResponseChannelRequest::UniquePtr req,apache::thrift::SerializedCompressedRequest && serializedRequest,apache::thrift::Cpp2RequestContext * ctx,folly::EventBase * eb,apache::thrift::concurrency::ThreadManager * tm)1175 void ReturnServiceAsyncProcessor::process_readData(apache::thrift::ResponseChannelRequest::UniquePtr req, apache::thrift::SerializedCompressedRequest&& serializedRequest, apache::thrift::Cpp2RequestContext* ctx, folly::EventBase* eb, apache::thrift::concurrency::ThreadManager* tm) {
1176 if (!req->getShouldStartProcessing()) {
1177 apache::thrift::HandlerCallbackBase::releaseRequest(std::move(req), eb);
1178 return;
1179 }
1180 // make sure getRequestContext is null
1181 // so async calls don't accidentally use it
1182 iface_->setRequestContext(nullptr);
1183 ReturnService_readData_pargs args;
1184 ::std::int64_t uarg_size{0};
1185 args.get<0>().value = &uarg_size;
1186 std::unique_ptr<apache::thrift::ContextStack> ctxStack(this->getContextStack(this->getServiceName(), "ReturnService.readData", ctx));
1187 try {
1188 deserializeRequest<ProtocolIn_>(args, ctx->getMethodName(), std::move(serializedRequest).uncompress(), ctxStack.get());
1189 }
1190 catch (const std::exception& ex) {
1191 folly::exception_wrapper ew(std::current_exception(), ex);
1192 apache::thrift::detail::ap::process_handle_exn_deserialization<ProtocolOut_>(
1193 ew, std::move(req), ctx, eb, "readData");
1194 return;
1195 }
1196 auto callback = std::make_unique<apache::thrift::HandlerCallback<std::unique_ptr<::some::valid::ns::IOBufPtr>>>(std::move(req), std::move(ctxStack), return_readData<ProtocolIn_,ProtocolOut_>, throw_wrapped_readData<ProtocolIn_, ProtocolOut_>, ctx->getProtoSeqId(), eb, tm, ctx);
1197 iface_->async_tm_readData(std::move(callback), args.get<0>().ref());
1198 }
1199
1200 template <class ProtocolIn_, class ProtocolOut_>
return_readData(apache::thrift::ContextStack * ctx,::some::valid::ns::IOBufPtr const & _return)1201 apache::thrift::SerializedResponse ReturnServiceAsyncProcessor::return_readData(apache::thrift::ContextStack* ctx, ::some::valid::ns::IOBufPtr const& _return) {
1202 ProtocolOut_ prot;
1203 ReturnService_readData_presult result;
1204 result.get<0>().value = const_cast<::some::valid::ns::IOBufPtr*>(&_return);
1205 result.setIsSet(0, true);
1206 return serializeResponse(&prot, ctx, result);
1207 }
1208
1209 template <class ProtocolIn_, class ProtocolOut_>
throw_wrapped_readData(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack * ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext * reqCtx)1210 void ReturnServiceAsyncProcessor::throw_wrapped_readData(apache::thrift::ResponseChannelRequest::UniquePtr req,int32_t protoSeqId,apache::thrift::ContextStack* ctx,folly::exception_wrapper ew,apache::thrift::Cpp2RequestContext* reqCtx) {
1211 if (!ew) {
1212 return;
1213 }
1214 {
1215 (void)protoSeqId;
1216 apache::thrift::detail::ap::process_throw_wrapped_handler_error<ProtocolOut_>(
1217 ew, std::move(req), reqCtx, ctx, "readData");
1218 return;
1219 }
1220 }
1221
1222
1223 }}} // some::valid::ns
1224