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
8 #include "thrift/compiler/test/fixtures/fatal/gen-cpp2/service_with_special_namesAsyncClient.h"
9
10 #include <thrift/lib/cpp2/gen/client_cpp.h>
11
12 namespace test_cpp2 { namespace cpp_reflection {
13 typedef apache::thrift::ThriftPresult<false> service_with_special_names_get_pargs;
14 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_get_presult;
15 typedef apache::thrift::ThriftPresult<false> service_with_special_names_getter_pargs;
16 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_getter_presult;
17 typedef apache::thrift::ThriftPresult<false> service_with_special_names_lists_pargs;
18 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_lists_presult;
19 typedef apache::thrift::ThriftPresult<false> service_with_special_names_maps_pargs;
20 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_maps_presult;
21 typedef apache::thrift::ThriftPresult<false> service_with_special_names_name_pargs;
22 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_name_presult;
23 typedef apache::thrift::ThriftPresult<false> service_with_special_names_name_to_value_pargs;
24 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_name_to_value_presult;
25 typedef apache::thrift::ThriftPresult<false> service_with_special_names_names_pargs;
26 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_names_presult;
27 typedef apache::thrift::ThriftPresult<false> service_with_special_names_prefix_tree_pargs;
28 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_prefix_tree_presult;
29 typedef apache::thrift::ThriftPresult<false> service_with_special_names_sets_pargs;
30 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_sets_presult;
31 typedef apache::thrift::ThriftPresult<false> service_with_special_names_setter_pargs;
32 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_setter_presult;
33 typedef apache::thrift::ThriftPresult<false> service_with_special_names_str_pargs;
34 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_str_presult;
35 typedef apache::thrift::ThriftPresult<false> service_with_special_names_strings_pargs;
36 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_strings_presult;
37 typedef apache::thrift::ThriftPresult<false> service_with_special_names_type_pargs;
38 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_type_presult;
39 typedef apache::thrift::ThriftPresult<false> service_with_special_names_value_pargs;
40 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_value_presult;
41 typedef apache::thrift::ThriftPresult<false> service_with_special_names_value_to_name_pargs;
42 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_value_to_name_presult;
43 typedef apache::thrift::ThriftPresult<false> service_with_special_names_values_pargs;
44 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_values_presult;
45 typedef apache::thrift::ThriftPresult<false> service_with_special_names_id_pargs;
46 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_id_presult;
47 typedef apache::thrift::ThriftPresult<false> service_with_special_names_ids_pargs;
48 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_ids_presult;
49 typedef apache::thrift::ThriftPresult<false> service_with_special_names_descriptor_pargs;
50 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_descriptor_presult;
51 typedef apache::thrift::ThriftPresult<false> service_with_special_names_descriptors_pargs;
52 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_descriptors_presult;
53 typedef apache::thrift::ThriftPresult<false> service_with_special_names_key_pargs;
54 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_key_presult;
55 typedef apache::thrift::ThriftPresult<false> service_with_special_names_keys_pargs;
56 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_keys_presult;
57 typedef apache::thrift::ThriftPresult<false> service_with_special_names_annotation_pargs;
58 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_annotation_presult;
59 typedef apache::thrift::ThriftPresult<false> service_with_special_names_annotations_pargs;
60 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_annotations_presult;
61 typedef apache::thrift::ThriftPresult<false> service_with_special_names_member_pargs;
62 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_member_presult;
63 typedef apache::thrift::ThriftPresult<false> service_with_special_names_members_pargs;
64 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_members_presult;
65 typedef apache::thrift::ThriftPresult<false> service_with_special_names_field_pargs;
66 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_field_presult;
67 typedef apache::thrift::ThriftPresult<false> service_with_special_names_fields_pargs;
68 typedef apache::thrift::ThriftPresult<true, apache::thrift::FieldData<0, ::apache::thrift::type_class::integral, ::std::int32_t*>> service_with_special_names_fields_presult;
69
70 template <typename Protocol_, typename RpcOptions>
getT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)71 void service_with_special_namesAsyncClient::getT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
72
73 service_with_special_names_get_pargs args;
74 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
75 auto writer = [&](Protocol_* p) { args.write(p); };
76
77 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
78 new ::apache::thrift::MethodMetadata::Data(
79 "get",
80 ::apache::thrift::FunctionQualifier::Unspecified);
81 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
82 }
83
84 template <typename Protocol_, typename RpcOptions>
getterT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)85 void service_with_special_namesAsyncClient::getterT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
86
87 service_with_special_names_getter_pargs args;
88 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
89 auto writer = [&](Protocol_* p) { args.write(p); };
90
91 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
92 new ::apache::thrift::MethodMetadata::Data(
93 "getter",
94 ::apache::thrift::FunctionQualifier::Unspecified);
95 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
96 }
97
98 template <typename Protocol_, typename RpcOptions>
listsT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)99 void service_with_special_namesAsyncClient::listsT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
100
101 service_with_special_names_lists_pargs args;
102 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
103 auto writer = [&](Protocol_* p) { args.write(p); };
104
105 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
106 new ::apache::thrift::MethodMetadata::Data(
107 "lists",
108 ::apache::thrift::FunctionQualifier::Unspecified);
109 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
110 }
111
112 template <typename Protocol_, typename RpcOptions>
mapsT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)113 void service_with_special_namesAsyncClient::mapsT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
114
115 service_with_special_names_maps_pargs args;
116 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
117 auto writer = [&](Protocol_* p) { args.write(p); };
118
119 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
120 new ::apache::thrift::MethodMetadata::Data(
121 "maps",
122 ::apache::thrift::FunctionQualifier::Unspecified);
123 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
124 }
125
126 template <typename Protocol_, typename RpcOptions>
nameT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)127 void service_with_special_namesAsyncClient::nameT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
128
129 service_with_special_names_name_pargs args;
130 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
131 auto writer = [&](Protocol_* p) { args.write(p); };
132
133 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
134 new ::apache::thrift::MethodMetadata::Data(
135 "name",
136 ::apache::thrift::FunctionQualifier::Unspecified);
137 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
138 }
139
140 template <typename Protocol_, typename RpcOptions>
name_to_valueT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)141 void service_with_special_namesAsyncClient::name_to_valueT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
142
143 service_with_special_names_name_to_value_pargs args;
144 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
145 auto writer = [&](Protocol_* p) { args.write(p); };
146
147 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
148 new ::apache::thrift::MethodMetadata::Data(
149 "name_to_value",
150 ::apache::thrift::FunctionQualifier::Unspecified);
151 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
152 }
153
154 template <typename Protocol_, typename RpcOptions>
namesT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)155 void service_with_special_namesAsyncClient::namesT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
156
157 service_with_special_names_names_pargs args;
158 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
159 auto writer = [&](Protocol_* p) { args.write(p); };
160
161 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
162 new ::apache::thrift::MethodMetadata::Data(
163 "names",
164 ::apache::thrift::FunctionQualifier::Unspecified);
165 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
166 }
167
168 template <typename Protocol_, typename RpcOptions>
prefix_treeT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)169 void service_with_special_namesAsyncClient::prefix_treeT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
170
171 service_with_special_names_prefix_tree_pargs args;
172 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
173 auto writer = [&](Protocol_* p) { args.write(p); };
174
175 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
176 new ::apache::thrift::MethodMetadata::Data(
177 "prefix_tree",
178 ::apache::thrift::FunctionQualifier::Unspecified);
179 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
180 }
181
182 template <typename Protocol_, typename RpcOptions>
setsT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)183 void service_with_special_namesAsyncClient::setsT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
184
185 service_with_special_names_sets_pargs args;
186 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
187 auto writer = [&](Protocol_* p) { args.write(p); };
188
189 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
190 new ::apache::thrift::MethodMetadata::Data(
191 "sets",
192 ::apache::thrift::FunctionQualifier::Unspecified);
193 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
194 }
195
196 template <typename Protocol_, typename RpcOptions>
setterT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)197 void service_with_special_namesAsyncClient::setterT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
198
199 service_with_special_names_setter_pargs args;
200 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
201 auto writer = [&](Protocol_* p) { args.write(p); };
202
203 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
204 new ::apache::thrift::MethodMetadata::Data(
205 "setter",
206 ::apache::thrift::FunctionQualifier::Unspecified);
207 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
208 }
209
210 template <typename Protocol_, typename RpcOptions>
strT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)211 void service_with_special_namesAsyncClient::strT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
212
213 service_with_special_names_str_pargs args;
214 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
215 auto writer = [&](Protocol_* p) { args.write(p); };
216
217 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
218 new ::apache::thrift::MethodMetadata::Data(
219 "str",
220 ::apache::thrift::FunctionQualifier::Unspecified);
221 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
222 }
223
224 template <typename Protocol_, typename RpcOptions>
stringsT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)225 void service_with_special_namesAsyncClient::stringsT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
226
227 service_with_special_names_strings_pargs args;
228 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
229 auto writer = [&](Protocol_* p) { args.write(p); };
230
231 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
232 new ::apache::thrift::MethodMetadata::Data(
233 "strings",
234 ::apache::thrift::FunctionQualifier::Unspecified);
235 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
236 }
237
238 template <typename Protocol_, typename RpcOptions>
typeT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)239 void service_with_special_namesAsyncClient::typeT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
240
241 service_with_special_names_type_pargs args;
242 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
243 auto writer = [&](Protocol_* p) { args.write(p); };
244
245 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
246 new ::apache::thrift::MethodMetadata::Data(
247 "type",
248 ::apache::thrift::FunctionQualifier::Unspecified);
249 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
250 }
251
252 template <typename Protocol_, typename RpcOptions>
valueT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)253 void service_with_special_namesAsyncClient::valueT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
254
255 service_with_special_names_value_pargs args;
256 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
257 auto writer = [&](Protocol_* p) { args.write(p); };
258
259 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
260 new ::apache::thrift::MethodMetadata::Data(
261 "value",
262 ::apache::thrift::FunctionQualifier::Unspecified);
263 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
264 }
265
266 template <typename Protocol_, typename RpcOptions>
value_to_nameT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)267 void service_with_special_namesAsyncClient::value_to_nameT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
268
269 service_with_special_names_value_to_name_pargs args;
270 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
271 auto writer = [&](Protocol_* p) { args.write(p); };
272
273 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
274 new ::apache::thrift::MethodMetadata::Data(
275 "value_to_name",
276 ::apache::thrift::FunctionQualifier::Unspecified);
277 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
278 }
279
280 template <typename Protocol_, typename RpcOptions>
valuesT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)281 void service_with_special_namesAsyncClient::valuesT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
282
283 service_with_special_names_values_pargs args;
284 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
285 auto writer = [&](Protocol_* p) { args.write(p); };
286
287 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
288 new ::apache::thrift::MethodMetadata::Data(
289 "values",
290 ::apache::thrift::FunctionQualifier::Unspecified);
291 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
292 }
293
294 template <typename Protocol_, typename RpcOptions>
idT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)295 void service_with_special_namesAsyncClient::idT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
296
297 service_with_special_names_id_pargs args;
298 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
299 auto writer = [&](Protocol_* p) { args.write(p); };
300
301 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
302 new ::apache::thrift::MethodMetadata::Data(
303 "id",
304 ::apache::thrift::FunctionQualifier::Unspecified);
305 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
306 }
307
308 template <typename Protocol_, typename RpcOptions>
idsT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)309 void service_with_special_namesAsyncClient::idsT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
310
311 service_with_special_names_ids_pargs args;
312 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
313 auto writer = [&](Protocol_* p) { args.write(p); };
314
315 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
316 new ::apache::thrift::MethodMetadata::Data(
317 "ids",
318 ::apache::thrift::FunctionQualifier::Unspecified);
319 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
320 }
321
322 template <typename Protocol_, typename RpcOptions>
descriptorT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)323 void service_with_special_namesAsyncClient::descriptorT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
324
325 service_with_special_names_descriptor_pargs args;
326 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
327 auto writer = [&](Protocol_* p) { args.write(p); };
328
329 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
330 new ::apache::thrift::MethodMetadata::Data(
331 "descriptor",
332 ::apache::thrift::FunctionQualifier::Unspecified);
333 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
334 }
335
336 template <typename Protocol_, typename RpcOptions>
descriptorsT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)337 void service_with_special_namesAsyncClient::descriptorsT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
338
339 service_with_special_names_descriptors_pargs args;
340 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
341 auto writer = [&](Protocol_* p) { args.write(p); };
342
343 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
344 new ::apache::thrift::MethodMetadata::Data(
345 "descriptors",
346 ::apache::thrift::FunctionQualifier::Unspecified);
347 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
348 }
349
350 template <typename Protocol_, typename RpcOptions>
keyT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)351 void service_with_special_namesAsyncClient::keyT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
352
353 service_with_special_names_key_pargs args;
354 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
355 auto writer = [&](Protocol_* p) { args.write(p); };
356
357 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
358 new ::apache::thrift::MethodMetadata::Data(
359 "key",
360 ::apache::thrift::FunctionQualifier::Unspecified);
361 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
362 }
363
364 template <typename Protocol_, typename RpcOptions>
keysT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)365 void service_with_special_namesAsyncClient::keysT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
366
367 service_with_special_names_keys_pargs args;
368 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
369 auto writer = [&](Protocol_* p) { args.write(p); };
370
371 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
372 new ::apache::thrift::MethodMetadata::Data(
373 "keys",
374 ::apache::thrift::FunctionQualifier::Unspecified);
375 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
376 }
377
378 template <typename Protocol_, typename RpcOptions>
annotationT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)379 void service_with_special_namesAsyncClient::annotationT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
380
381 service_with_special_names_annotation_pargs args;
382 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
383 auto writer = [&](Protocol_* p) { args.write(p); };
384
385 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
386 new ::apache::thrift::MethodMetadata::Data(
387 "annotation",
388 ::apache::thrift::FunctionQualifier::Unspecified);
389 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
390 }
391
392 template <typename Protocol_, typename RpcOptions>
annotationsT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)393 void service_with_special_namesAsyncClient::annotationsT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
394
395 service_with_special_names_annotations_pargs args;
396 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
397 auto writer = [&](Protocol_* p) { args.write(p); };
398
399 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
400 new ::apache::thrift::MethodMetadata::Data(
401 "annotations",
402 ::apache::thrift::FunctionQualifier::Unspecified);
403 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
404 }
405
406 template <typename Protocol_, typename RpcOptions>
memberT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)407 void service_with_special_namesAsyncClient::memberT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
408
409 service_with_special_names_member_pargs args;
410 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
411 auto writer = [&](Protocol_* p) { args.write(p); };
412
413 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
414 new ::apache::thrift::MethodMetadata::Data(
415 "member",
416 ::apache::thrift::FunctionQualifier::Unspecified);
417 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
418 }
419
420 template <typename Protocol_, typename RpcOptions>
membersT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)421 void service_with_special_namesAsyncClient::membersT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
422
423 service_with_special_names_members_pargs args;
424 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
425 auto writer = [&](Protocol_* p) { args.write(p); };
426
427 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
428 new ::apache::thrift::MethodMetadata::Data(
429 "members",
430 ::apache::thrift::FunctionQualifier::Unspecified);
431 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
432 }
433
434 template <typename Protocol_, typename RpcOptions>
fieldT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)435 void service_with_special_namesAsyncClient::fieldT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
436
437 service_with_special_names_field_pargs args;
438 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
439 auto writer = [&](Protocol_* p) { args.write(p); };
440
441 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
442 new ::apache::thrift::MethodMetadata::Data(
443 "field",
444 ::apache::thrift::FunctionQualifier::Unspecified);
445 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
446 }
447
448 template <typename Protocol_, typename RpcOptions>
fieldsT(Protocol_ * prot,RpcOptions && rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback)449 void service_with_special_namesAsyncClient::fieldsT(Protocol_* prot, RpcOptions&& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback) {
450
451 service_with_special_names_fields_pargs args;
452 auto sizer = [&](Protocol_* p) { return args.serializedSizeZC(p); };
453 auto writer = [&](Protocol_* p) { args.write(p); };
454
455 static ::apache::thrift::MethodMetadata::Data* methodMetadata =
456 new ::apache::thrift::MethodMetadata::Data(
457 "fields",
458 ::apache::thrift::FunctionQualifier::Unspecified);
459 apache::thrift::clientSendT<apache::thrift::RpcKind::SINGLE_REQUEST_SINGLE_RESPONSE, Protocol_>(prot, std::forward<RpcOptions>(rpcOptions), std::move(callback), contextStack, std::move(header), channel_.get(), ::apache::thrift::MethodMetadata::from_static(methodMetadata), writer, sizer);
460 }
461
462
463
get(std::unique_ptr<apache::thrift::RequestCallback> callback)464 void service_with_special_namesAsyncClient::get(std::unique_ptr<apache::thrift::RequestCallback> callback) {
465 ::apache::thrift::RpcOptions rpcOptions;
466 get(rpcOptions, std::move(callback));
467 }
468
get(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)469 void service_with_special_namesAsyncClient::get(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
470 auto [ctx, header] = getCtx(&rpcOptions);
471 apache::thrift::RequestCallback::Context callbackContext;
472 callbackContext.protocolId =
473 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
474 auto* contextStack = ctx.get();
475 if (callback) {
476 callbackContext.ctx = std::move(ctx);
477 }
478 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
479 getImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
480 }
481
getImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)482 void service_with_special_namesAsyncClient::getImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
483 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
484 case apache::thrift::protocol::T_BINARY_PROTOCOL:
485 {
486 apache::thrift::BinaryProtocolWriter writer;
487 if (stealRpcOptions) {
488 getT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
489 } else {
490 getT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
491 }
492 break;
493 }
494 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
495 {
496 apache::thrift::CompactProtocolWriter writer;
497 if (stealRpcOptions) {
498 getT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
499 } else {
500 getT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
501 }
502 break;
503 }
504 default:
505 {
506 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
507 }
508 }
509 }
510
getCtx(apache::thrift::RpcOptions * rpcOptions)511 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::getCtx(apache::thrift::RpcOptions* rpcOptions) {
512 auto header = std::make_shared<apache::thrift::transport::THeader>(
513 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
514 header->setProtocolId(channel_->getProtocolId());
515 if (rpcOptions) {
516 header->setHeaders(rpcOptions->releaseWriteHeaders());
517 }
518
519 auto ctx = apache::thrift::ContextStack::createWithClientContext(
520 handlers_,
521 getServiceName(),
522 "service_with_special_names.get",
523 *header);
524
525 return {std::move(ctx), std::move(header)};
526 }
527
sync_get()528 ::std::int32_t service_with_special_namesAsyncClient::sync_get() {
529 ::apache::thrift::RpcOptions rpcOptions;
530 return sync_get(rpcOptions);
531 }
532
sync_get(apache::thrift::RpcOptions & rpcOptions)533 ::std::int32_t service_with_special_namesAsyncClient::sync_get(apache::thrift::RpcOptions& rpcOptions) {
534 apache::thrift::ClientReceiveState returnState;
535 apache::thrift::ClientSyncCallback<false> callback(&returnState);
536 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
537 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
538 auto ctxAndHeader = getCtx(&rpcOptions);
539 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
540 callback.waitUntilDone(
541 evb,
542 [&] {
543 getImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
544 });
545
546 if (returnState.isException()) {
547 returnState.exception().throw_exception();
548 }
549 returnState.resetProtocolId(protocolId);
550 returnState.resetCtx(std::move(ctxAndHeader.first));
551 SCOPE_EXIT {
552 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
553 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
554 }
555 };
556 return folly::fibers::runInMainContext([&] {
557 return recv_get(returnState);
558 });
559 }
560
561
future_get()562 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_get() {
563 ::apache::thrift::RpcOptions rpcOptions;
564 return future_get(rpcOptions);
565 }
566
semifuture_get()567 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_get() {
568 ::apache::thrift::RpcOptions rpcOptions;
569 return semifuture_get(rpcOptions);
570 }
571
future_get(apache::thrift::RpcOptions & rpcOptions)572 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_get(apache::thrift::RpcOptions& rpcOptions) {
573 folly::Promise<::std::int32_t> promise;
574 auto future = promise.getFuture();
575 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_get, channel_);
576 get(rpcOptions, std::move(callback));
577 return future;
578 }
579
semifuture_get(apache::thrift::RpcOptions & rpcOptions)580 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_get(apache::thrift::RpcOptions& rpcOptions) {
581 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_get, channel_);
582 auto callback = std::move(callbackAndFuture.first);
583 get(rpcOptions, std::move(callback));
584 return std::move(callbackAndFuture.second);
585 }
586
header_future_get(apache::thrift::RpcOptions & rpcOptions)587 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_get(apache::thrift::RpcOptions& rpcOptions) {
588 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
589 auto future = promise.getFuture();
590 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_get, channel_);
591 get(rpcOptions, std::move(callback));
592 return future;
593 }
594
header_semifuture_get(apache::thrift::RpcOptions & rpcOptions)595 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_get(apache::thrift::RpcOptions& rpcOptions) {
596 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_get, channel_);
597 auto callback = std::move(callbackAndFuture.first);
598 get(rpcOptions, std::move(callback));
599 return std::move(callbackAndFuture.second);
600 }
601
get(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)602 void service_with_special_namesAsyncClient::get(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
603 get(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
604 }
605
606 #if FOLLY_HAS_COROUTINES
607 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_get(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)608 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_get(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
609 if (state.isException()) {
610 return std::move(state.exception());
611 }
612 if (!state.hasResponseBuffer()) {
613 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
614 }
615
616 using result = service_with_special_names_get_presult;
617 switch (state.protocolId()) {
618 case apache::thrift::protocol::T_BINARY_PROTOCOL:
619 {
620 apache::thrift::BinaryProtocolReader reader;
621 return apache::thrift::detail::ac::recv_wrapped<result>(
622 &reader, state, _return);
623 }
624 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
625 {
626 apache::thrift::CompactProtocolReader reader;
627 return apache::thrift::detail::ac::recv_wrapped<result>(
628 &reader, state, _return);
629 }
630 default:
631 {
632 }
633 }
634 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
635 }
636
recv_get(::apache::thrift::ClientReceiveState & state)637 ::std::int32_t service_with_special_namesAsyncClient::recv_get(::apache::thrift::ClientReceiveState& state) {
638 ::std::int32_t _return;
639 auto ew = recv_wrapped_get(_return, state);
640 if (ew) {
641 ew.throw_exception();
642 }
643 return _return;
644 }
645
recv_instance_get(::apache::thrift::ClientReceiveState & state)646 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_get(::apache::thrift::ClientReceiveState& state) {
647 return recv_get(state);
648 }
649
recv_instance_wrapped_get(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)650 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_get(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
651 return recv_wrapped_get(_return, state);
652 }
653
getter(std::unique_ptr<apache::thrift::RequestCallback> callback)654 void service_with_special_namesAsyncClient::getter(std::unique_ptr<apache::thrift::RequestCallback> callback) {
655 ::apache::thrift::RpcOptions rpcOptions;
656 getter(rpcOptions, std::move(callback));
657 }
658
getter(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)659 void service_with_special_namesAsyncClient::getter(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
660 auto [ctx, header] = getterCtx(&rpcOptions);
661 apache::thrift::RequestCallback::Context callbackContext;
662 callbackContext.protocolId =
663 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
664 auto* contextStack = ctx.get();
665 if (callback) {
666 callbackContext.ctx = std::move(ctx);
667 }
668 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
669 getterImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
670 }
671
getterImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)672 void service_with_special_namesAsyncClient::getterImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
673 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
674 case apache::thrift::protocol::T_BINARY_PROTOCOL:
675 {
676 apache::thrift::BinaryProtocolWriter writer;
677 if (stealRpcOptions) {
678 getterT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
679 } else {
680 getterT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
681 }
682 break;
683 }
684 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
685 {
686 apache::thrift::CompactProtocolWriter writer;
687 if (stealRpcOptions) {
688 getterT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
689 } else {
690 getterT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
691 }
692 break;
693 }
694 default:
695 {
696 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
697 }
698 }
699 }
700
getterCtx(apache::thrift::RpcOptions * rpcOptions)701 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::getterCtx(apache::thrift::RpcOptions* rpcOptions) {
702 auto header = std::make_shared<apache::thrift::transport::THeader>(
703 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
704 header->setProtocolId(channel_->getProtocolId());
705 if (rpcOptions) {
706 header->setHeaders(rpcOptions->releaseWriteHeaders());
707 }
708
709 auto ctx = apache::thrift::ContextStack::createWithClientContext(
710 handlers_,
711 getServiceName(),
712 "service_with_special_names.getter",
713 *header);
714
715 return {std::move(ctx), std::move(header)};
716 }
717
sync_getter()718 ::std::int32_t service_with_special_namesAsyncClient::sync_getter() {
719 ::apache::thrift::RpcOptions rpcOptions;
720 return sync_getter(rpcOptions);
721 }
722
sync_getter(apache::thrift::RpcOptions & rpcOptions)723 ::std::int32_t service_with_special_namesAsyncClient::sync_getter(apache::thrift::RpcOptions& rpcOptions) {
724 apache::thrift::ClientReceiveState returnState;
725 apache::thrift::ClientSyncCallback<false> callback(&returnState);
726 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
727 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
728 auto ctxAndHeader = getterCtx(&rpcOptions);
729 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
730 callback.waitUntilDone(
731 evb,
732 [&] {
733 getterImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
734 });
735
736 if (returnState.isException()) {
737 returnState.exception().throw_exception();
738 }
739 returnState.resetProtocolId(protocolId);
740 returnState.resetCtx(std::move(ctxAndHeader.first));
741 SCOPE_EXIT {
742 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
743 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
744 }
745 };
746 return folly::fibers::runInMainContext([&] {
747 return recv_getter(returnState);
748 });
749 }
750
751
future_getter()752 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_getter() {
753 ::apache::thrift::RpcOptions rpcOptions;
754 return future_getter(rpcOptions);
755 }
756
semifuture_getter()757 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_getter() {
758 ::apache::thrift::RpcOptions rpcOptions;
759 return semifuture_getter(rpcOptions);
760 }
761
future_getter(apache::thrift::RpcOptions & rpcOptions)762 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_getter(apache::thrift::RpcOptions& rpcOptions) {
763 folly::Promise<::std::int32_t> promise;
764 auto future = promise.getFuture();
765 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_getter, channel_);
766 getter(rpcOptions, std::move(callback));
767 return future;
768 }
769
semifuture_getter(apache::thrift::RpcOptions & rpcOptions)770 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_getter(apache::thrift::RpcOptions& rpcOptions) {
771 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_getter, channel_);
772 auto callback = std::move(callbackAndFuture.first);
773 getter(rpcOptions, std::move(callback));
774 return std::move(callbackAndFuture.second);
775 }
776
header_future_getter(apache::thrift::RpcOptions & rpcOptions)777 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_getter(apache::thrift::RpcOptions& rpcOptions) {
778 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
779 auto future = promise.getFuture();
780 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_getter, channel_);
781 getter(rpcOptions, std::move(callback));
782 return future;
783 }
784
header_semifuture_getter(apache::thrift::RpcOptions & rpcOptions)785 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_getter(apache::thrift::RpcOptions& rpcOptions) {
786 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_getter, channel_);
787 auto callback = std::move(callbackAndFuture.first);
788 getter(rpcOptions, std::move(callback));
789 return std::move(callbackAndFuture.second);
790 }
791
getter(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)792 void service_with_special_namesAsyncClient::getter(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
793 getter(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
794 }
795
796 #if FOLLY_HAS_COROUTINES
797 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_getter(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)798 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_getter(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
799 if (state.isException()) {
800 return std::move(state.exception());
801 }
802 if (!state.hasResponseBuffer()) {
803 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
804 }
805
806 using result = service_with_special_names_getter_presult;
807 switch (state.protocolId()) {
808 case apache::thrift::protocol::T_BINARY_PROTOCOL:
809 {
810 apache::thrift::BinaryProtocolReader reader;
811 return apache::thrift::detail::ac::recv_wrapped<result>(
812 &reader, state, _return);
813 }
814 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
815 {
816 apache::thrift::CompactProtocolReader reader;
817 return apache::thrift::detail::ac::recv_wrapped<result>(
818 &reader, state, _return);
819 }
820 default:
821 {
822 }
823 }
824 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
825 }
826
recv_getter(::apache::thrift::ClientReceiveState & state)827 ::std::int32_t service_with_special_namesAsyncClient::recv_getter(::apache::thrift::ClientReceiveState& state) {
828 ::std::int32_t _return;
829 auto ew = recv_wrapped_getter(_return, state);
830 if (ew) {
831 ew.throw_exception();
832 }
833 return _return;
834 }
835
recv_instance_getter(::apache::thrift::ClientReceiveState & state)836 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_getter(::apache::thrift::ClientReceiveState& state) {
837 return recv_getter(state);
838 }
839
recv_instance_wrapped_getter(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)840 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_getter(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
841 return recv_wrapped_getter(_return, state);
842 }
843
lists(std::unique_ptr<apache::thrift::RequestCallback> callback)844 void service_with_special_namesAsyncClient::lists(std::unique_ptr<apache::thrift::RequestCallback> callback) {
845 ::apache::thrift::RpcOptions rpcOptions;
846 lists(rpcOptions, std::move(callback));
847 }
848
lists(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)849 void service_with_special_namesAsyncClient::lists(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
850 auto [ctx, header] = listsCtx(&rpcOptions);
851 apache::thrift::RequestCallback::Context callbackContext;
852 callbackContext.protocolId =
853 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
854 auto* contextStack = ctx.get();
855 if (callback) {
856 callbackContext.ctx = std::move(ctx);
857 }
858 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
859 listsImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
860 }
861
listsImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)862 void service_with_special_namesAsyncClient::listsImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
863 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
864 case apache::thrift::protocol::T_BINARY_PROTOCOL:
865 {
866 apache::thrift::BinaryProtocolWriter writer;
867 if (stealRpcOptions) {
868 listsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
869 } else {
870 listsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
871 }
872 break;
873 }
874 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
875 {
876 apache::thrift::CompactProtocolWriter writer;
877 if (stealRpcOptions) {
878 listsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
879 } else {
880 listsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
881 }
882 break;
883 }
884 default:
885 {
886 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
887 }
888 }
889 }
890
listsCtx(apache::thrift::RpcOptions * rpcOptions)891 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::listsCtx(apache::thrift::RpcOptions* rpcOptions) {
892 auto header = std::make_shared<apache::thrift::transport::THeader>(
893 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
894 header->setProtocolId(channel_->getProtocolId());
895 if (rpcOptions) {
896 header->setHeaders(rpcOptions->releaseWriteHeaders());
897 }
898
899 auto ctx = apache::thrift::ContextStack::createWithClientContext(
900 handlers_,
901 getServiceName(),
902 "service_with_special_names.lists",
903 *header);
904
905 return {std::move(ctx), std::move(header)};
906 }
907
sync_lists()908 ::std::int32_t service_with_special_namesAsyncClient::sync_lists() {
909 ::apache::thrift::RpcOptions rpcOptions;
910 return sync_lists(rpcOptions);
911 }
912
sync_lists(apache::thrift::RpcOptions & rpcOptions)913 ::std::int32_t service_with_special_namesAsyncClient::sync_lists(apache::thrift::RpcOptions& rpcOptions) {
914 apache::thrift::ClientReceiveState returnState;
915 apache::thrift::ClientSyncCallback<false> callback(&returnState);
916 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
917 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
918 auto ctxAndHeader = listsCtx(&rpcOptions);
919 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
920 callback.waitUntilDone(
921 evb,
922 [&] {
923 listsImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
924 });
925
926 if (returnState.isException()) {
927 returnState.exception().throw_exception();
928 }
929 returnState.resetProtocolId(protocolId);
930 returnState.resetCtx(std::move(ctxAndHeader.first));
931 SCOPE_EXIT {
932 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
933 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
934 }
935 };
936 return folly::fibers::runInMainContext([&] {
937 return recv_lists(returnState);
938 });
939 }
940
941
future_lists()942 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_lists() {
943 ::apache::thrift::RpcOptions rpcOptions;
944 return future_lists(rpcOptions);
945 }
946
semifuture_lists()947 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_lists() {
948 ::apache::thrift::RpcOptions rpcOptions;
949 return semifuture_lists(rpcOptions);
950 }
951
future_lists(apache::thrift::RpcOptions & rpcOptions)952 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_lists(apache::thrift::RpcOptions& rpcOptions) {
953 folly::Promise<::std::int32_t> promise;
954 auto future = promise.getFuture();
955 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_lists, channel_);
956 lists(rpcOptions, std::move(callback));
957 return future;
958 }
959
semifuture_lists(apache::thrift::RpcOptions & rpcOptions)960 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_lists(apache::thrift::RpcOptions& rpcOptions) {
961 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_lists, channel_);
962 auto callback = std::move(callbackAndFuture.first);
963 lists(rpcOptions, std::move(callback));
964 return std::move(callbackAndFuture.second);
965 }
966
header_future_lists(apache::thrift::RpcOptions & rpcOptions)967 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_lists(apache::thrift::RpcOptions& rpcOptions) {
968 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
969 auto future = promise.getFuture();
970 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_lists, channel_);
971 lists(rpcOptions, std::move(callback));
972 return future;
973 }
974
header_semifuture_lists(apache::thrift::RpcOptions & rpcOptions)975 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_lists(apache::thrift::RpcOptions& rpcOptions) {
976 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_lists, channel_);
977 auto callback = std::move(callbackAndFuture.first);
978 lists(rpcOptions, std::move(callback));
979 return std::move(callbackAndFuture.second);
980 }
981
lists(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)982 void service_with_special_namesAsyncClient::lists(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
983 lists(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
984 }
985
986 #if FOLLY_HAS_COROUTINES
987 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_lists(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)988 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_lists(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
989 if (state.isException()) {
990 return std::move(state.exception());
991 }
992 if (!state.hasResponseBuffer()) {
993 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
994 }
995
996 using result = service_with_special_names_lists_presult;
997 switch (state.protocolId()) {
998 case apache::thrift::protocol::T_BINARY_PROTOCOL:
999 {
1000 apache::thrift::BinaryProtocolReader reader;
1001 return apache::thrift::detail::ac::recv_wrapped<result>(
1002 &reader, state, _return);
1003 }
1004 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
1005 {
1006 apache::thrift::CompactProtocolReader reader;
1007 return apache::thrift::detail::ac::recv_wrapped<result>(
1008 &reader, state, _return);
1009 }
1010 default:
1011 {
1012 }
1013 }
1014 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
1015 }
1016
recv_lists(::apache::thrift::ClientReceiveState & state)1017 ::std::int32_t service_with_special_namesAsyncClient::recv_lists(::apache::thrift::ClientReceiveState& state) {
1018 ::std::int32_t _return;
1019 auto ew = recv_wrapped_lists(_return, state);
1020 if (ew) {
1021 ew.throw_exception();
1022 }
1023 return _return;
1024 }
1025
recv_instance_lists(::apache::thrift::ClientReceiveState & state)1026 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_lists(::apache::thrift::ClientReceiveState& state) {
1027 return recv_lists(state);
1028 }
1029
recv_instance_wrapped_lists(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)1030 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_lists(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
1031 return recv_wrapped_lists(_return, state);
1032 }
1033
maps(std::unique_ptr<apache::thrift::RequestCallback> callback)1034 void service_with_special_namesAsyncClient::maps(std::unique_ptr<apache::thrift::RequestCallback> callback) {
1035 ::apache::thrift::RpcOptions rpcOptions;
1036 maps(rpcOptions, std::move(callback));
1037 }
1038
maps(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)1039 void service_with_special_namesAsyncClient::maps(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
1040 auto [ctx, header] = mapsCtx(&rpcOptions);
1041 apache::thrift::RequestCallback::Context callbackContext;
1042 callbackContext.protocolId =
1043 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
1044 auto* contextStack = ctx.get();
1045 if (callback) {
1046 callbackContext.ctx = std::move(ctx);
1047 }
1048 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
1049 mapsImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
1050 }
1051
mapsImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)1052 void service_with_special_namesAsyncClient::mapsImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
1053 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
1054 case apache::thrift::protocol::T_BINARY_PROTOCOL:
1055 {
1056 apache::thrift::BinaryProtocolWriter writer;
1057 if (stealRpcOptions) {
1058 mapsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
1059 } else {
1060 mapsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
1061 }
1062 break;
1063 }
1064 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
1065 {
1066 apache::thrift::CompactProtocolWriter writer;
1067 if (stealRpcOptions) {
1068 mapsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
1069 } else {
1070 mapsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
1071 }
1072 break;
1073 }
1074 default:
1075 {
1076 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
1077 }
1078 }
1079 }
1080
mapsCtx(apache::thrift::RpcOptions * rpcOptions)1081 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::mapsCtx(apache::thrift::RpcOptions* rpcOptions) {
1082 auto header = std::make_shared<apache::thrift::transport::THeader>(
1083 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
1084 header->setProtocolId(channel_->getProtocolId());
1085 if (rpcOptions) {
1086 header->setHeaders(rpcOptions->releaseWriteHeaders());
1087 }
1088
1089 auto ctx = apache::thrift::ContextStack::createWithClientContext(
1090 handlers_,
1091 getServiceName(),
1092 "service_with_special_names.maps",
1093 *header);
1094
1095 return {std::move(ctx), std::move(header)};
1096 }
1097
sync_maps()1098 ::std::int32_t service_with_special_namesAsyncClient::sync_maps() {
1099 ::apache::thrift::RpcOptions rpcOptions;
1100 return sync_maps(rpcOptions);
1101 }
1102
sync_maps(apache::thrift::RpcOptions & rpcOptions)1103 ::std::int32_t service_with_special_namesAsyncClient::sync_maps(apache::thrift::RpcOptions& rpcOptions) {
1104 apache::thrift::ClientReceiveState returnState;
1105 apache::thrift::ClientSyncCallback<false> callback(&returnState);
1106 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
1107 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
1108 auto ctxAndHeader = mapsCtx(&rpcOptions);
1109 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
1110 callback.waitUntilDone(
1111 evb,
1112 [&] {
1113 mapsImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
1114 });
1115
1116 if (returnState.isException()) {
1117 returnState.exception().throw_exception();
1118 }
1119 returnState.resetProtocolId(protocolId);
1120 returnState.resetCtx(std::move(ctxAndHeader.first));
1121 SCOPE_EXIT {
1122 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
1123 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
1124 }
1125 };
1126 return folly::fibers::runInMainContext([&] {
1127 return recv_maps(returnState);
1128 });
1129 }
1130
1131
future_maps()1132 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_maps() {
1133 ::apache::thrift::RpcOptions rpcOptions;
1134 return future_maps(rpcOptions);
1135 }
1136
semifuture_maps()1137 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_maps() {
1138 ::apache::thrift::RpcOptions rpcOptions;
1139 return semifuture_maps(rpcOptions);
1140 }
1141
future_maps(apache::thrift::RpcOptions & rpcOptions)1142 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_maps(apache::thrift::RpcOptions& rpcOptions) {
1143 folly::Promise<::std::int32_t> promise;
1144 auto future = promise.getFuture();
1145 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_maps, channel_);
1146 maps(rpcOptions, std::move(callback));
1147 return future;
1148 }
1149
semifuture_maps(apache::thrift::RpcOptions & rpcOptions)1150 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_maps(apache::thrift::RpcOptions& rpcOptions) {
1151 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_maps, channel_);
1152 auto callback = std::move(callbackAndFuture.first);
1153 maps(rpcOptions, std::move(callback));
1154 return std::move(callbackAndFuture.second);
1155 }
1156
header_future_maps(apache::thrift::RpcOptions & rpcOptions)1157 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_maps(apache::thrift::RpcOptions& rpcOptions) {
1158 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
1159 auto future = promise.getFuture();
1160 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_maps, channel_);
1161 maps(rpcOptions, std::move(callback));
1162 return future;
1163 }
1164
header_semifuture_maps(apache::thrift::RpcOptions & rpcOptions)1165 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_maps(apache::thrift::RpcOptions& rpcOptions) {
1166 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_maps, channel_);
1167 auto callback = std::move(callbackAndFuture.first);
1168 maps(rpcOptions, std::move(callback));
1169 return std::move(callbackAndFuture.second);
1170 }
1171
maps(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)1172 void service_with_special_namesAsyncClient::maps(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
1173 maps(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
1174 }
1175
1176 #if FOLLY_HAS_COROUTINES
1177 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_maps(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)1178 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_maps(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
1179 if (state.isException()) {
1180 return std::move(state.exception());
1181 }
1182 if (!state.hasResponseBuffer()) {
1183 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
1184 }
1185
1186 using result = service_with_special_names_maps_presult;
1187 switch (state.protocolId()) {
1188 case apache::thrift::protocol::T_BINARY_PROTOCOL:
1189 {
1190 apache::thrift::BinaryProtocolReader reader;
1191 return apache::thrift::detail::ac::recv_wrapped<result>(
1192 &reader, state, _return);
1193 }
1194 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
1195 {
1196 apache::thrift::CompactProtocolReader reader;
1197 return apache::thrift::detail::ac::recv_wrapped<result>(
1198 &reader, state, _return);
1199 }
1200 default:
1201 {
1202 }
1203 }
1204 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
1205 }
1206
recv_maps(::apache::thrift::ClientReceiveState & state)1207 ::std::int32_t service_with_special_namesAsyncClient::recv_maps(::apache::thrift::ClientReceiveState& state) {
1208 ::std::int32_t _return;
1209 auto ew = recv_wrapped_maps(_return, state);
1210 if (ew) {
1211 ew.throw_exception();
1212 }
1213 return _return;
1214 }
1215
recv_instance_maps(::apache::thrift::ClientReceiveState & state)1216 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_maps(::apache::thrift::ClientReceiveState& state) {
1217 return recv_maps(state);
1218 }
1219
recv_instance_wrapped_maps(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)1220 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_maps(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
1221 return recv_wrapped_maps(_return, state);
1222 }
1223
name(std::unique_ptr<apache::thrift::RequestCallback> callback)1224 void service_with_special_namesAsyncClient::name(std::unique_ptr<apache::thrift::RequestCallback> callback) {
1225 ::apache::thrift::RpcOptions rpcOptions;
1226 name(rpcOptions, std::move(callback));
1227 }
1228
name(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)1229 void service_with_special_namesAsyncClient::name(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
1230 auto [ctx, header] = nameCtx(&rpcOptions);
1231 apache::thrift::RequestCallback::Context callbackContext;
1232 callbackContext.protocolId =
1233 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
1234 auto* contextStack = ctx.get();
1235 if (callback) {
1236 callbackContext.ctx = std::move(ctx);
1237 }
1238 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
1239 nameImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
1240 }
1241
nameImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)1242 void service_with_special_namesAsyncClient::nameImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
1243 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
1244 case apache::thrift::protocol::T_BINARY_PROTOCOL:
1245 {
1246 apache::thrift::BinaryProtocolWriter writer;
1247 if (stealRpcOptions) {
1248 nameT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
1249 } else {
1250 nameT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
1251 }
1252 break;
1253 }
1254 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
1255 {
1256 apache::thrift::CompactProtocolWriter writer;
1257 if (stealRpcOptions) {
1258 nameT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
1259 } else {
1260 nameT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
1261 }
1262 break;
1263 }
1264 default:
1265 {
1266 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
1267 }
1268 }
1269 }
1270
nameCtx(apache::thrift::RpcOptions * rpcOptions)1271 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::nameCtx(apache::thrift::RpcOptions* rpcOptions) {
1272 auto header = std::make_shared<apache::thrift::transport::THeader>(
1273 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
1274 header->setProtocolId(channel_->getProtocolId());
1275 if (rpcOptions) {
1276 header->setHeaders(rpcOptions->releaseWriteHeaders());
1277 }
1278
1279 auto ctx = apache::thrift::ContextStack::createWithClientContext(
1280 handlers_,
1281 getServiceName(),
1282 "service_with_special_names.name",
1283 *header);
1284
1285 return {std::move(ctx), std::move(header)};
1286 }
1287
sync_name()1288 ::std::int32_t service_with_special_namesAsyncClient::sync_name() {
1289 ::apache::thrift::RpcOptions rpcOptions;
1290 return sync_name(rpcOptions);
1291 }
1292
sync_name(apache::thrift::RpcOptions & rpcOptions)1293 ::std::int32_t service_with_special_namesAsyncClient::sync_name(apache::thrift::RpcOptions& rpcOptions) {
1294 apache::thrift::ClientReceiveState returnState;
1295 apache::thrift::ClientSyncCallback<false> callback(&returnState);
1296 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
1297 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
1298 auto ctxAndHeader = nameCtx(&rpcOptions);
1299 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
1300 callback.waitUntilDone(
1301 evb,
1302 [&] {
1303 nameImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
1304 });
1305
1306 if (returnState.isException()) {
1307 returnState.exception().throw_exception();
1308 }
1309 returnState.resetProtocolId(protocolId);
1310 returnState.resetCtx(std::move(ctxAndHeader.first));
1311 SCOPE_EXIT {
1312 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
1313 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
1314 }
1315 };
1316 return folly::fibers::runInMainContext([&] {
1317 return recv_name(returnState);
1318 });
1319 }
1320
1321
future_name()1322 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_name() {
1323 ::apache::thrift::RpcOptions rpcOptions;
1324 return future_name(rpcOptions);
1325 }
1326
semifuture_name()1327 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_name() {
1328 ::apache::thrift::RpcOptions rpcOptions;
1329 return semifuture_name(rpcOptions);
1330 }
1331
future_name(apache::thrift::RpcOptions & rpcOptions)1332 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_name(apache::thrift::RpcOptions& rpcOptions) {
1333 folly::Promise<::std::int32_t> promise;
1334 auto future = promise.getFuture();
1335 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_name, channel_);
1336 name(rpcOptions, std::move(callback));
1337 return future;
1338 }
1339
semifuture_name(apache::thrift::RpcOptions & rpcOptions)1340 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_name(apache::thrift::RpcOptions& rpcOptions) {
1341 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_name, channel_);
1342 auto callback = std::move(callbackAndFuture.first);
1343 name(rpcOptions, std::move(callback));
1344 return std::move(callbackAndFuture.second);
1345 }
1346
header_future_name(apache::thrift::RpcOptions & rpcOptions)1347 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_name(apache::thrift::RpcOptions& rpcOptions) {
1348 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
1349 auto future = promise.getFuture();
1350 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_name, channel_);
1351 name(rpcOptions, std::move(callback));
1352 return future;
1353 }
1354
header_semifuture_name(apache::thrift::RpcOptions & rpcOptions)1355 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_name(apache::thrift::RpcOptions& rpcOptions) {
1356 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_name, channel_);
1357 auto callback = std::move(callbackAndFuture.first);
1358 name(rpcOptions, std::move(callback));
1359 return std::move(callbackAndFuture.second);
1360 }
1361
name(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)1362 void service_with_special_namesAsyncClient::name(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
1363 name(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
1364 }
1365
1366 #if FOLLY_HAS_COROUTINES
1367 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_name(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)1368 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_name(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
1369 if (state.isException()) {
1370 return std::move(state.exception());
1371 }
1372 if (!state.hasResponseBuffer()) {
1373 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
1374 }
1375
1376 using result = service_with_special_names_name_presult;
1377 switch (state.protocolId()) {
1378 case apache::thrift::protocol::T_BINARY_PROTOCOL:
1379 {
1380 apache::thrift::BinaryProtocolReader reader;
1381 return apache::thrift::detail::ac::recv_wrapped<result>(
1382 &reader, state, _return);
1383 }
1384 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
1385 {
1386 apache::thrift::CompactProtocolReader reader;
1387 return apache::thrift::detail::ac::recv_wrapped<result>(
1388 &reader, state, _return);
1389 }
1390 default:
1391 {
1392 }
1393 }
1394 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
1395 }
1396
recv_name(::apache::thrift::ClientReceiveState & state)1397 ::std::int32_t service_with_special_namesAsyncClient::recv_name(::apache::thrift::ClientReceiveState& state) {
1398 ::std::int32_t _return;
1399 auto ew = recv_wrapped_name(_return, state);
1400 if (ew) {
1401 ew.throw_exception();
1402 }
1403 return _return;
1404 }
1405
recv_instance_name(::apache::thrift::ClientReceiveState & state)1406 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_name(::apache::thrift::ClientReceiveState& state) {
1407 return recv_name(state);
1408 }
1409
recv_instance_wrapped_name(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)1410 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_name(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
1411 return recv_wrapped_name(_return, state);
1412 }
1413
name_to_value(std::unique_ptr<apache::thrift::RequestCallback> callback)1414 void service_with_special_namesAsyncClient::name_to_value(std::unique_ptr<apache::thrift::RequestCallback> callback) {
1415 ::apache::thrift::RpcOptions rpcOptions;
1416 name_to_value(rpcOptions, std::move(callback));
1417 }
1418
name_to_value(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)1419 void service_with_special_namesAsyncClient::name_to_value(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
1420 auto [ctx, header] = name_to_valueCtx(&rpcOptions);
1421 apache::thrift::RequestCallback::Context callbackContext;
1422 callbackContext.protocolId =
1423 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
1424 auto* contextStack = ctx.get();
1425 if (callback) {
1426 callbackContext.ctx = std::move(ctx);
1427 }
1428 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
1429 name_to_valueImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
1430 }
1431
name_to_valueImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)1432 void service_with_special_namesAsyncClient::name_to_valueImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
1433 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
1434 case apache::thrift::protocol::T_BINARY_PROTOCOL:
1435 {
1436 apache::thrift::BinaryProtocolWriter writer;
1437 if (stealRpcOptions) {
1438 name_to_valueT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
1439 } else {
1440 name_to_valueT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
1441 }
1442 break;
1443 }
1444 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
1445 {
1446 apache::thrift::CompactProtocolWriter writer;
1447 if (stealRpcOptions) {
1448 name_to_valueT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
1449 } else {
1450 name_to_valueT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
1451 }
1452 break;
1453 }
1454 default:
1455 {
1456 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
1457 }
1458 }
1459 }
1460
name_to_valueCtx(apache::thrift::RpcOptions * rpcOptions)1461 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::name_to_valueCtx(apache::thrift::RpcOptions* rpcOptions) {
1462 auto header = std::make_shared<apache::thrift::transport::THeader>(
1463 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
1464 header->setProtocolId(channel_->getProtocolId());
1465 if (rpcOptions) {
1466 header->setHeaders(rpcOptions->releaseWriteHeaders());
1467 }
1468
1469 auto ctx = apache::thrift::ContextStack::createWithClientContext(
1470 handlers_,
1471 getServiceName(),
1472 "service_with_special_names.name_to_value",
1473 *header);
1474
1475 return {std::move(ctx), std::move(header)};
1476 }
1477
sync_name_to_value()1478 ::std::int32_t service_with_special_namesAsyncClient::sync_name_to_value() {
1479 ::apache::thrift::RpcOptions rpcOptions;
1480 return sync_name_to_value(rpcOptions);
1481 }
1482
sync_name_to_value(apache::thrift::RpcOptions & rpcOptions)1483 ::std::int32_t service_with_special_namesAsyncClient::sync_name_to_value(apache::thrift::RpcOptions& rpcOptions) {
1484 apache::thrift::ClientReceiveState returnState;
1485 apache::thrift::ClientSyncCallback<false> callback(&returnState);
1486 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
1487 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
1488 auto ctxAndHeader = name_to_valueCtx(&rpcOptions);
1489 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
1490 callback.waitUntilDone(
1491 evb,
1492 [&] {
1493 name_to_valueImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
1494 });
1495
1496 if (returnState.isException()) {
1497 returnState.exception().throw_exception();
1498 }
1499 returnState.resetProtocolId(protocolId);
1500 returnState.resetCtx(std::move(ctxAndHeader.first));
1501 SCOPE_EXIT {
1502 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
1503 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
1504 }
1505 };
1506 return folly::fibers::runInMainContext([&] {
1507 return recv_name_to_value(returnState);
1508 });
1509 }
1510
1511
future_name_to_value()1512 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_name_to_value() {
1513 ::apache::thrift::RpcOptions rpcOptions;
1514 return future_name_to_value(rpcOptions);
1515 }
1516
semifuture_name_to_value()1517 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_name_to_value() {
1518 ::apache::thrift::RpcOptions rpcOptions;
1519 return semifuture_name_to_value(rpcOptions);
1520 }
1521
future_name_to_value(apache::thrift::RpcOptions & rpcOptions)1522 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_name_to_value(apache::thrift::RpcOptions& rpcOptions) {
1523 folly::Promise<::std::int32_t> promise;
1524 auto future = promise.getFuture();
1525 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_name_to_value, channel_);
1526 name_to_value(rpcOptions, std::move(callback));
1527 return future;
1528 }
1529
semifuture_name_to_value(apache::thrift::RpcOptions & rpcOptions)1530 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_name_to_value(apache::thrift::RpcOptions& rpcOptions) {
1531 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_name_to_value, channel_);
1532 auto callback = std::move(callbackAndFuture.first);
1533 name_to_value(rpcOptions, std::move(callback));
1534 return std::move(callbackAndFuture.second);
1535 }
1536
header_future_name_to_value(apache::thrift::RpcOptions & rpcOptions)1537 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_name_to_value(apache::thrift::RpcOptions& rpcOptions) {
1538 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
1539 auto future = promise.getFuture();
1540 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_name_to_value, channel_);
1541 name_to_value(rpcOptions, std::move(callback));
1542 return future;
1543 }
1544
header_semifuture_name_to_value(apache::thrift::RpcOptions & rpcOptions)1545 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_name_to_value(apache::thrift::RpcOptions& rpcOptions) {
1546 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_name_to_value, channel_);
1547 auto callback = std::move(callbackAndFuture.first);
1548 name_to_value(rpcOptions, std::move(callback));
1549 return std::move(callbackAndFuture.second);
1550 }
1551
name_to_value(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)1552 void service_with_special_namesAsyncClient::name_to_value(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
1553 name_to_value(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
1554 }
1555
1556 #if FOLLY_HAS_COROUTINES
1557 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_name_to_value(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)1558 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_name_to_value(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
1559 if (state.isException()) {
1560 return std::move(state.exception());
1561 }
1562 if (!state.hasResponseBuffer()) {
1563 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
1564 }
1565
1566 using result = service_with_special_names_name_to_value_presult;
1567 switch (state.protocolId()) {
1568 case apache::thrift::protocol::T_BINARY_PROTOCOL:
1569 {
1570 apache::thrift::BinaryProtocolReader reader;
1571 return apache::thrift::detail::ac::recv_wrapped<result>(
1572 &reader, state, _return);
1573 }
1574 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
1575 {
1576 apache::thrift::CompactProtocolReader reader;
1577 return apache::thrift::detail::ac::recv_wrapped<result>(
1578 &reader, state, _return);
1579 }
1580 default:
1581 {
1582 }
1583 }
1584 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
1585 }
1586
recv_name_to_value(::apache::thrift::ClientReceiveState & state)1587 ::std::int32_t service_with_special_namesAsyncClient::recv_name_to_value(::apache::thrift::ClientReceiveState& state) {
1588 ::std::int32_t _return;
1589 auto ew = recv_wrapped_name_to_value(_return, state);
1590 if (ew) {
1591 ew.throw_exception();
1592 }
1593 return _return;
1594 }
1595
recv_instance_name_to_value(::apache::thrift::ClientReceiveState & state)1596 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_name_to_value(::apache::thrift::ClientReceiveState& state) {
1597 return recv_name_to_value(state);
1598 }
1599
recv_instance_wrapped_name_to_value(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)1600 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_name_to_value(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
1601 return recv_wrapped_name_to_value(_return, state);
1602 }
1603
names(std::unique_ptr<apache::thrift::RequestCallback> callback)1604 void service_with_special_namesAsyncClient::names(std::unique_ptr<apache::thrift::RequestCallback> callback) {
1605 ::apache::thrift::RpcOptions rpcOptions;
1606 names(rpcOptions, std::move(callback));
1607 }
1608
names(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)1609 void service_with_special_namesAsyncClient::names(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
1610 auto [ctx, header] = namesCtx(&rpcOptions);
1611 apache::thrift::RequestCallback::Context callbackContext;
1612 callbackContext.protocolId =
1613 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
1614 auto* contextStack = ctx.get();
1615 if (callback) {
1616 callbackContext.ctx = std::move(ctx);
1617 }
1618 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
1619 namesImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
1620 }
1621
namesImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)1622 void service_with_special_namesAsyncClient::namesImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
1623 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
1624 case apache::thrift::protocol::T_BINARY_PROTOCOL:
1625 {
1626 apache::thrift::BinaryProtocolWriter writer;
1627 if (stealRpcOptions) {
1628 namesT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
1629 } else {
1630 namesT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
1631 }
1632 break;
1633 }
1634 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
1635 {
1636 apache::thrift::CompactProtocolWriter writer;
1637 if (stealRpcOptions) {
1638 namesT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
1639 } else {
1640 namesT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
1641 }
1642 break;
1643 }
1644 default:
1645 {
1646 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
1647 }
1648 }
1649 }
1650
namesCtx(apache::thrift::RpcOptions * rpcOptions)1651 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::namesCtx(apache::thrift::RpcOptions* rpcOptions) {
1652 auto header = std::make_shared<apache::thrift::transport::THeader>(
1653 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
1654 header->setProtocolId(channel_->getProtocolId());
1655 if (rpcOptions) {
1656 header->setHeaders(rpcOptions->releaseWriteHeaders());
1657 }
1658
1659 auto ctx = apache::thrift::ContextStack::createWithClientContext(
1660 handlers_,
1661 getServiceName(),
1662 "service_with_special_names.names",
1663 *header);
1664
1665 return {std::move(ctx), std::move(header)};
1666 }
1667
sync_names()1668 ::std::int32_t service_with_special_namesAsyncClient::sync_names() {
1669 ::apache::thrift::RpcOptions rpcOptions;
1670 return sync_names(rpcOptions);
1671 }
1672
sync_names(apache::thrift::RpcOptions & rpcOptions)1673 ::std::int32_t service_with_special_namesAsyncClient::sync_names(apache::thrift::RpcOptions& rpcOptions) {
1674 apache::thrift::ClientReceiveState returnState;
1675 apache::thrift::ClientSyncCallback<false> callback(&returnState);
1676 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
1677 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
1678 auto ctxAndHeader = namesCtx(&rpcOptions);
1679 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
1680 callback.waitUntilDone(
1681 evb,
1682 [&] {
1683 namesImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
1684 });
1685
1686 if (returnState.isException()) {
1687 returnState.exception().throw_exception();
1688 }
1689 returnState.resetProtocolId(protocolId);
1690 returnState.resetCtx(std::move(ctxAndHeader.first));
1691 SCOPE_EXIT {
1692 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
1693 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
1694 }
1695 };
1696 return folly::fibers::runInMainContext([&] {
1697 return recv_names(returnState);
1698 });
1699 }
1700
1701
future_names()1702 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_names() {
1703 ::apache::thrift::RpcOptions rpcOptions;
1704 return future_names(rpcOptions);
1705 }
1706
semifuture_names()1707 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_names() {
1708 ::apache::thrift::RpcOptions rpcOptions;
1709 return semifuture_names(rpcOptions);
1710 }
1711
future_names(apache::thrift::RpcOptions & rpcOptions)1712 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_names(apache::thrift::RpcOptions& rpcOptions) {
1713 folly::Promise<::std::int32_t> promise;
1714 auto future = promise.getFuture();
1715 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_names, channel_);
1716 names(rpcOptions, std::move(callback));
1717 return future;
1718 }
1719
semifuture_names(apache::thrift::RpcOptions & rpcOptions)1720 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_names(apache::thrift::RpcOptions& rpcOptions) {
1721 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_names, channel_);
1722 auto callback = std::move(callbackAndFuture.first);
1723 names(rpcOptions, std::move(callback));
1724 return std::move(callbackAndFuture.second);
1725 }
1726
header_future_names(apache::thrift::RpcOptions & rpcOptions)1727 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_names(apache::thrift::RpcOptions& rpcOptions) {
1728 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
1729 auto future = promise.getFuture();
1730 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_names, channel_);
1731 names(rpcOptions, std::move(callback));
1732 return future;
1733 }
1734
header_semifuture_names(apache::thrift::RpcOptions & rpcOptions)1735 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_names(apache::thrift::RpcOptions& rpcOptions) {
1736 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_names, channel_);
1737 auto callback = std::move(callbackAndFuture.first);
1738 names(rpcOptions, std::move(callback));
1739 return std::move(callbackAndFuture.second);
1740 }
1741
names(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)1742 void service_with_special_namesAsyncClient::names(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
1743 names(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
1744 }
1745
1746 #if FOLLY_HAS_COROUTINES
1747 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_names(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)1748 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_names(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
1749 if (state.isException()) {
1750 return std::move(state.exception());
1751 }
1752 if (!state.hasResponseBuffer()) {
1753 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
1754 }
1755
1756 using result = service_with_special_names_names_presult;
1757 switch (state.protocolId()) {
1758 case apache::thrift::protocol::T_BINARY_PROTOCOL:
1759 {
1760 apache::thrift::BinaryProtocolReader reader;
1761 return apache::thrift::detail::ac::recv_wrapped<result>(
1762 &reader, state, _return);
1763 }
1764 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
1765 {
1766 apache::thrift::CompactProtocolReader reader;
1767 return apache::thrift::detail::ac::recv_wrapped<result>(
1768 &reader, state, _return);
1769 }
1770 default:
1771 {
1772 }
1773 }
1774 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
1775 }
1776
recv_names(::apache::thrift::ClientReceiveState & state)1777 ::std::int32_t service_with_special_namesAsyncClient::recv_names(::apache::thrift::ClientReceiveState& state) {
1778 ::std::int32_t _return;
1779 auto ew = recv_wrapped_names(_return, state);
1780 if (ew) {
1781 ew.throw_exception();
1782 }
1783 return _return;
1784 }
1785
recv_instance_names(::apache::thrift::ClientReceiveState & state)1786 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_names(::apache::thrift::ClientReceiveState& state) {
1787 return recv_names(state);
1788 }
1789
recv_instance_wrapped_names(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)1790 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_names(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
1791 return recv_wrapped_names(_return, state);
1792 }
1793
prefix_tree(std::unique_ptr<apache::thrift::RequestCallback> callback)1794 void service_with_special_namesAsyncClient::prefix_tree(std::unique_ptr<apache::thrift::RequestCallback> callback) {
1795 ::apache::thrift::RpcOptions rpcOptions;
1796 prefix_tree(rpcOptions, std::move(callback));
1797 }
1798
prefix_tree(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)1799 void service_with_special_namesAsyncClient::prefix_tree(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
1800 auto [ctx, header] = prefix_treeCtx(&rpcOptions);
1801 apache::thrift::RequestCallback::Context callbackContext;
1802 callbackContext.protocolId =
1803 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
1804 auto* contextStack = ctx.get();
1805 if (callback) {
1806 callbackContext.ctx = std::move(ctx);
1807 }
1808 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
1809 prefix_treeImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
1810 }
1811
prefix_treeImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)1812 void service_with_special_namesAsyncClient::prefix_treeImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
1813 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
1814 case apache::thrift::protocol::T_BINARY_PROTOCOL:
1815 {
1816 apache::thrift::BinaryProtocolWriter writer;
1817 if (stealRpcOptions) {
1818 prefix_treeT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
1819 } else {
1820 prefix_treeT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
1821 }
1822 break;
1823 }
1824 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
1825 {
1826 apache::thrift::CompactProtocolWriter writer;
1827 if (stealRpcOptions) {
1828 prefix_treeT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
1829 } else {
1830 prefix_treeT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
1831 }
1832 break;
1833 }
1834 default:
1835 {
1836 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
1837 }
1838 }
1839 }
1840
prefix_treeCtx(apache::thrift::RpcOptions * rpcOptions)1841 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::prefix_treeCtx(apache::thrift::RpcOptions* rpcOptions) {
1842 auto header = std::make_shared<apache::thrift::transport::THeader>(
1843 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
1844 header->setProtocolId(channel_->getProtocolId());
1845 if (rpcOptions) {
1846 header->setHeaders(rpcOptions->releaseWriteHeaders());
1847 }
1848
1849 auto ctx = apache::thrift::ContextStack::createWithClientContext(
1850 handlers_,
1851 getServiceName(),
1852 "service_with_special_names.prefix_tree",
1853 *header);
1854
1855 return {std::move(ctx), std::move(header)};
1856 }
1857
sync_prefix_tree()1858 ::std::int32_t service_with_special_namesAsyncClient::sync_prefix_tree() {
1859 ::apache::thrift::RpcOptions rpcOptions;
1860 return sync_prefix_tree(rpcOptions);
1861 }
1862
sync_prefix_tree(apache::thrift::RpcOptions & rpcOptions)1863 ::std::int32_t service_with_special_namesAsyncClient::sync_prefix_tree(apache::thrift::RpcOptions& rpcOptions) {
1864 apache::thrift::ClientReceiveState returnState;
1865 apache::thrift::ClientSyncCallback<false> callback(&returnState);
1866 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
1867 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
1868 auto ctxAndHeader = prefix_treeCtx(&rpcOptions);
1869 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
1870 callback.waitUntilDone(
1871 evb,
1872 [&] {
1873 prefix_treeImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
1874 });
1875
1876 if (returnState.isException()) {
1877 returnState.exception().throw_exception();
1878 }
1879 returnState.resetProtocolId(protocolId);
1880 returnState.resetCtx(std::move(ctxAndHeader.first));
1881 SCOPE_EXIT {
1882 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
1883 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
1884 }
1885 };
1886 return folly::fibers::runInMainContext([&] {
1887 return recv_prefix_tree(returnState);
1888 });
1889 }
1890
1891
future_prefix_tree()1892 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_prefix_tree() {
1893 ::apache::thrift::RpcOptions rpcOptions;
1894 return future_prefix_tree(rpcOptions);
1895 }
1896
semifuture_prefix_tree()1897 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_prefix_tree() {
1898 ::apache::thrift::RpcOptions rpcOptions;
1899 return semifuture_prefix_tree(rpcOptions);
1900 }
1901
future_prefix_tree(apache::thrift::RpcOptions & rpcOptions)1902 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_prefix_tree(apache::thrift::RpcOptions& rpcOptions) {
1903 folly::Promise<::std::int32_t> promise;
1904 auto future = promise.getFuture();
1905 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_prefix_tree, channel_);
1906 prefix_tree(rpcOptions, std::move(callback));
1907 return future;
1908 }
1909
semifuture_prefix_tree(apache::thrift::RpcOptions & rpcOptions)1910 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_prefix_tree(apache::thrift::RpcOptions& rpcOptions) {
1911 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_prefix_tree, channel_);
1912 auto callback = std::move(callbackAndFuture.first);
1913 prefix_tree(rpcOptions, std::move(callback));
1914 return std::move(callbackAndFuture.second);
1915 }
1916
header_future_prefix_tree(apache::thrift::RpcOptions & rpcOptions)1917 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_prefix_tree(apache::thrift::RpcOptions& rpcOptions) {
1918 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
1919 auto future = promise.getFuture();
1920 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_prefix_tree, channel_);
1921 prefix_tree(rpcOptions, std::move(callback));
1922 return future;
1923 }
1924
header_semifuture_prefix_tree(apache::thrift::RpcOptions & rpcOptions)1925 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_prefix_tree(apache::thrift::RpcOptions& rpcOptions) {
1926 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_prefix_tree, channel_);
1927 auto callback = std::move(callbackAndFuture.first);
1928 prefix_tree(rpcOptions, std::move(callback));
1929 return std::move(callbackAndFuture.second);
1930 }
1931
prefix_tree(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)1932 void service_with_special_namesAsyncClient::prefix_tree(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
1933 prefix_tree(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
1934 }
1935
1936 #if FOLLY_HAS_COROUTINES
1937 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_prefix_tree(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)1938 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_prefix_tree(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
1939 if (state.isException()) {
1940 return std::move(state.exception());
1941 }
1942 if (!state.hasResponseBuffer()) {
1943 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
1944 }
1945
1946 using result = service_with_special_names_prefix_tree_presult;
1947 switch (state.protocolId()) {
1948 case apache::thrift::protocol::T_BINARY_PROTOCOL:
1949 {
1950 apache::thrift::BinaryProtocolReader reader;
1951 return apache::thrift::detail::ac::recv_wrapped<result>(
1952 &reader, state, _return);
1953 }
1954 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
1955 {
1956 apache::thrift::CompactProtocolReader reader;
1957 return apache::thrift::detail::ac::recv_wrapped<result>(
1958 &reader, state, _return);
1959 }
1960 default:
1961 {
1962 }
1963 }
1964 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
1965 }
1966
recv_prefix_tree(::apache::thrift::ClientReceiveState & state)1967 ::std::int32_t service_with_special_namesAsyncClient::recv_prefix_tree(::apache::thrift::ClientReceiveState& state) {
1968 ::std::int32_t _return;
1969 auto ew = recv_wrapped_prefix_tree(_return, state);
1970 if (ew) {
1971 ew.throw_exception();
1972 }
1973 return _return;
1974 }
1975
recv_instance_prefix_tree(::apache::thrift::ClientReceiveState & state)1976 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_prefix_tree(::apache::thrift::ClientReceiveState& state) {
1977 return recv_prefix_tree(state);
1978 }
1979
recv_instance_wrapped_prefix_tree(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)1980 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_prefix_tree(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
1981 return recv_wrapped_prefix_tree(_return, state);
1982 }
1983
sets(std::unique_ptr<apache::thrift::RequestCallback> callback)1984 void service_with_special_namesAsyncClient::sets(std::unique_ptr<apache::thrift::RequestCallback> callback) {
1985 ::apache::thrift::RpcOptions rpcOptions;
1986 sets(rpcOptions, std::move(callback));
1987 }
1988
sets(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)1989 void service_with_special_namesAsyncClient::sets(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
1990 auto [ctx, header] = setsCtx(&rpcOptions);
1991 apache::thrift::RequestCallback::Context callbackContext;
1992 callbackContext.protocolId =
1993 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
1994 auto* contextStack = ctx.get();
1995 if (callback) {
1996 callbackContext.ctx = std::move(ctx);
1997 }
1998 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
1999 setsImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
2000 }
2001
setsImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)2002 void service_with_special_namesAsyncClient::setsImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
2003 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
2004 case apache::thrift::protocol::T_BINARY_PROTOCOL:
2005 {
2006 apache::thrift::BinaryProtocolWriter writer;
2007 if (stealRpcOptions) {
2008 setsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
2009 } else {
2010 setsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
2011 }
2012 break;
2013 }
2014 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
2015 {
2016 apache::thrift::CompactProtocolWriter writer;
2017 if (stealRpcOptions) {
2018 setsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
2019 } else {
2020 setsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
2021 }
2022 break;
2023 }
2024 default:
2025 {
2026 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
2027 }
2028 }
2029 }
2030
setsCtx(apache::thrift::RpcOptions * rpcOptions)2031 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::setsCtx(apache::thrift::RpcOptions* rpcOptions) {
2032 auto header = std::make_shared<apache::thrift::transport::THeader>(
2033 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
2034 header->setProtocolId(channel_->getProtocolId());
2035 if (rpcOptions) {
2036 header->setHeaders(rpcOptions->releaseWriteHeaders());
2037 }
2038
2039 auto ctx = apache::thrift::ContextStack::createWithClientContext(
2040 handlers_,
2041 getServiceName(),
2042 "service_with_special_names.sets",
2043 *header);
2044
2045 return {std::move(ctx), std::move(header)};
2046 }
2047
sync_sets()2048 ::std::int32_t service_with_special_namesAsyncClient::sync_sets() {
2049 ::apache::thrift::RpcOptions rpcOptions;
2050 return sync_sets(rpcOptions);
2051 }
2052
sync_sets(apache::thrift::RpcOptions & rpcOptions)2053 ::std::int32_t service_with_special_namesAsyncClient::sync_sets(apache::thrift::RpcOptions& rpcOptions) {
2054 apache::thrift::ClientReceiveState returnState;
2055 apache::thrift::ClientSyncCallback<false> callback(&returnState);
2056 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
2057 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
2058 auto ctxAndHeader = setsCtx(&rpcOptions);
2059 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
2060 callback.waitUntilDone(
2061 evb,
2062 [&] {
2063 setsImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
2064 });
2065
2066 if (returnState.isException()) {
2067 returnState.exception().throw_exception();
2068 }
2069 returnState.resetProtocolId(protocolId);
2070 returnState.resetCtx(std::move(ctxAndHeader.first));
2071 SCOPE_EXIT {
2072 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
2073 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
2074 }
2075 };
2076 return folly::fibers::runInMainContext([&] {
2077 return recv_sets(returnState);
2078 });
2079 }
2080
2081
future_sets()2082 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_sets() {
2083 ::apache::thrift::RpcOptions rpcOptions;
2084 return future_sets(rpcOptions);
2085 }
2086
semifuture_sets()2087 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_sets() {
2088 ::apache::thrift::RpcOptions rpcOptions;
2089 return semifuture_sets(rpcOptions);
2090 }
2091
future_sets(apache::thrift::RpcOptions & rpcOptions)2092 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_sets(apache::thrift::RpcOptions& rpcOptions) {
2093 folly::Promise<::std::int32_t> promise;
2094 auto future = promise.getFuture();
2095 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_sets, channel_);
2096 sets(rpcOptions, std::move(callback));
2097 return future;
2098 }
2099
semifuture_sets(apache::thrift::RpcOptions & rpcOptions)2100 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_sets(apache::thrift::RpcOptions& rpcOptions) {
2101 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_sets, channel_);
2102 auto callback = std::move(callbackAndFuture.first);
2103 sets(rpcOptions, std::move(callback));
2104 return std::move(callbackAndFuture.second);
2105 }
2106
header_future_sets(apache::thrift::RpcOptions & rpcOptions)2107 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_sets(apache::thrift::RpcOptions& rpcOptions) {
2108 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
2109 auto future = promise.getFuture();
2110 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_sets, channel_);
2111 sets(rpcOptions, std::move(callback));
2112 return future;
2113 }
2114
header_semifuture_sets(apache::thrift::RpcOptions & rpcOptions)2115 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_sets(apache::thrift::RpcOptions& rpcOptions) {
2116 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_sets, channel_);
2117 auto callback = std::move(callbackAndFuture.first);
2118 sets(rpcOptions, std::move(callback));
2119 return std::move(callbackAndFuture.second);
2120 }
2121
sets(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)2122 void service_with_special_namesAsyncClient::sets(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
2123 sets(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
2124 }
2125
2126 #if FOLLY_HAS_COROUTINES
2127 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_sets(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)2128 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_sets(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
2129 if (state.isException()) {
2130 return std::move(state.exception());
2131 }
2132 if (!state.hasResponseBuffer()) {
2133 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
2134 }
2135
2136 using result = service_with_special_names_sets_presult;
2137 switch (state.protocolId()) {
2138 case apache::thrift::protocol::T_BINARY_PROTOCOL:
2139 {
2140 apache::thrift::BinaryProtocolReader reader;
2141 return apache::thrift::detail::ac::recv_wrapped<result>(
2142 &reader, state, _return);
2143 }
2144 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
2145 {
2146 apache::thrift::CompactProtocolReader reader;
2147 return apache::thrift::detail::ac::recv_wrapped<result>(
2148 &reader, state, _return);
2149 }
2150 default:
2151 {
2152 }
2153 }
2154 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
2155 }
2156
recv_sets(::apache::thrift::ClientReceiveState & state)2157 ::std::int32_t service_with_special_namesAsyncClient::recv_sets(::apache::thrift::ClientReceiveState& state) {
2158 ::std::int32_t _return;
2159 auto ew = recv_wrapped_sets(_return, state);
2160 if (ew) {
2161 ew.throw_exception();
2162 }
2163 return _return;
2164 }
2165
recv_instance_sets(::apache::thrift::ClientReceiveState & state)2166 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_sets(::apache::thrift::ClientReceiveState& state) {
2167 return recv_sets(state);
2168 }
2169
recv_instance_wrapped_sets(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)2170 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_sets(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
2171 return recv_wrapped_sets(_return, state);
2172 }
2173
setter(std::unique_ptr<apache::thrift::RequestCallback> callback)2174 void service_with_special_namesAsyncClient::setter(std::unique_ptr<apache::thrift::RequestCallback> callback) {
2175 ::apache::thrift::RpcOptions rpcOptions;
2176 setter(rpcOptions, std::move(callback));
2177 }
2178
setter(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)2179 void service_with_special_namesAsyncClient::setter(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
2180 auto [ctx, header] = setterCtx(&rpcOptions);
2181 apache::thrift::RequestCallback::Context callbackContext;
2182 callbackContext.protocolId =
2183 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
2184 auto* contextStack = ctx.get();
2185 if (callback) {
2186 callbackContext.ctx = std::move(ctx);
2187 }
2188 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
2189 setterImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
2190 }
2191
setterImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)2192 void service_with_special_namesAsyncClient::setterImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
2193 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
2194 case apache::thrift::protocol::T_BINARY_PROTOCOL:
2195 {
2196 apache::thrift::BinaryProtocolWriter writer;
2197 if (stealRpcOptions) {
2198 setterT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
2199 } else {
2200 setterT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
2201 }
2202 break;
2203 }
2204 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
2205 {
2206 apache::thrift::CompactProtocolWriter writer;
2207 if (stealRpcOptions) {
2208 setterT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
2209 } else {
2210 setterT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
2211 }
2212 break;
2213 }
2214 default:
2215 {
2216 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
2217 }
2218 }
2219 }
2220
setterCtx(apache::thrift::RpcOptions * rpcOptions)2221 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::setterCtx(apache::thrift::RpcOptions* rpcOptions) {
2222 auto header = std::make_shared<apache::thrift::transport::THeader>(
2223 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
2224 header->setProtocolId(channel_->getProtocolId());
2225 if (rpcOptions) {
2226 header->setHeaders(rpcOptions->releaseWriteHeaders());
2227 }
2228
2229 auto ctx = apache::thrift::ContextStack::createWithClientContext(
2230 handlers_,
2231 getServiceName(),
2232 "service_with_special_names.setter",
2233 *header);
2234
2235 return {std::move(ctx), std::move(header)};
2236 }
2237
sync_setter()2238 ::std::int32_t service_with_special_namesAsyncClient::sync_setter() {
2239 ::apache::thrift::RpcOptions rpcOptions;
2240 return sync_setter(rpcOptions);
2241 }
2242
sync_setter(apache::thrift::RpcOptions & rpcOptions)2243 ::std::int32_t service_with_special_namesAsyncClient::sync_setter(apache::thrift::RpcOptions& rpcOptions) {
2244 apache::thrift::ClientReceiveState returnState;
2245 apache::thrift::ClientSyncCallback<false> callback(&returnState);
2246 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
2247 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
2248 auto ctxAndHeader = setterCtx(&rpcOptions);
2249 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
2250 callback.waitUntilDone(
2251 evb,
2252 [&] {
2253 setterImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
2254 });
2255
2256 if (returnState.isException()) {
2257 returnState.exception().throw_exception();
2258 }
2259 returnState.resetProtocolId(protocolId);
2260 returnState.resetCtx(std::move(ctxAndHeader.first));
2261 SCOPE_EXIT {
2262 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
2263 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
2264 }
2265 };
2266 return folly::fibers::runInMainContext([&] {
2267 return recv_setter(returnState);
2268 });
2269 }
2270
2271
future_setter()2272 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_setter() {
2273 ::apache::thrift::RpcOptions rpcOptions;
2274 return future_setter(rpcOptions);
2275 }
2276
semifuture_setter()2277 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_setter() {
2278 ::apache::thrift::RpcOptions rpcOptions;
2279 return semifuture_setter(rpcOptions);
2280 }
2281
future_setter(apache::thrift::RpcOptions & rpcOptions)2282 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_setter(apache::thrift::RpcOptions& rpcOptions) {
2283 folly::Promise<::std::int32_t> promise;
2284 auto future = promise.getFuture();
2285 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_setter, channel_);
2286 setter(rpcOptions, std::move(callback));
2287 return future;
2288 }
2289
semifuture_setter(apache::thrift::RpcOptions & rpcOptions)2290 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_setter(apache::thrift::RpcOptions& rpcOptions) {
2291 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_setter, channel_);
2292 auto callback = std::move(callbackAndFuture.first);
2293 setter(rpcOptions, std::move(callback));
2294 return std::move(callbackAndFuture.second);
2295 }
2296
header_future_setter(apache::thrift::RpcOptions & rpcOptions)2297 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_setter(apache::thrift::RpcOptions& rpcOptions) {
2298 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
2299 auto future = promise.getFuture();
2300 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_setter, channel_);
2301 setter(rpcOptions, std::move(callback));
2302 return future;
2303 }
2304
header_semifuture_setter(apache::thrift::RpcOptions & rpcOptions)2305 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_setter(apache::thrift::RpcOptions& rpcOptions) {
2306 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_setter, channel_);
2307 auto callback = std::move(callbackAndFuture.first);
2308 setter(rpcOptions, std::move(callback));
2309 return std::move(callbackAndFuture.second);
2310 }
2311
setter(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)2312 void service_with_special_namesAsyncClient::setter(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
2313 setter(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
2314 }
2315
2316 #if FOLLY_HAS_COROUTINES
2317 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_setter(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)2318 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_setter(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
2319 if (state.isException()) {
2320 return std::move(state.exception());
2321 }
2322 if (!state.hasResponseBuffer()) {
2323 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
2324 }
2325
2326 using result = service_with_special_names_setter_presult;
2327 switch (state.protocolId()) {
2328 case apache::thrift::protocol::T_BINARY_PROTOCOL:
2329 {
2330 apache::thrift::BinaryProtocolReader reader;
2331 return apache::thrift::detail::ac::recv_wrapped<result>(
2332 &reader, state, _return);
2333 }
2334 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
2335 {
2336 apache::thrift::CompactProtocolReader reader;
2337 return apache::thrift::detail::ac::recv_wrapped<result>(
2338 &reader, state, _return);
2339 }
2340 default:
2341 {
2342 }
2343 }
2344 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
2345 }
2346
recv_setter(::apache::thrift::ClientReceiveState & state)2347 ::std::int32_t service_with_special_namesAsyncClient::recv_setter(::apache::thrift::ClientReceiveState& state) {
2348 ::std::int32_t _return;
2349 auto ew = recv_wrapped_setter(_return, state);
2350 if (ew) {
2351 ew.throw_exception();
2352 }
2353 return _return;
2354 }
2355
recv_instance_setter(::apache::thrift::ClientReceiveState & state)2356 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_setter(::apache::thrift::ClientReceiveState& state) {
2357 return recv_setter(state);
2358 }
2359
recv_instance_wrapped_setter(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)2360 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_setter(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
2361 return recv_wrapped_setter(_return, state);
2362 }
2363
str(std::unique_ptr<apache::thrift::RequestCallback> callback)2364 void service_with_special_namesAsyncClient::str(std::unique_ptr<apache::thrift::RequestCallback> callback) {
2365 ::apache::thrift::RpcOptions rpcOptions;
2366 str(rpcOptions, std::move(callback));
2367 }
2368
str(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)2369 void service_with_special_namesAsyncClient::str(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
2370 auto [ctx, header] = strCtx(&rpcOptions);
2371 apache::thrift::RequestCallback::Context callbackContext;
2372 callbackContext.protocolId =
2373 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
2374 auto* contextStack = ctx.get();
2375 if (callback) {
2376 callbackContext.ctx = std::move(ctx);
2377 }
2378 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
2379 strImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
2380 }
2381
strImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)2382 void service_with_special_namesAsyncClient::strImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
2383 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
2384 case apache::thrift::protocol::T_BINARY_PROTOCOL:
2385 {
2386 apache::thrift::BinaryProtocolWriter writer;
2387 if (stealRpcOptions) {
2388 strT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
2389 } else {
2390 strT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
2391 }
2392 break;
2393 }
2394 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
2395 {
2396 apache::thrift::CompactProtocolWriter writer;
2397 if (stealRpcOptions) {
2398 strT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
2399 } else {
2400 strT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
2401 }
2402 break;
2403 }
2404 default:
2405 {
2406 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
2407 }
2408 }
2409 }
2410
strCtx(apache::thrift::RpcOptions * rpcOptions)2411 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::strCtx(apache::thrift::RpcOptions* rpcOptions) {
2412 auto header = std::make_shared<apache::thrift::transport::THeader>(
2413 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
2414 header->setProtocolId(channel_->getProtocolId());
2415 if (rpcOptions) {
2416 header->setHeaders(rpcOptions->releaseWriteHeaders());
2417 }
2418
2419 auto ctx = apache::thrift::ContextStack::createWithClientContext(
2420 handlers_,
2421 getServiceName(),
2422 "service_with_special_names.str",
2423 *header);
2424
2425 return {std::move(ctx), std::move(header)};
2426 }
2427
sync_str()2428 ::std::int32_t service_with_special_namesAsyncClient::sync_str() {
2429 ::apache::thrift::RpcOptions rpcOptions;
2430 return sync_str(rpcOptions);
2431 }
2432
sync_str(apache::thrift::RpcOptions & rpcOptions)2433 ::std::int32_t service_with_special_namesAsyncClient::sync_str(apache::thrift::RpcOptions& rpcOptions) {
2434 apache::thrift::ClientReceiveState returnState;
2435 apache::thrift::ClientSyncCallback<false> callback(&returnState);
2436 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
2437 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
2438 auto ctxAndHeader = strCtx(&rpcOptions);
2439 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
2440 callback.waitUntilDone(
2441 evb,
2442 [&] {
2443 strImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
2444 });
2445
2446 if (returnState.isException()) {
2447 returnState.exception().throw_exception();
2448 }
2449 returnState.resetProtocolId(protocolId);
2450 returnState.resetCtx(std::move(ctxAndHeader.first));
2451 SCOPE_EXIT {
2452 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
2453 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
2454 }
2455 };
2456 return folly::fibers::runInMainContext([&] {
2457 return recv_str(returnState);
2458 });
2459 }
2460
2461
future_str()2462 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_str() {
2463 ::apache::thrift::RpcOptions rpcOptions;
2464 return future_str(rpcOptions);
2465 }
2466
semifuture_str()2467 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_str() {
2468 ::apache::thrift::RpcOptions rpcOptions;
2469 return semifuture_str(rpcOptions);
2470 }
2471
future_str(apache::thrift::RpcOptions & rpcOptions)2472 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_str(apache::thrift::RpcOptions& rpcOptions) {
2473 folly::Promise<::std::int32_t> promise;
2474 auto future = promise.getFuture();
2475 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_str, channel_);
2476 str(rpcOptions, std::move(callback));
2477 return future;
2478 }
2479
semifuture_str(apache::thrift::RpcOptions & rpcOptions)2480 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_str(apache::thrift::RpcOptions& rpcOptions) {
2481 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_str, channel_);
2482 auto callback = std::move(callbackAndFuture.first);
2483 str(rpcOptions, std::move(callback));
2484 return std::move(callbackAndFuture.second);
2485 }
2486
header_future_str(apache::thrift::RpcOptions & rpcOptions)2487 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_str(apache::thrift::RpcOptions& rpcOptions) {
2488 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
2489 auto future = promise.getFuture();
2490 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_str, channel_);
2491 str(rpcOptions, std::move(callback));
2492 return future;
2493 }
2494
header_semifuture_str(apache::thrift::RpcOptions & rpcOptions)2495 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_str(apache::thrift::RpcOptions& rpcOptions) {
2496 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_str, channel_);
2497 auto callback = std::move(callbackAndFuture.first);
2498 str(rpcOptions, std::move(callback));
2499 return std::move(callbackAndFuture.second);
2500 }
2501
str(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)2502 void service_with_special_namesAsyncClient::str(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
2503 str(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
2504 }
2505
2506 #if FOLLY_HAS_COROUTINES
2507 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_str(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)2508 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_str(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
2509 if (state.isException()) {
2510 return std::move(state.exception());
2511 }
2512 if (!state.hasResponseBuffer()) {
2513 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
2514 }
2515
2516 using result = service_with_special_names_str_presult;
2517 switch (state.protocolId()) {
2518 case apache::thrift::protocol::T_BINARY_PROTOCOL:
2519 {
2520 apache::thrift::BinaryProtocolReader reader;
2521 return apache::thrift::detail::ac::recv_wrapped<result>(
2522 &reader, state, _return);
2523 }
2524 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
2525 {
2526 apache::thrift::CompactProtocolReader reader;
2527 return apache::thrift::detail::ac::recv_wrapped<result>(
2528 &reader, state, _return);
2529 }
2530 default:
2531 {
2532 }
2533 }
2534 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
2535 }
2536
recv_str(::apache::thrift::ClientReceiveState & state)2537 ::std::int32_t service_with_special_namesAsyncClient::recv_str(::apache::thrift::ClientReceiveState& state) {
2538 ::std::int32_t _return;
2539 auto ew = recv_wrapped_str(_return, state);
2540 if (ew) {
2541 ew.throw_exception();
2542 }
2543 return _return;
2544 }
2545
recv_instance_str(::apache::thrift::ClientReceiveState & state)2546 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_str(::apache::thrift::ClientReceiveState& state) {
2547 return recv_str(state);
2548 }
2549
recv_instance_wrapped_str(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)2550 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_str(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
2551 return recv_wrapped_str(_return, state);
2552 }
2553
strings(std::unique_ptr<apache::thrift::RequestCallback> callback)2554 void service_with_special_namesAsyncClient::strings(std::unique_ptr<apache::thrift::RequestCallback> callback) {
2555 ::apache::thrift::RpcOptions rpcOptions;
2556 strings(rpcOptions, std::move(callback));
2557 }
2558
strings(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)2559 void service_with_special_namesAsyncClient::strings(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
2560 auto [ctx, header] = stringsCtx(&rpcOptions);
2561 apache::thrift::RequestCallback::Context callbackContext;
2562 callbackContext.protocolId =
2563 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
2564 auto* contextStack = ctx.get();
2565 if (callback) {
2566 callbackContext.ctx = std::move(ctx);
2567 }
2568 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
2569 stringsImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
2570 }
2571
stringsImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)2572 void service_with_special_namesAsyncClient::stringsImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
2573 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
2574 case apache::thrift::protocol::T_BINARY_PROTOCOL:
2575 {
2576 apache::thrift::BinaryProtocolWriter writer;
2577 if (stealRpcOptions) {
2578 stringsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
2579 } else {
2580 stringsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
2581 }
2582 break;
2583 }
2584 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
2585 {
2586 apache::thrift::CompactProtocolWriter writer;
2587 if (stealRpcOptions) {
2588 stringsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
2589 } else {
2590 stringsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
2591 }
2592 break;
2593 }
2594 default:
2595 {
2596 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
2597 }
2598 }
2599 }
2600
stringsCtx(apache::thrift::RpcOptions * rpcOptions)2601 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::stringsCtx(apache::thrift::RpcOptions* rpcOptions) {
2602 auto header = std::make_shared<apache::thrift::transport::THeader>(
2603 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
2604 header->setProtocolId(channel_->getProtocolId());
2605 if (rpcOptions) {
2606 header->setHeaders(rpcOptions->releaseWriteHeaders());
2607 }
2608
2609 auto ctx = apache::thrift::ContextStack::createWithClientContext(
2610 handlers_,
2611 getServiceName(),
2612 "service_with_special_names.strings",
2613 *header);
2614
2615 return {std::move(ctx), std::move(header)};
2616 }
2617
sync_strings()2618 ::std::int32_t service_with_special_namesAsyncClient::sync_strings() {
2619 ::apache::thrift::RpcOptions rpcOptions;
2620 return sync_strings(rpcOptions);
2621 }
2622
sync_strings(apache::thrift::RpcOptions & rpcOptions)2623 ::std::int32_t service_with_special_namesAsyncClient::sync_strings(apache::thrift::RpcOptions& rpcOptions) {
2624 apache::thrift::ClientReceiveState returnState;
2625 apache::thrift::ClientSyncCallback<false> callback(&returnState);
2626 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
2627 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
2628 auto ctxAndHeader = stringsCtx(&rpcOptions);
2629 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
2630 callback.waitUntilDone(
2631 evb,
2632 [&] {
2633 stringsImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
2634 });
2635
2636 if (returnState.isException()) {
2637 returnState.exception().throw_exception();
2638 }
2639 returnState.resetProtocolId(protocolId);
2640 returnState.resetCtx(std::move(ctxAndHeader.first));
2641 SCOPE_EXIT {
2642 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
2643 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
2644 }
2645 };
2646 return folly::fibers::runInMainContext([&] {
2647 return recv_strings(returnState);
2648 });
2649 }
2650
2651
future_strings()2652 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_strings() {
2653 ::apache::thrift::RpcOptions rpcOptions;
2654 return future_strings(rpcOptions);
2655 }
2656
semifuture_strings()2657 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_strings() {
2658 ::apache::thrift::RpcOptions rpcOptions;
2659 return semifuture_strings(rpcOptions);
2660 }
2661
future_strings(apache::thrift::RpcOptions & rpcOptions)2662 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_strings(apache::thrift::RpcOptions& rpcOptions) {
2663 folly::Promise<::std::int32_t> promise;
2664 auto future = promise.getFuture();
2665 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_strings, channel_);
2666 strings(rpcOptions, std::move(callback));
2667 return future;
2668 }
2669
semifuture_strings(apache::thrift::RpcOptions & rpcOptions)2670 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_strings(apache::thrift::RpcOptions& rpcOptions) {
2671 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_strings, channel_);
2672 auto callback = std::move(callbackAndFuture.first);
2673 strings(rpcOptions, std::move(callback));
2674 return std::move(callbackAndFuture.second);
2675 }
2676
header_future_strings(apache::thrift::RpcOptions & rpcOptions)2677 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_strings(apache::thrift::RpcOptions& rpcOptions) {
2678 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
2679 auto future = promise.getFuture();
2680 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_strings, channel_);
2681 strings(rpcOptions, std::move(callback));
2682 return future;
2683 }
2684
header_semifuture_strings(apache::thrift::RpcOptions & rpcOptions)2685 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_strings(apache::thrift::RpcOptions& rpcOptions) {
2686 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_strings, channel_);
2687 auto callback = std::move(callbackAndFuture.first);
2688 strings(rpcOptions, std::move(callback));
2689 return std::move(callbackAndFuture.second);
2690 }
2691
strings(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)2692 void service_with_special_namesAsyncClient::strings(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
2693 strings(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
2694 }
2695
2696 #if FOLLY_HAS_COROUTINES
2697 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_strings(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)2698 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_strings(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
2699 if (state.isException()) {
2700 return std::move(state.exception());
2701 }
2702 if (!state.hasResponseBuffer()) {
2703 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
2704 }
2705
2706 using result = service_with_special_names_strings_presult;
2707 switch (state.protocolId()) {
2708 case apache::thrift::protocol::T_BINARY_PROTOCOL:
2709 {
2710 apache::thrift::BinaryProtocolReader reader;
2711 return apache::thrift::detail::ac::recv_wrapped<result>(
2712 &reader, state, _return);
2713 }
2714 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
2715 {
2716 apache::thrift::CompactProtocolReader reader;
2717 return apache::thrift::detail::ac::recv_wrapped<result>(
2718 &reader, state, _return);
2719 }
2720 default:
2721 {
2722 }
2723 }
2724 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
2725 }
2726
recv_strings(::apache::thrift::ClientReceiveState & state)2727 ::std::int32_t service_with_special_namesAsyncClient::recv_strings(::apache::thrift::ClientReceiveState& state) {
2728 ::std::int32_t _return;
2729 auto ew = recv_wrapped_strings(_return, state);
2730 if (ew) {
2731 ew.throw_exception();
2732 }
2733 return _return;
2734 }
2735
recv_instance_strings(::apache::thrift::ClientReceiveState & state)2736 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_strings(::apache::thrift::ClientReceiveState& state) {
2737 return recv_strings(state);
2738 }
2739
recv_instance_wrapped_strings(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)2740 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_strings(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
2741 return recv_wrapped_strings(_return, state);
2742 }
2743
type(std::unique_ptr<apache::thrift::RequestCallback> callback)2744 void service_with_special_namesAsyncClient::type(std::unique_ptr<apache::thrift::RequestCallback> callback) {
2745 ::apache::thrift::RpcOptions rpcOptions;
2746 type(rpcOptions, std::move(callback));
2747 }
2748
type(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)2749 void service_with_special_namesAsyncClient::type(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
2750 auto [ctx, header] = typeCtx(&rpcOptions);
2751 apache::thrift::RequestCallback::Context callbackContext;
2752 callbackContext.protocolId =
2753 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
2754 auto* contextStack = ctx.get();
2755 if (callback) {
2756 callbackContext.ctx = std::move(ctx);
2757 }
2758 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
2759 typeImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
2760 }
2761
typeImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)2762 void service_with_special_namesAsyncClient::typeImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
2763 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
2764 case apache::thrift::protocol::T_BINARY_PROTOCOL:
2765 {
2766 apache::thrift::BinaryProtocolWriter writer;
2767 if (stealRpcOptions) {
2768 typeT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
2769 } else {
2770 typeT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
2771 }
2772 break;
2773 }
2774 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
2775 {
2776 apache::thrift::CompactProtocolWriter writer;
2777 if (stealRpcOptions) {
2778 typeT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
2779 } else {
2780 typeT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
2781 }
2782 break;
2783 }
2784 default:
2785 {
2786 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
2787 }
2788 }
2789 }
2790
typeCtx(apache::thrift::RpcOptions * rpcOptions)2791 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::typeCtx(apache::thrift::RpcOptions* rpcOptions) {
2792 auto header = std::make_shared<apache::thrift::transport::THeader>(
2793 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
2794 header->setProtocolId(channel_->getProtocolId());
2795 if (rpcOptions) {
2796 header->setHeaders(rpcOptions->releaseWriteHeaders());
2797 }
2798
2799 auto ctx = apache::thrift::ContextStack::createWithClientContext(
2800 handlers_,
2801 getServiceName(),
2802 "service_with_special_names.type",
2803 *header);
2804
2805 return {std::move(ctx), std::move(header)};
2806 }
2807
sync_type()2808 ::std::int32_t service_with_special_namesAsyncClient::sync_type() {
2809 ::apache::thrift::RpcOptions rpcOptions;
2810 return sync_type(rpcOptions);
2811 }
2812
sync_type(apache::thrift::RpcOptions & rpcOptions)2813 ::std::int32_t service_with_special_namesAsyncClient::sync_type(apache::thrift::RpcOptions& rpcOptions) {
2814 apache::thrift::ClientReceiveState returnState;
2815 apache::thrift::ClientSyncCallback<false> callback(&returnState);
2816 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
2817 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
2818 auto ctxAndHeader = typeCtx(&rpcOptions);
2819 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
2820 callback.waitUntilDone(
2821 evb,
2822 [&] {
2823 typeImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
2824 });
2825
2826 if (returnState.isException()) {
2827 returnState.exception().throw_exception();
2828 }
2829 returnState.resetProtocolId(protocolId);
2830 returnState.resetCtx(std::move(ctxAndHeader.first));
2831 SCOPE_EXIT {
2832 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
2833 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
2834 }
2835 };
2836 return folly::fibers::runInMainContext([&] {
2837 return recv_type(returnState);
2838 });
2839 }
2840
2841
future_type()2842 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_type() {
2843 ::apache::thrift::RpcOptions rpcOptions;
2844 return future_type(rpcOptions);
2845 }
2846
semifuture_type()2847 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_type() {
2848 ::apache::thrift::RpcOptions rpcOptions;
2849 return semifuture_type(rpcOptions);
2850 }
2851
future_type(apache::thrift::RpcOptions & rpcOptions)2852 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_type(apache::thrift::RpcOptions& rpcOptions) {
2853 folly::Promise<::std::int32_t> promise;
2854 auto future = promise.getFuture();
2855 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_type, channel_);
2856 type(rpcOptions, std::move(callback));
2857 return future;
2858 }
2859
semifuture_type(apache::thrift::RpcOptions & rpcOptions)2860 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_type(apache::thrift::RpcOptions& rpcOptions) {
2861 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_type, channel_);
2862 auto callback = std::move(callbackAndFuture.first);
2863 type(rpcOptions, std::move(callback));
2864 return std::move(callbackAndFuture.second);
2865 }
2866
header_future_type(apache::thrift::RpcOptions & rpcOptions)2867 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_type(apache::thrift::RpcOptions& rpcOptions) {
2868 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
2869 auto future = promise.getFuture();
2870 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_type, channel_);
2871 type(rpcOptions, std::move(callback));
2872 return future;
2873 }
2874
header_semifuture_type(apache::thrift::RpcOptions & rpcOptions)2875 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_type(apache::thrift::RpcOptions& rpcOptions) {
2876 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_type, channel_);
2877 auto callback = std::move(callbackAndFuture.first);
2878 type(rpcOptions, std::move(callback));
2879 return std::move(callbackAndFuture.second);
2880 }
2881
type(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)2882 void service_with_special_namesAsyncClient::type(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
2883 type(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
2884 }
2885
2886 #if FOLLY_HAS_COROUTINES
2887 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_type(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)2888 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_type(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
2889 if (state.isException()) {
2890 return std::move(state.exception());
2891 }
2892 if (!state.hasResponseBuffer()) {
2893 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
2894 }
2895
2896 using result = service_with_special_names_type_presult;
2897 switch (state.protocolId()) {
2898 case apache::thrift::protocol::T_BINARY_PROTOCOL:
2899 {
2900 apache::thrift::BinaryProtocolReader reader;
2901 return apache::thrift::detail::ac::recv_wrapped<result>(
2902 &reader, state, _return);
2903 }
2904 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
2905 {
2906 apache::thrift::CompactProtocolReader reader;
2907 return apache::thrift::detail::ac::recv_wrapped<result>(
2908 &reader, state, _return);
2909 }
2910 default:
2911 {
2912 }
2913 }
2914 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
2915 }
2916
recv_type(::apache::thrift::ClientReceiveState & state)2917 ::std::int32_t service_with_special_namesAsyncClient::recv_type(::apache::thrift::ClientReceiveState& state) {
2918 ::std::int32_t _return;
2919 auto ew = recv_wrapped_type(_return, state);
2920 if (ew) {
2921 ew.throw_exception();
2922 }
2923 return _return;
2924 }
2925
recv_instance_type(::apache::thrift::ClientReceiveState & state)2926 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_type(::apache::thrift::ClientReceiveState& state) {
2927 return recv_type(state);
2928 }
2929
recv_instance_wrapped_type(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)2930 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_type(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
2931 return recv_wrapped_type(_return, state);
2932 }
2933
value(std::unique_ptr<apache::thrift::RequestCallback> callback)2934 void service_with_special_namesAsyncClient::value(std::unique_ptr<apache::thrift::RequestCallback> callback) {
2935 ::apache::thrift::RpcOptions rpcOptions;
2936 value(rpcOptions, std::move(callback));
2937 }
2938
value(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)2939 void service_with_special_namesAsyncClient::value(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
2940 auto [ctx, header] = valueCtx(&rpcOptions);
2941 apache::thrift::RequestCallback::Context callbackContext;
2942 callbackContext.protocolId =
2943 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
2944 auto* contextStack = ctx.get();
2945 if (callback) {
2946 callbackContext.ctx = std::move(ctx);
2947 }
2948 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
2949 valueImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
2950 }
2951
valueImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)2952 void service_with_special_namesAsyncClient::valueImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
2953 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
2954 case apache::thrift::protocol::T_BINARY_PROTOCOL:
2955 {
2956 apache::thrift::BinaryProtocolWriter writer;
2957 if (stealRpcOptions) {
2958 valueT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
2959 } else {
2960 valueT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
2961 }
2962 break;
2963 }
2964 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
2965 {
2966 apache::thrift::CompactProtocolWriter writer;
2967 if (stealRpcOptions) {
2968 valueT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
2969 } else {
2970 valueT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
2971 }
2972 break;
2973 }
2974 default:
2975 {
2976 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
2977 }
2978 }
2979 }
2980
valueCtx(apache::thrift::RpcOptions * rpcOptions)2981 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::valueCtx(apache::thrift::RpcOptions* rpcOptions) {
2982 auto header = std::make_shared<apache::thrift::transport::THeader>(
2983 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
2984 header->setProtocolId(channel_->getProtocolId());
2985 if (rpcOptions) {
2986 header->setHeaders(rpcOptions->releaseWriteHeaders());
2987 }
2988
2989 auto ctx = apache::thrift::ContextStack::createWithClientContext(
2990 handlers_,
2991 getServiceName(),
2992 "service_with_special_names.value",
2993 *header);
2994
2995 return {std::move(ctx), std::move(header)};
2996 }
2997
sync_value()2998 ::std::int32_t service_with_special_namesAsyncClient::sync_value() {
2999 ::apache::thrift::RpcOptions rpcOptions;
3000 return sync_value(rpcOptions);
3001 }
3002
sync_value(apache::thrift::RpcOptions & rpcOptions)3003 ::std::int32_t service_with_special_namesAsyncClient::sync_value(apache::thrift::RpcOptions& rpcOptions) {
3004 apache::thrift::ClientReceiveState returnState;
3005 apache::thrift::ClientSyncCallback<false> callback(&returnState);
3006 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
3007 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
3008 auto ctxAndHeader = valueCtx(&rpcOptions);
3009 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
3010 callback.waitUntilDone(
3011 evb,
3012 [&] {
3013 valueImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
3014 });
3015
3016 if (returnState.isException()) {
3017 returnState.exception().throw_exception();
3018 }
3019 returnState.resetProtocolId(protocolId);
3020 returnState.resetCtx(std::move(ctxAndHeader.first));
3021 SCOPE_EXIT {
3022 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
3023 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
3024 }
3025 };
3026 return folly::fibers::runInMainContext([&] {
3027 return recv_value(returnState);
3028 });
3029 }
3030
3031
future_value()3032 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_value() {
3033 ::apache::thrift::RpcOptions rpcOptions;
3034 return future_value(rpcOptions);
3035 }
3036
semifuture_value()3037 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_value() {
3038 ::apache::thrift::RpcOptions rpcOptions;
3039 return semifuture_value(rpcOptions);
3040 }
3041
future_value(apache::thrift::RpcOptions & rpcOptions)3042 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_value(apache::thrift::RpcOptions& rpcOptions) {
3043 folly::Promise<::std::int32_t> promise;
3044 auto future = promise.getFuture();
3045 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_value, channel_);
3046 value(rpcOptions, std::move(callback));
3047 return future;
3048 }
3049
semifuture_value(apache::thrift::RpcOptions & rpcOptions)3050 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_value(apache::thrift::RpcOptions& rpcOptions) {
3051 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_value, channel_);
3052 auto callback = std::move(callbackAndFuture.first);
3053 value(rpcOptions, std::move(callback));
3054 return std::move(callbackAndFuture.second);
3055 }
3056
header_future_value(apache::thrift::RpcOptions & rpcOptions)3057 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_value(apache::thrift::RpcOptions& rpcOptions) {
3058 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
3059 auto future = promise.getFuture();
3060 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_value, channel_);
3061 value(rpcOptions, std::move(callback));
3062 return future;
3063 }
3064
header_semifuture_value(apache::thrift::RpcOptions & rpcOptions)3065 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_value(apache::thrift::RpcOptions& rpcOptions) {
3066 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_value, channel_);
3067 auto callback = std::move(callbackAndFuture.first);
3068 value(rpcOptions, std::move(callback));
3069 return std::move(callbackAndFuture.second);
3070 }
3071
value(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)3072 void service_with_special_namesAsyncClient::value(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
3073 value(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
3074 }
3075
3076 #if FOLLY_HAS_COROUTINES
3077 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_value(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)3078 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_value(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
3079 if (state.isException()) {
3080 return std::move(state.exception());
3081 }
3082 if (!state.hasResponseBuffer()) {
3083 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
3084 }
3085
3086 using result = service_with_special_names_value_presult;
3087 switch (state.protocolId()) {
3088 case apache::thrift::protocol::T_BINARY_PROTOCOL:
3089 {
3090 apache::thrift::BinaryProtocolReader reader;
3091 return apache::thrift::detail::ac::recv_wrapped<result>(
3092 &reader, state, _return);
3093 }
3094 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
3095 {
3096 apache::thrift::CompactProtocolReader reader;
3097 return apache::thrift::detail::ac::recv_wrapped<result>(
3098 &reader, state, _return);
3099 }
3100 default:
3101 {
3102 }
3103 }
3104 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
3105 }
3106
recv_value(::apache::thrift::ClientReceiveState & state)3107 ::std::int32_t service_with_special_namesAsyncClient::recv_value(::apache::thrift::ClientReceiveState& state) {
3108 ::std::int32_t _return;
3109 auto ew = recv_wrapped_value(_return, state);
3110 if (ew) {
3111 ew.throw_exception();
3112 }
3113 return _return;
3114 }
3115
recv_instance_value(::apache::thrift::ClientReceiveState & state)3116 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_value(::apache::thrift::ClientReceiveState& state) {
3117 return recv_value(state);
3118 }
3119
recv_instance_wrapped_value(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)3120 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_value(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
3121 return recv_wrapped_value(_return, state);
3122 }
3123
value_to_name(std::unique_ptr<apache::thrift::RequestCallback> callback)3124 void service_with_special_namesAsyncClient::value_to_name(std::unique_ptr<apache::thrift::RequestCallback> callback) {
3125 ::apache::thrift::RpcOptions rpcOptions;
3126 value_to_name(rpcOptions, std::move(callback));
3127 }
3128
value_to_name(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)3129 void service_with_special_namesAsyncClient::value_to_name(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
3130 auto [ctx, header] = value_to_nameCtx(&rpcOptions);
3131 apache::thrift::RequestCallback::Context callbackContext;
3132 callbackContext.protocolId =
3133 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
3134 auto* contextStack = ctx.get();
3135 if (callback) {
3136 callbackContext.ctx = std::move(ctx);
3137 }
3138 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
3139 value_to_nameImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
3140 }
3141
value_to_nameImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)3142 void service_with_special_namesAsyncClient::value_to_nameImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
3143 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
3144 case apache::thrift::protocol::T_BINARY_PROTOCOL:
3145 {
3146 apache::thrift::BinaryProtocolWriter writer;
3147 if (stealRpcOptions) {
3148 value_to_nameT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
3149 } else {
3150 value_to_nameT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
3151 }
3152 break;
3153 }
3154 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
3155 {
3156 apache::thrift::CompactProtocolWriter writer;
3157 if (stealRpcOptions) {
3158 value_to_nameT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
3159 } else {
3160 value_to_nameT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
3161 }
3162 break;
3163 }
3164 default:
3165 {
3166 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
3167 }
3168 }
3169 }
3170
value_to_nameCtx(apache::thrift::RpcOptions * rpcOptions)3171 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::value_to_nameCtx(apache::thrift::RpcOptions* rpcOptions) {
3172 auto header = std::make_shared<apache::thrift::transport::THeader>(
3173 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
3174 header->setProtocolId(channel_->getProtocolId());
3175 if (rpcOptions) {
3176 header->setHeaders(rpcOptions->releaseWriteHeaders());
3177 }
3178
3179 auto ctx = apache::thrift::ContextStack::createWithClientContext(
3180 handlers_,
3181 getServiceName(),
3182 "service_with_special_names.value_to_name",
3183 *header);
3184
3185 return {std::move(ctx), std::move(header)};
3186 }
3187
sync_value_to_name()3188 ::std::int32_t service_with_special_namesAsyncClient::sync_value_to_name() {
3189 ::apache::thrift::RpcOptions rpcOptions;
3190 return sync_value_to_name(rpcOptions);
3191 }
3192
sync_value_to_name(apache::thrift::RpcOptions & rpcOptions)3193 ::std::int32_t service_with_special_namesAsyncClient::sync_value_to_name(apache::thrift::RpcOptions& rpcOptions) {
3194 apache::thrift::ClientReceiveState returnState;
3195 apache::thrift::ClientSyncCallback<false> callback(&returnState);
3196 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
3197 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
3198 auto ctxAndHeader = value_to_nameCtx(&rpcOptions);
3199 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
3200 callback.waitUntilDone(
3201 evb,
3202 [&] {
3203 value_to_nameImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
3204 });
3205
3206 if (returnState.isException()) {
3207 returnState.exception().throw_exception();
3208 }
3209 returnState.resetProtocolId(protocolId);
3210 returnState.resetCtx(std::move(ctxAndHeader.first));
3211 SCOPE_EXIT {
3212 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
3213 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
3214 }
3215 };
3216 return folly::fibers::runInMainContext([&] {
3217 return recv_value_to_name(returnState);
3218 });
3219 }
3220
3221
future_value_to_name()3222 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_value_to_name() {
3223 ::apache::thrift::RpcOptions rpcOptions;
3224 return future_value_to_name(rpcOptions);
3225 }
3226
semifuture_value_to_name()3227 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_value_to_name() {
3228 ::apache::thrift::RpcOptions rpcOptions;
3229 return semifuture_value_to_name(rpcOptions);
3230 }
3231
future_value_to_name(apache::thrift::RpcOptions & rpcOptions)3232 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_value_to_name(apache::thrift::RpcOptions& rpcOptions) {
3233 folly::Promise<::std::int32_t> promise;
3234 auto future = promise.getFuture();
3235 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_value_to_name, channel_);
3236 value_to_name(rpcOptions, std::move(callback));
3237 return future;
3238 }
3239
semifuture_value_to_name(apache::thrift::RpcOptions & rpcOptions)3240 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_value_to_name(apache::thrift::RpcOptions& rpcOptions) {
3241 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_value_to_name, channel_);
3242 auto callback = std::move(callbackAndFuture.first);
3243 value_to_name(rpcOptions, std::move(callback));
3244 return std::move(callbackAndFuture.second);
3245 }
3246
header_future_value_to_name(apache::thrift::RpcOptions & rpcOptions)3247 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_value_to_name(apache::thrift::RpcOptions& rpcOptions) {
3248 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
3249 auto future = promise.getFuture();
3250 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_value_to_name, channel_);
3251 value_to_name(rpcOptions, std::move(callback));
3252 return future;
3253 }
3254
header_semifuture_value_to_name(apache::thrift::RpcOptions & rpcOptions)3255 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_value_to_name(apache::thrift::RpcOptions& rpcOptions) {
3256 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_value_to_name, channel_);
3257 auto callback = std::move(callbackAndFuture.first);
3258 value_to_name(rpcOptions, std::move(callback));
3259 return std::move(callbackAndFuture.second);
3260 }
3261
value_to_name(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)3262 void service_with_special_namesAsyncClient::value_to_name(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
3263 value_to_name(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
3264 }
3265
3266 #if FOLLY_HAS_COROUTINES
3267 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_value_to_name(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)3268 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_value_to_name(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
3269 if (state.isException()) {
3270 return std::move(state.exception());
3271 }
3272 if (!state.hasResponseBuffer()) {
3273 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
3274 }
3275
3276 using result = service_with_special_names_value_to_name_presult;
3277 switch (state.protocolId()) {
3278 case apache::thrift::protocol::T_BINARY_PROTOCOL:
3279 {
3280 apache::thrift::BinaryProtocolReader reader;
3281 return apache::thrift::detail::ac::recv_wrapped<result>(
3282 &reader, state, _return);
3283 }
3284 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
3285 {
3286 apache::thrift::CompactProtocolReader reader;
3287 return apache::thrift::detail::ac::recv_wrapped<result>(
3288 &reader, state, _return);
3289 }
3290 default:
3291 {
3292 }
3293 }
3294 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
3295 }
3296
recv_value_to_name(::apache::thrift::ClientReceiveState & state)3297 ::std::int32_t service_with_special_namesAsyncClient::recv_value_to_name(::apache::thrift::ClientReceiveState& state) {
3298 ::std::int32_t _return;
3299 auto ew = recv_wrapped_value_to_name(_return, state);
3300 if (ew) {
3301 ew.throw_exception();
3302 }
3303 return _return;
3304 }
3305
recv_instance_value_to_name(::apache::thrift::ClientReceiveState & state)3306 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_value_to_name(::apache::thrift::ClientReceiveState& state) {
3307 return recv_value_to_name(state);
3308 }
3309
recv_instance_wrapped_value_to_name(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)3310 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_value_to_name(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
3311 return recv_wrapped_value_to_name(_return, state);
3312 }
3313
values(std::unique_ptr<apache::thrift::RequestCallback> callback)3314 void service_with_special_namesAsyncClient::values(std::unique_ptr<apache::thrift::RequestCallback> callback) {
3315 ::apache::thrift::RpcOptions rpcOptions;
3316 values(rpcOptions, std::move(callback));
3317 }
3318
values(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)3319 void service_with_special_namesAsyncClient::values(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
3320 auto [ctx, header] = valuesCtx(&rpcOptions);
3321 apache::thrift::RequestCallback::Context callbackContext;
3322 callbackContext.protocolId =
3323 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
3324 auto* contextStack = ctx.get();
3325 if (callback) {
3326 callbackContext.ctx = std::move(ctx);
3327 }
3328 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
3329 valuesImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
3330 }
3331
valuesImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)3332 void service_with_special_namesAsyncClient::valuesImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
3333 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
3334 case apache::thrift::protocol::T_BINARY_PROTOCOL:
3335 {
3336 apache::thrift::BinaryProtocolWriter writer;
3337 if (stealRpcOptions) {
3338 valuesT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
3339 } else {
3340 valuesT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
3341 }
3342 break;
3343 }
3344 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
3345 {
3346 apache::thrift::CompactProtocolWriter writer;
3347 if (stealRpcOptions) {
3348 valuesT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
3349 } else {
3350 valuesT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
3351 }
3352 break;
3353 }
3354 default:
3355 {
3356 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
3357 }
3358 }
3359 }
3360
valuesCtx(apache::thrift::RpcOptions * rpcOptions)3361 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::valuesCtx(apache::thrift::RpcOptions* rpcOptions) {
3362 auto header = std::make_shared<apache::thrift::transport::THeader>(
3363 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
3364 header->setProtocolId(channel_->getProtocolId());
3365 if (rpcOptions) {
3366 header->setHeaders(rpcOptions->releaseWriteHeaders());
3367 }
3368
3369 auto ctx = apache::thrift::ContextStack::createWithClientContext(
3370 handlers_,
3371 getServiceName(),
3372 "service_with_special_names.values",
3373 *header);
3374
3375 return {std::move(ctx), std::move(header)};
3376 }
3377
sync_values()3378 ::std::int32_t service_with_special_namesAsyncClient::sync_values() {
3379 ::apache::thrift::RpcOptions rpcOptions;
3380 return sync_values(rpcOptions);
3381 }
3382
sync_values(apache::thrift::RpcOptions & rpcOptions)3383 ::std::int32_t service_with_special_namesAsyncClient::sync_values(apache::thrift::RpcOptions& rpcOptions) {
3384 apache::thrift::ClientReceiveState returnState;
3385 apache::thrift::ClientSyncCallback<false> callback(&returnState);
3386 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
3387 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
3388 auto ctxAndHeader = valuesCtx(&rpcOptions);
3389 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
3390 callback.waitUntilDone(
3391 evb,
3392 [&] {
3393 valuesImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
3394 });
3395
3396 if (returnState.isException()) {
3397 returnState.exception().throw_exception();
3398 }
3399 returnState.resetProtocolId(protocolId);
3400 returnState.resetCtx(std::move(ctxAndHeader.first));
3401 SCOPE_EXIT {
3402 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
3403 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
3404 }
3405 };
3406 return folly::fibers::runInMainContext([&] {
3407 return recv_values(returnState);
3408 });
3409 }
3410
3411
future_values()3412 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_values() {
3413 ::apache::thrift::RpcOptions rpcOptions;
3414 return future_values(rpcOptions);
3415 }
3416
semifuture_values()3417 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_values() {
3418 ::apache::thrift::RpcOptions rpcOptions;
3419 return semifuture_values(rpcOptions);
3420 }
3421
future_values(apache::thrift::RpcOptions & rpcOptions)3422 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_values(apache::thrift::RpcOptions& rpcOptions) {
3423 folly::Promise<::std::int32_t> promise;
3424 auto future = promise.getFuture();
3425 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_values, channel_);
3426 values(rpcOptions, std::move(callback));
3427 return future;
3428 }
3429
semifuture_values(apache::thrift::RpcOptions & rpcOptions)3430 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_values(apache::thrift::RpcOptions& rpcOptions) {
3431 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_values, channel_);
3432 auto callback = std::move(callbackAndFuture.first);
3433 values(rpcOptions, std::move(callback));
3434 return std::move(callbackAndFuture.second);
3435 }
3436
header_future_values(apache::thrift::RpcOptions & rpcOptions)3437 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_values(apache::thrift::RpcOptions& rpcOptions) {
3438 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
3439 auto future = promise.getFuture();
3440 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_values, channel_);
3441 values(rpcOptions, std::move(callback));
3442 return future;
3443 }
3444
header_semifuture_values(apache::thrift::RpcOptions & rpcOptions)3445 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_values(apache::thrift::RpcOptions& rpcOptions) {
3446 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_values, channel_);
3447 auto callback = std::move(callbackAndFuture.first);
3448 values(rpcOptions, std::move(callback));
3449 return std::move(callbackAndFuture.second);
3450 }
3451
values(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)3452 void service_with_special_namesAsyncClient::values(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
3453 values(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
3454 }
3455
3456 #if FOLLY_HAS_COROUTINES
3457 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_values(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)3458 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_values(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
3459 if (state.isException()) {
3460 return std::move(state.exception());
3461 }
3462 if (!state.hasResponseBuffer()) {
3463 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
3464 }
3465
3466 using result = service_with_special_names_values_presult;
3467 switch (state.protocolId()) {
3468 case apache::thrift::protocol::T_BINARY_PROTOCOL:
3469 {
3470 apache::thrift::BinaryProtocolReader reader;
3471 return apache::thrift::detail::ac::recv_wrapped<result>(
3472 &reader, state, _return);
3473 }
3474 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
3475 {
3476 apache::thrift::CompactProtocolReader reader;
3477 return apache::thrift::detail::ac::recv_wrapped<result>(
3478 &reader, state, _return);
3479 }
3480 default:
3481 {
3482 }
3483 }
3484 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
3485 }
3486
recv_values(::apache::thrift::ClientReceiveState & state)3487 ::std::int32_t service_with_special_namesAsyncClient::recv_values(::apache::thrift::ClientReceiveState& state) {
3488 ::std::int32_t _return;
3489 auto ew = recv_wrapped_values(_return, state);
3490 if (ew) {
3491 ew.throw_exception();
3492 }
3493 return _return;
3494 }
3495
recv_instance_values(::apache::thrift::ClientReceiveState & state)3496 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_values(::apache::thrift::ClientReceiveState& state) {
3497 return recv_values(state);
3498 }
3499
recv_instance_wrapped_values(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)3500 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_values(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
3501 return recv_wrapped_values(_return, state);
3502 }
3503
id(std::unique_ptr<apache::thrift::RequestCallback> callback)3504 void service_with_special_namesAsyncClient::id(std::unique_ptr<apache::thrift::RequestCallback> callback) {
3505 ::apache::thrift::RpcOptions rpcOptions;
3506 id(rpcOptions, std::move(callback));
3507 }
3508
id(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)3509 void service_with_special_namesAsyncClient::id(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
3510 auto [ctx, header] = idCtx(&rpcOptions);
3511 apache::thrift::RequestCallback::Context callbackContext;
3512 callbackContext.protocolId =
3513 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
3514 auto* contextStack = ctx.get();
3515 if (callback) {
3516 callbackContext.ctx = std::move(ctx);
3517 }
3518 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
3519 idImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
3520 }
3521
idImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)3522 void service_with_special_namesAsyncClient::idImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
3523 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
3524 case apache::thrift::protocol::T_BINARY_PROTOCOL:
3525 {
3526 apache::thrift::BinaryProtocolWriter writer;
3527 if (stealRpcOptions) {
3528 idT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
3529 } else {
3530 idT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
3531 }
3532 break;
3533 }
3534 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
3535 {
3536 apache::thrift::CompactProtocolWriter writer;
3537 if (stealRpcOptions) {
3538 idT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
3539 } else {
3540 idT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
3541 }
3542 break;
3543 }
3544 default:
3545 {
3546 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
3547 }
3548 }
3549 }
3550
idCtx(apache::thrift::RpcOptions * rpcOptions)3551 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::idCtx(apache::thrift::RpcOptions* rpcOptions) {
3552 auto header = std::make_shared<apache::thrift::transport::THeader>(
3553 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
3554 header->setProtocolId(channel_->getProtocolId());
3555 if (rpcOptions) {
3556 header->setHeaders(rpcOptions->releaseWriteHeaders());
3557 }
3558
3559 auto ctx = apache::thrift::ContextStack::createWithClientContext(
3560 handlers_,
3561 getServiceName(),
3562 "service_with_special_names.id",
3563 *header);
3564
3565 return {std::move(ctx), std::move(header)};
3566 }
3567
sync_id()3568 ::std::int32_t service_with_special_namesAsyncClient::sync_id() {
3569 ::apache::thrift::RpcOptions rpcOptions;
3570 return sync_id(rpcOptions);
3571 }
3572
sync_id(apache::thrift::RpcOptions & rpcOptions)3573 ::std::int32_t service_with_special_namesAsyncClient::sync_id(apache::thrift::RpcOptions& rpcOptions) {
3574 apache::thrift::ClientReceiveState returnState;
3575 apache::thrift::ClientSyncCallback<false> callback(&returnState);
3576 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
3577 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
3578 auto ctxAndHeader = idCtx(&rpcOptions);
3579 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
3580 callback.waitUntilDone(
3581 evb,
3582 [&] {
3583 idImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
3584 });
3585
3586 if (returnState.isException()) {
3587 returnState.exception().throw_exception();
3588 }
3589 returnState.resetProtocolId(protocolId);
3590 returnState.resetCtx(std::move(ctxAndHeader.first));
3591 SCOPE_EXIT {
3592 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
3593 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
3594 }
3595 };
3596 return folly::fibers::runInMainContext([&] {
3597 return recv_id(returnState);
3598 });
3599 }
3600
3601
future_id()3602 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_id() {
3603 ::apache::thrift::RpcOptions rpcOptions;
3604 return future_id(rpcOptions);
3605 }
3606
semifuture_id()3607 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_id() {
3608 ::apache::thrift::RpcOptions rpcOptions;
3609 return semifuture_id(rpcOptions);
3610 }
3611
future_id(apache::thrift::RpcOptions & rpcOptions)3612 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_id(apache::thrift::RpcOptions& rpcOptions) {
3613 folly::Promise<::std::int32_t> promise;
3614 auto future = promise.getFuture();
3615 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_id, channel_);
3616 id(rpcOptions, std::move(callback));
3617 return future;
3618 }
3619
semifuture_id(apache::thrift::RpcOptions & rpcOptions)3620 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_id(apache::thrift::RpcOptions& rpcOptions) {
3621 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_id, channel_);
3622 auto callback = std::move(callbackAndFuture.first);
3623 id(rpcOptions, std::move(callback));
3624 return std::move(callbackAndFuture.second);
3625 }
3626
header_future_id(apache::thrift::RpcOptions & rpcOptions)3627 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_id(apache::thrift::RpcOptions& rpcOptions) {
3628 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
3629 auto future = promise.getFuture();
3630 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_id, channel_);
3631 id(rpcOptions, std::move(callback));
3632 return future;
3633 }
3634
header_semifuture_id(apache::thrift::RpcOptions & rpcOptions)3635 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_id(apache::thrift::RpcOptions& rpcOptions) {
3636 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_id, channel_);
3637 auto callback = std::move(callbackAndFuture.first);
3638 id(rpcOptions, std::move(callback));
3639 return std::move(callbackAndFuture.second);
3640 }
3641
id(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)3642 void service_with_special_namesAsyncClient::id(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
3643 id(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
3644 }
3645
3646 #if FOLLY_HAS_COROUTINES
3647 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_id(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)3648 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_id(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
3649 if (state.isException()) {
3650 return std::move(state.exception());
3651 }
3652 if (!state.hasResponseBuffer()) {
3653 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
3654 }
3655
3656 using result = service_with_special_names_id_presult;
3657 switch (state.protocolId()) {
3658 case apache::thrift::protocol::T_BINARY_PROTOCOL:
3659 {
3660 apache::thrift::BinaryProtocolReader reader;
3661 return apache::thrift::detail::ac::recv_wrapped<result>(
3662 &reader, state, _return);
3663 }
3664 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
3665 {
3666 apache::thrift::CompactProtocolReader reader;
3667 return apache::thrift::detail::ac::recv_wrapped<result>(
3668 &reader, state, _return);
3669 }
3670 default:
3671 {
3672 }
3673 }
3674 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
3675 }
3676
recv_id(::apache::thrift::ClientReceiveState & state)3677 ::std::int32_t service_with_special_namesAsyncClient::recv_id(::apache::thrift::ClientReceiveState& state) {
3678 ::std::int32_t _return;
3679 auto ew = recv_wrapped_id(_return, state);
3680 if (ew) {
3681 ew.throw_exception();
3682 }
3683 return _return;
3684 }
3685
recv_instance_id(::apache::thrift::ClientReceiveState & state)3686 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_id(::apache::thrift::ClientReceiveState& state) {
3687 return recv_id(state);
3688 }
3689
recv_instance_wrapped_id(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)3690 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_id(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
3691 return recv_wrapped_id(_return, state);
3692 }
3693
ids(std::unique_ptr<apache::thrift::RequestCallback> callback)3694 void service_with_special_namesAsyncClient::ids(std::unique_ptr<apache::thrift::RequestCallback> callback) {
3695 ::apache::thrift::RpcOptions rpcOptions;
3696 ids(rpcOptions, std::move(callback));
3697 }
3698
ids(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)3699 void service_with_special_namesAsyncClient::ids(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
3700 auto [ctx, header] = idsCtx(&rpcOptions);
3701 apache::thrift::RequestCallback::Context callbackContext;
3702 callbackContext.protocolId =
3703 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
3704 auto* contextStack = ctx.get();
3705 if (callback) {
3706 callbackContext.ctx = std::move(ctx);
3707 }
3708 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
3709 idsImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
3710 }
3711
idsImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)3712 void service_with_special_namesAsyncClient::idsImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
3713 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
3714 case apache::thrift::protocol::T_BINARY_PROTOCOL:
3715 {
3716 apache::thrift::BinaryProtocolWriter writer;
3717 if (stealRpcOptions) {
3718 idsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
3719 } else {
3720 idsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
3721 }
3722 break;
3723 }
3724 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
3725 {
3726 apache::thrift::CompactProtocolWriter writer;
3727 if (stealRpcOptions) {
3728 idsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
3729 } else {
3730 idsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
3731 }
3732 break;
3733 }
3734 default:
3735 {
3736 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
3737 }
3738 }
3739 }
3740
idsCtx(apache::thrift::RpcOptions * rpcOptions)3741 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::idsCtx(apache::thrift::RpcOptions* rpcOptions) {
3742 auto header = std::make_shared<apache::thrift::transport::THeader>(
3743 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
3744 header->setProtocolId(channel_->getProtocolId());
3745 if (rpcOptions) {
3746 header->setHeaders(rpcOptions->releaseWriteHeaders());
3747 }
3748
3749 auto ctx = apache::thrift::ContextStack::createWithClientContext(
3750 handlers_,
3751 getServiceName(),
3752 "service_with_special_names.ids",
3753 *header);
3754
3755 return {std::move(ctx), std::move(header)};
3756 }
3757
sync_ids()3758 ::std::int32_t service_with_special_namesAsyncClient::sync_ids() {
3759 ::apache::thrift::RpcOptions rpcOptions;
3760 return sync_ids(rpcOptions);
3761 }
3762
sync_ids(apache::thrift::RpcOptions & rpcOptions)3763 ::std::int32_t service_with_special_namesAsyncClient::sync_ids(apache::thrift::RpcOptions& rpcOptions) {
3764 apache::thrift::ClientReceiveState returnState;
3765 apache::thrift::ClientSyncCallback<false> callback(&returnState);
3766 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
3767 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
3768 auto ctxAndHeader = idsCtx(&rpcOptions);
3769 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
3770 callback.waitUntilDone(
3771 evb,
3772 [&] {
3773 idsImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
3774 });
3775
3776 if (returnState.isException()) {
3777 returnState.exception().throw_exception();
3778 }
3779 returnState.resetProtocolId(protocolId);
3780 returnState.resetCtx(std::move(ctxAndHeader.first));
3781 SCOPE_EXIT {
3782 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
3783 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
3784 }
3785 };
3786 return folly::fibers::runInMainContext([&] {
3787 return recv_ids(returnState);
3788 });
3789 }
3790
3791
future_ids()3792 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_ids() {
3793 ::apache::thrift::RpcOptions rpcOptions;
3794 return future_ids(rpcOptions);
3795 }
3796
semifuture_ids()3797 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_ids() {
3798 ::apache::thrift::RpcOptions rpcOptions;
3799 return semifuture_ids(rpcOptions);
3800 }
3801
future_ids(apache::thrift::RpcOptions & rpcOptions)3802 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_ids(apache::thrift::RpcOptions& rpcOptions) {
3803 folly::Promise<::std::int32_t> promise;
3804 auto future = promise.getFuture();
3805 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_ids, channel_);
3806 ids(rpcOptions, std::move(callback));
3807 return future;
3808 }
3809
semifuture_ids(apache::thrift::RpcOptions & rpcOptions)3810 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_ids(apache::thrift::RpcOptions& rpcOptions) {
3811 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_ids, channel_);
3812 auto callback = std::move(callbackAndFuture.first);
3813 ids(rpcOptions, std::move(callback));
3814 return std::move(callbackAndFuture.second);
3815 }
3816
header_future_ids(apache::thrift::RpcOptions & rpcOptions)3817 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_ids(apache::thrift::RpcOptions& rpcOptions) {
3818 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
3819 auto future = promise.getFuture();
3820 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_ids, channel_);
3821 ids(rpcOptions, std::move(callback));
3822 return future;
3823 }
3824
header_semifuture_ids(apache::thrift::RpcOptions & rpcOptions)3825 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_ids(apache::thrift::RpcOptions& rpcOptions) {
3826 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_ids, channel_);
3827 auto callback = std::move(callbackAndFuture.first);
3828 ids(rpcOptions, std::move(callback));
3829 return std::move(callbackAndFuture.second);
3830 }
3831
ids(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)3832 void service_with_special_namesAsyncClient::ids(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
3833 ids(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
3834 }
3835
3836 #if FOLLY_HAS_COROUTINES
3837 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_ids(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)3838 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_ids(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
3839 if (state.isException()) {
3840 return std::move(state.exception());
3841 }
3842 if (!state.hasResponseBuffer()) {
3843 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
3844 }
3845
3846 using result = service_with_special_names_ids_presult;
3847 switch (state.protocolId()) {
3848 case apache::thrift::protocol::T_BINARY_PROTOCOL:
3849 {
3850 apache::thrift::BinaryProtocolReader reader;
3851 return apache::thrift::detail::ac::recv_wrapped<result>(
3852 &reader, state, _return);
3853 }
3854 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
3855 {
3856 apache::thrift::CompactProtocolReader reader;
3857 return apache::thrift::detail::ac::recv_wrapped<result>(
3858 &reader, state, _return);
3859 }
3860 default:
3861 {
3862 }
3863 }
3864 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
3865 }
3866
recv_ids(::apache::thrift::ClientReceiveState & state)3867 ::std::int32_t service_with_special_namesAsyncClient::recv_ids(::apache::thrift::ClientReceiveState& state) {
3868 ::std::int32_t _return;
3869 auto ew = recv_wrapped_ids(_return, state);
3870 if (ew) {
3871 ew.throw_exception();
3872 }
3873 return _return;
3874 }
3875
recv_instance_ids(::apache::thrift::ClientReceiveState & state)3876 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_ids(::apache::thrift::ClientReceiveState& state) {
3877 return recv_ids(state);
3878 }
3879
recv_instance_wrapped_ids(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)3880 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_ids(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
3881 return recv_wrapped_ids(_return, state);
3882 }
3883
descriptor(std::unique_ptr<apache::thrift::RequestCallback> callback)3884 void service_with_special_namesAsyncClient::descriptor(std::unique_ptr<apache::thrift::RequestCallback> callback) {
3885 ::apache::thrift::RpcOptions rpcOptions;
3886 descriptor(rpcOptions, std::move(callback));
3887 }
3888
descriptor(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)3889 void service_with_special_namesAsyncClient::descriptor(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
3890 auto [ctx, header] = descriptorCtx(&rpcOptions);
3891 apache::thrift::RequestCallback::Context callbackContext;
3892 callbackContext.protocolId =
3893 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
3894 auto* contextStack = ctx.get();
3895 if (callback) {
3896 callbackContext.ctx = std::move(ctx);
3897 }
3898 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
3899 descriptorImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
3900 }
3901
descriptorImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)3902 void service_with_special_namesAsyncClient::descriptorImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
3903 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
3904 case apache::thrift::protocol::T_BINARY_PROTOCOL:
3905 {
3906 apache::thrift::BinaryProtocolWriter writer;
3907 if (stealRpcOptions) {
3908 descriptorT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
3909 } else {
3910 descriptorT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
3911 }
3912 break;
3913 }
3914 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
3915 {
3916 apache::thrift::CompactProtocolWriter writer;
3917 if (stealRpcOptions) {
3918 descriptorT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
3919 } else {
3920 descriptorT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
3921 }
3922 break;
3923 }
3924 default:
3925 {
3926 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
3927 }
3928 }
3929 }
3930
descriptorCtx(apache::thrift::RpcOptions * rpcOptions)3931 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::descriptorCtx(apache::thrift::RpcOptions* rpcOptions) {
3932 auto header = std::make_shared<apache::thrift::transport::THeader>(
3933 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
3934 header->setProtocolId(channel_->getProtocolId());
3935 if (rpcOptions) {
3936 header->setHeaders(rpcOptions->releaseWriteHeaders());
3937 }
3938
3939 auto ctx = apache::thrift::ContextStack::createWithClientContext(
3940 handlers_,
3941 getServiceName(),
3942 "service_with_special_names.descriptor",
3943 *header);
3944
3945 return {std::move(ctx), std::move(header)};
3946 }
3947
sync_descriptor()3948 ::std::int32_t service_with_special_namesAsyncClient::sync_descriptor() {
3949 ::apache::thrift::RpcOptions rpcOptions;
3950 return sync_descriptor(rpcOptions);
3951 }
3952
sync_descriptor(apache::thrift::RpcOptions & rpcOptions)3953 ::std::int32_t service_with_special_namesAsyncClient::sync_descriptor(apache::thrift::RpcOptions& rpcOptions) {
3954 apache::thrift::ClientReceiveState returnState;
3955 apache::thrift::ClientSyncCallback<false> callback(&returnState);
3956 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
3957 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
3958 auto ctxAndHeader = descriptorCtx(&rpcOptions);
3959 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
3960 callback.waitUntilDone(
3961 evb,
3962 [&] {
3963 descriptorImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
3964 });
3965
3966 if (returnState.isException()) {
3967 returnState.exception().throw_exception();
3968 }
3969 returnState.resetProtocolId(protocolId);
3970 returnState.resetCtx(std::move(ctxAndHeader.first));
3971 SCOPE_EXIT {
3972 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
3973 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
3974 }
3975 };
3976 return folly::fibers::runInMainContext([&] {
3977 return recv_descriptor(returnState);
3978 });
3979 }
3980
3981
future_descriptor()3982 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_descriptor() {
3983 ::apache::thrift::RpcOptions rpcOptions;
3984 return future_descriptor(rpcOptions);
3985 }
3986
semifuture_descriptor()3987 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_descriptor() {
3988 ::apache::thrift::RpcOptions rpcOptions;
3989 return semifuture_descriptor(rpcOptions);
3990 }
3991
future_descriptor(apache::thrift::RpcOptions & rpcOptions)3992 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_descriptor(apache::thrift::RpcOptions& rpcOptions) {
3993 folly::Promise<::std::int32_t> promise;
3994 auto future = promise.getFuture();
3995 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_descriptor, channel_);
3996 descriptor(rpcOptions, std::move(callback));
3997 return future;
3998 }
3999
semifuture_descriptor(apache::thrift::RpcOptions & rpcOptions)4000 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_descriptor(apache::thrift::RpcOptions& rpcOptions) {
4001 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_descriptor, channel_);
4002 auto callback = std::move(callbackAndFuture.first);
4003 descriptor(rpcOptions, std::move(callback));
4004 return std::move(callbackAndFuture.second);
4005 }
4006
header_future_descriptor(apache::thrift::RpcOptions & rpcOptions)4007 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_descriptor(apache::thrift::RpcOptions& rpcOptions) {
4008 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
4009 auto future = promise.getFuture();
4010 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_descriptor, channel_);
4011 descriptor(rpcOptions, std::move(callback));
4012 return future;
4013 }
4014
header_semifuture_descriptor(apache::thrift::RpcOptions & rpcOptions)4015 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_descriptor(apache::thrift::RpcOptions& rpcOptions) {
4016 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_descriptor, channel_);
4017 auto callback = std::move(callbackAndFuture.first);
4018 descriptor(rpcOptions, std::move(callback));
4019 return std::move(callbackAndFuture.second);
4020 }
4021
descriptor(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)4022 void service_with_special_namesAsyncClient::descriptor(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
4023 descriptor(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
4024 }
4025
4026 #if FOLLY_HAS_COROUTINES
4027 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_descriptor(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)4028 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_descriptor(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
4029 if (state.isException()) {
4030 return std::move(state.exception());
4031 }
4032 if (!state.hasResponseBuffer()) {
4033 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
4034 }
4035
4036 using result = service_with_special_names_descriptor_presult;
4037 switch (state.protocolId()) {
4038 case apache::thrift::protocol::T_BINARY_PROTOCOL:
4039 {
4040 apache::thrift::BinaryProtocolReader reader;
4041 return apache::thrift::detail::ac::recv_wrapped<result>(
4042 &reader, state, _return);
4043 }
4044 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
4045 {
4046 apache::thrift::CompactProtocolReader reader;
4047 return apache::thrift::detail::ac::recv_wrapped<result>(
4048 &reader, state, _return);
4049 }
4050 default:
4051 {
4052 }
4053 }
4054 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
4055 }
4056
recv_descriptor(::apache::thrift::ClientReceiveState & state)4057 ::std::int32_t service_with_special_namesAsyncClient::recv_descriptor(::apache::thrift::ClientReceiveState& state) {
4058 ::std::int32_t _return;
4059 auto ew = recv_wrapped_descriptor(_return, state);
4060 if (ew) {
4061 ew.throw_exception();
4062 }
4063 return _return;
4064 }
4065
recv_instance_descriptor(::apache::thrift::ClientReceiveState & state)4066 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_descriptor(::apache::thrift::ClientReceiveState& state) {
4067 return recv_descriptor(state);
4068 }
4069
recv_instance_wrapped_descriptor(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)4070 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_descriptor(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
4071 return recv_wrapped_descriptor(_return, state);
4072 }
4073
descriptors(std::unique_ptr<apache::thrift::RequestCallback> callback)4074 void service_with_special_namesAsyncClient::descriptors(std::unique_ptr<apache::thrift::RequestCallback> callback) {
4075 ::apache::thrift::RpcOptions rpcOptions;
4076 descriptors(rpcOptions, std::move(callback));
4077 }
4078
descriptors(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)4079 void service_with_special_namesAsyncClient::descriptors(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
4080 auto [ctx, header] = descriptorsCtx(&rpcOptions);
4081 apache::thrift::RequestCallback::Context callbackContext;
4082 callbackContext.protocolId =
4083 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
4084 auto* contextStack = ctx.get();
4085 if (callback) {
4086 callbackContext.ctx = std::move(ctx);
4087 }
4088 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
4089 descriptorsImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
4090 }
4091
descriptorsImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)4092 void service_with_special_namesAsyncClient::descriptorsImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
4093 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
4094 case apache::thrift::protocol::T_BINARY_PROTOCOL:
4095 {
4096 apache::thrift::BinaryProtocolWriter writer;
4097 if (stealRpcOptions) {
4098 descriptorsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
4099 } else {
4100 descriptorsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
4101 }
4102 break;
4103 }
4104 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
4105 {
4106 apache::thrift::CompactProtocolWriter writer;
4107 if (stealRpcOptions) {
4108 descriptorsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
4109 } else {
4110 descriptorsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
4111 }
4112 break;
4113 }
4114 default:
4115 {
4116 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
4117 }
4118 }
4119 }
4120
descriptorsCtx(apache::thrift::RpcOptions * rpcOptions)4121 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::descriptorsCtx(apache::thrift::RpcOptions* rpcOptions) {
4122 auto header = std::make_shared<apache::thrift::transport::THeader>(
4123 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
4124 header->setProtocolId(channel_->getProtocolId());
4125 if (rpcOptions) {
4126 header->setHeaders(rpcOptions->releaseWriteHeaders());
4127 }
4128
4129 auto ctx = apache::thrift::ContextStack::createWithClientContext(
4130 handlers_,
4131 getServiceName(),
4132 "service_with_special_names.descriptors",
4133 *header);
4134
4135 return {std::move(ctx), std::move(header)};
4136 }
4137
sync_descriptors()4138 ::std::int32_t service_with_special_namesAsyncClient::sync_descriptors() {
4139 ::apache::thrift::RpcOptions rpcOptions;
4140 return sync_descriptors(rpcOptions);
4141 }
4142
sync_descriptors(apache::thrift::RpcOptions & rpcOptions)4143 ::std::int32_t service_with_special_namesAsyncClient::sync_descriptors(apache::thrift::RpcOptions& rpcOptions) {
4144 apache::thrift::ClientReceiveState returnState;
4145 apache::thrift::ClientSyncCallback<false> callback(&returnState);
4146 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
4147 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
4148 auto ctxAndHeader = descriptorsCtx(&rpcOptions);
4149 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
4150 callback.waitUntilDone(
4151 evb,
4152 [&] {
4153 descriptorsImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
4154 });
4155
4156 if (returnState.isException()) {
4157 returnState.exception().throw_exception();
4158 }
4159 returnState.resetProtocolId(protocolId);
4160 returnState.resetCtx(std::move(ctxAndHeader.first));
4161 SCOPE_EXIT {
4162 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
4163 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
4164 }
4165 };
4166 return folly::fibers::runInMainContext([&] {
4167 return recv_descriptors(returnState);
4168 });
4169 }
4170
4171
future_descriptors()4172 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_descriptors() {
4173 ::apache::thrift::RpcOptions rpcOptions;
4174 return future_descriptors(rpcOptions);
4175 }
4176
semifuture_descriptors()4177 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_descriptors() {
4178 ::apache::thrift::RpcOptions rpcOptions;
4179 return semifuture_descriptors(rpcOptions);
4180 }
4181
future_descriptors(apache::thrift::RpcOptions & rpcOptions)4182 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_descriptors(apache::thrift::RpcOptions& rpcOptions) {
4183 folly::Promise<::std::int32_t> promise;
4184 auto future = promise.getFuture();
4185 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_descriptors, channel_);
4186 descriptors(rpcOptions, std::move(callback));
4187 return future;
4188 }
4189
semifuture_descriptors(apache::thrift::RpcOptions & rpcOptions)4190 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_descriptors(apache::thrift::RpcOptions& rpcOptions) {
4191 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_descriptors, channel_);
4192 auto callback = std::move(callbackAndFuture.first);
4193 descriptors(rpcOptions, std::move(callback));
4194 return std::move(callbackAndFuture.second);
4195 }
4196
header_future_descriptors(apache::thrift::RpcOptions & rpcOptions)4197 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_descriptors(apache::thrift::RpcOptions& rpcOptions) {
4198 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
4199 auto future = promise.getFuture();
4200 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_descriptors, channel_);
4201 descriptors(rpcOptions, std::move(callback));
4202 return future;
4203 }
4204
header_semifuture_descriptors(apache::thrift::RpcOptions & rpcOptions)4205 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_descriptors(apache::thrift::RpcOptions& rpcOptions) {
4206 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_descriptors, channel_);
4207 auto callback = std::move(callbackAndFuture.first);
4208 descriptors(rpcOptions, std::move(callback));
4209 return std::move(callbackAndFuture.second);
4210 }
4211
descriptors(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)4212 void service_with_special_namesAsyncClient::descriptors(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
4213 descriptors(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
4214 }
4215
4216 #if FOLLY_HAS_COROUTINES
4217 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_descriptors(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)4218 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_descriptors(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
4219 if (state.isException()) {
4220 return std::move(state.exception());
4221 }
4222 if (!state.hasResponseBuffer()) {
4223 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
4224 }
4225
4226 using result = service_with_special_names_descriptors_presult;
4227 switch (state.protocolId()) {
4228 case apache::thrift::protocol::T_BINARY_PROTOCOL:
4229 {
4230 apache::thrift::BinaryProtocolReader reader;
4231 return apache::thrift::detail::ac::recv_wrapped<result>(
4232 &reader, state, _return);
4233 }
4234 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
4235 {
4236 apache::thrift::CompactProtocolReader reader;
4237 return apache::thrift::detail::ac::recv_wrapped<result>(
4238 &reader, state, _return);
4239 }
4240 default:
4241 {
4242 }
4243 }
4244 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
4245 }
4246
recv_descriptors(::apache::thrift::ClientReceiveState & state)4247 ::std::int32_t service_with_special_namesAsyncClient::recv_descriptors(::apache::thrift::ClientReceiveState& state) {
4248 ::std::int32_t _return;
4249 auto ew = recv_wrapped_descriptors(_return, state);
4250 if (ew) {
4251 ew.throw_exception();
4252 }
4253 return _return;
4254 }
4255
recv_instance_descriptors(::apache::thrift::ClientReceiveState & state)4256 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_descriptors(::apache::thrift::ClientReceiveState& state) {
4257 return recv_descriptors(state);
4258 }
4259
recv_instance_wrapped_descriptors(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)4260 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_descriptors(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
4261 return recv_wrapped_descriptors(_return, state);
4262 }
4263
key(std::unique_ptr<apache::thrift::RequestCallback> callback)4264 void service_with_special_namesAsyncClient::key(std::unique_ptr<apache::thrift::RequestCallback> callback) {
4265 ::apache::thrift::RpcOptions rpcOptions;
4266 key(rpcOptions, std::move(callback));
4267 }
4268
key(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)4269 void service_with_special_namesAsyncClient::key(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
4270 auto [ctx, header] = keyCtx(&rpcOptions);
4271 apache::thrift::RequestCallback::Context callbackContext;
4272 callbackContext.protocolId =
4273 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
4274 auto* contextStack = ctx.get();
4275 if (callback) {
4276 callbackContext.ctx = std::move(ctx);
4277 }
4278 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
4279 keyImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
4280 }
4281
keyImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)4282 void service_with_special_namesAsyncClient::keyImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
4283 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
4284 case apache::thrift::protocol::T_BINARY_PROTOCOL:
4285 {
4286 apache::thrift::BinaryProtocolWriter writer;
4287 if (stealRpcOptions) {
4288 keyT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
4289 } else {
4290 keyT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
4291 }
4292 break;
4293 }
4294 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
4295 {
4296 apache::thrift::CompactProtocolWriter writer;
4297 if (stealRpcOptions) {
4298 keyT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
4299 } else {
4300 keyT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
4301 }
4302 break;
4303 }
4304 default:
4305 {
4306 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
4307 }
4308 }
4309 }
4310
keyCtx(apache::thrift::RpcOptions * rpcOptions)4311 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::keyCtx(apache::thrift::RpcOptions* rpcOptions) {
4312 auto header = std::make_shared<apache::thrift::transport::THeader>(
4313 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
4314 header->setProtocolId(channel_->getProtocolId());
4315 if (rpcOptions) {
4316 header->setHeaders(rpcOptions->releaseWriteHeaders());
4317 }
4318
4319 auto ctx = apache::thrift::ContextStack::createWithClientContext(
4320 handlers_,
4321 getServiceName(),
4322 "service_with_special_names.key",
4323 *header);
4324
4325 return {std::move(ctx), std::move(header)};
4326 }
4327
sync_key()4328 ::std::int32_t service_with_special_namesAsyncClient::sync_key() {
4329 ::apache::thrift::RpcOptions rpcOptions;
4330 return sync_key(rpcOptions);
4331 }
4332
sync_key(apache::thrift::RpcOptions & rpcOptions)4333 ::std::int32_t service_with_special_namesAsyncClient::sync_key(apache::thrift::RpcOptions& rpcOptions) {
4334 apache::thrift::ClientReceiveState returnState;
4335 apache::thrift::ClientSyncCallback<false> callback(&returnState);
4336 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
4337 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
4338 auto ctxAndHeader = keyCtx(&rpcOptions);
4339 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
4340 callback.waitUntilDone(
4341 evb,
4342 [&] {
4343 keyImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
4344 });
4345
4346 if (returnState.isException()) {
4347 returnState.exception().throw_exception();
4348 }
4349 returnState.resetProtocolId(protocolId);
4350 returnState.resetCtx(std::move(ctxAndHeader.first));
4351 SCOPE_EXIT {
4352 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
4353 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
4354 }
4355 };
4356 return folly::fibers::runInMainContext([&] {
4357 return recv_key(returnState);
4358 });
4359 }
4360
4361
future_key()4362 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_key() {
4363 ::apache::thrift::RpcOptions rpcOptions;
4364 return future_key(rpcOptions);
4365 }
4366
semifuture_key()4367 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_key() {
4368 ::apache::thrift::RpcOptions rpcOptions;
4369 return semifuture_key(rpcOptions);
4370 }
4371
future_key(apache::thrift::RpcOptions & rpcOptions)4372 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_key(apache::thrift::RpcOptions& rpcOptions) {
4373 folly::Promise<::std::int32_t> promise;
4374 auto future = promise.getFuture();
4375 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_key, channel_);
4376 key(rpcOptions, std::move(callback));
4377 return future;
4378 }
4379
semifuture_key(apache::thrift::RpcOptions & rpcOptions)4380 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_key(apache::thrift::RpcOptions& rpcOptions) {
4381 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_key, channel_);
4382 auto callback = std::move(callbackAndFuture.first);
4383 key(rpcOptions, std::move(callback));
4384 return std::move(callbackAndFuture.second);
4385 }
4386
header_future_key(apache::thrift::RpcOptions & rpcOptions)4387 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_key(apache::thrift::RpcOptions& rpcOptions) {
4388 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
4389 auto future = promise.getFuture();
4390 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_key, channel_);
4391 key(rpcOptions, std::move(callback));
4392 return future;
4393 }
4394
header_semifuture_key(apache::thrift::RpcOptions & rpcOptions)4395 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_key(apache::thrift::RpcOptions& rpcOptions) {
4396 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_key, channel_);
4397 auto callback = std::move(callbackAndFuture.first);
4398 key(rpcOptions, std::move(callback));
4399 return std::move(callbackAndFuture.second);
4400 }
4401
key(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)4402 void service_with_special_namesAsyncClient::key(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
4403 key(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
4404 }
4405
4406 #if FOLLY_HAS_COROUTINES
4407 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_key(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)4408 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_key(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
4409 if (state.isException()) {
4410 return std::move(state.exception());
4411 }
4412 if (!state.hasResponseBuffer()) {
4413 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
4414 }
4415
4416 using result = service_with_special_names_key_presult;
4417 switch (state.protocolId()) {
4418 case apache::thrift::protocol::T_BINARY_PROTOCOL:
4419 {
4420 apache::thrift::BinaryProtocolReader reader;
4421 return apache::thrift::detail::ac::recv_wrapped<result>(
4422 &reader, state, _return);
4423 }
4424 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
4425 {
4426 apache::thrift::CompactProtocolReader reader;
4427 return apache::thrift::detail::ac::recv_wrapped<result>(
4428 &reader, state, _return);
4429 }
4430 default:
4431 {
4432 }
4433 }
4434 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
4435 }
4436
recv_key(::apache::thrift::ClientReceiveState & state)4437 ::std::int32_t service_with_special_namesAsyncClient::recv_key(::apache::thrift::ClientReceiveState& state) {
4438 ::std::int32_t _return;
4439 auto ew = recv_wrapped_key(_return, state);
4440 if (ew) {
4441 ew.throw_exception();
4442 }
4443 return _return;
4444 }
4445
recv_instance_key(::apache::thrift::ClientReceiveState & state)4446 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_key(::apache::thrift::ClientReceiveState& state) {
4447 return recv_key(state);
4448 }
4449
recv_instance_wrapped_key(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)4450 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_key(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
4451 return recv_wrapped_key(_return, state);
4452 }
4453
keys(std::unique_ptr<apache::thrift::RequestCallback> callback)4454 void service_with_special_namesAsyncClient::keys(std::unique_ptr<apache::thrift::RequestCallback> callback) {
4455 ::apache::thrift::RpcOptions rpcOptions;
4456 keys(rpcOptions, std::move(callback));
4457 }
4458
keys(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)4459 void service_with_special_namesAsyncClient::keys(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
4460 auto [ctx, header] = keysCtx(&rpcOptions);
4461 apache::thrift::RequestCallback::Context callbackContext;
4462 callbackContext.protocolId =
4463 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
4464 auto* contextStack = ctx.get();
4465 if (callback) {
4466 callbackContext.ctx = std::move(ctx);
4467 }
4468 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
4469 keysImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
4470 }
4471
keysImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)4472 void service_with_special_namesAsyncClient::keysImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
4473 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
4474 case apache::thrift::protocol::T_BINARY_PROTOCOL:
4475 {
4476 apache::thrift::BinaryProtocolWriter writer;
4477 if (stealRpcOptions) {
4478 keysT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
4479 } else {
4480 keysT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
4481 }
4482 break;
4483 }
4484 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
4485 {
4486 apache::thrift::CompactProtocolWriter writer;
4487 if (stealRpcOptions) {
4488 keysT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
4489 } else {
4490 keysT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
4491 }
4492 break;
4493 }
4494 default:
4495 {
4496 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
4497 }
4498 }
4499 }
4500
keysCtx(apache::thrift::RpcOptions * rpcOptions)4501 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::keysCtx(apache::thrift::RpcOptions* rpcOptions) {
4502 auto header = std::make_shared<apache::thrift::transport::THeader>(
4503 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
4504 header->setProtocolId(channel_->getProtocolId());
4505 if (rpcOptions) {
4506 header->setHeaders(rpcOptions->releaseWriteHeaders());
4507 }
4508
4509 auto ctx = apache::thrift::ContextStack::createWithClientContext(
4510 handlers_,
4511 getServiceName(),
4512 "service_with_special_names.keys",
4513 *header);
4514
4515 return {std::move(ctx), std::move(header)};
4516 }
4517
sync_keys()4518 ::std::int32_t service_with_special_namesAsyncClient::sync_keys() {
4519 ::apache::thrift::RpcOptions rpcOptions;
4520 return sync_keys(rpcOptions);
4521 }
4522
sync_keys(apache::thrift::RpcOptions & rpcOptions)4523 ::std::int32_t service_with_special_namesAsyncClient::sync_keys(apache::thrift::RpcOptions& rpcOptions) {
4524 apache::thrift::ClientReceiveState returnState;
4525 apache::thrift::ClientSyncCallback<false> callback(&returnState);
4526 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
4527 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
4528 auto ctxAndHeader = keysCtx(&rpcOptions);
4529 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
4530 callback.waitUntilDone(
4531 evb,
4532 [&] {
4533 keysImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
4534 });
4535
4536 if (returnState.isException()) {
4537 returnState.exception().throw_exception();
4538 }
4539 returnState.resetProtocolId(protocolId);
4540 returnState.resetCtx(std::move(ctxAndHeader.first));
4541 SCOPE_EXIT {
4542 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
4543 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
4544 }
4545 };
4546 return folly::fibers::runInMainContext([&] {
4547 return recv_keys(returnState);
4548 });
4549 }
4550
4551
future_keys()4552 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_keys() {
4553 ::apache::thrift::RpcOptions rpcOptions;
4554 return future_keys(rpcOptions);
4555 }
4556
semifuture_keys()4557 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_keys() {
4558 ::apache::thrift::RpcOptions rpcOptions;
4559 return semifuture_keys(rpcOptions);
4560 }
4561
future_keys(apache::thrift::RpcOptions & rpcOptions)4562 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_keys(apache::thrift::RpcOptions& rpcOptions) {
4563 folly::Promise<::std::int32_t> promise;
4564 auto future = promise.getFuture();
4565 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_keys, channel_);
4566 keys(rpcOptions, std::move(callback));
4567 return future;
4568 }
4569
semifuture_keys(apache::thrift::RpcOptions & rpcOptions)4570 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_keys(apache::thrift::RpcOptions& rpcOptions) {
4571 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_keys, channel_);
4572 auto callback = std::move(callbackAndFuture.first);
4573 keys(rpcOptions, std::move(callback));
4574 return std::move(callbackAndFuture.second);
4575 }
4576
header_future_keys(apache::thrift::RpcOptions & rpcOptions)4577 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_keys(apache::thrift::RpcOptions& rpcOptions) {
4578 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
4579 auto future = promise.getFuture();
4580 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_keys, channel_);
4581 keys(rpcOptions, std::move(callback));
4582 return future;
4583 }
4584
header_semifuture_keys(apache::thrift::RpcOptions & rpcOptions)4585 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_keys(apache::thrift::RpcOptions& rpcOptions) {
4586 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_keys, channel_);
4587 auto callback = std::move(callbackAndFuture.first);
4588 keys(rpcOptions, std::move(callback));
4589 return std::move(callbackAndFuture.second);
4590 }
4591
keys(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)4592 void service_with_special_namesAsyncClient::keys(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
4593 keys(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
4594 }
4595
4596 #if FOLLY_HAS_COROUTINES
4597 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_keys(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)4598 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_keys(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
4599 if (state.isException()) {
4600 return std::move(state.exception());
4601 }
4602 if (!state.hasResponseBuffer()) {
4603 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
4604 }
4605
4606 using result = service_with_special_names_keys_presult;
4607 switch (state.protocolId()) {
4608 case apache::thrift::protocol::T_BINARY_PROTOCOL:
4609 {
4610 apache::thrift::BinaryProtocolReader reader;
4611 return apache::thrift::detail::ac::recv_wrapped<result>(
4612 &reader, state, _return);
4613 }
4614 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
4615 {
4616 apache::thrift::CompactProtocolReader reader;
4617 return apache::thrift::detail::ac::recv_wrapped<result>(
4618 &reader, state, _return);
4619 }
4620 default:
4621 {
4622 }
4623 }
4624 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
4625 }
4626
recv_keys(::apache::thrift::ClientReceiveState & state)4627 ::std::int32_t service_with_special_namesAsyncClient::recv_keys(::apache::thrift::ClientReceiveState& state) {
4628 ::std::int32_t _return;
4629 auto ew = recv_wrapped_keys(_return, state);
4630 if (ew) {
4631 ew.throw_exception();
4632 }
4633 return _return;
4634 }
4635
recv_instance_keys(::apache::thrift::ClientReceiveState & state)4636 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_keys(::apache::thrift::ClientReceiveState& state) {
4637 return recv_keys(state);
4638 }
4639
recv_instance_wrapped_keys(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)4640 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_keys(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
4641 return recv_wrapped_keys(_return, state);
4642 }
4643
annotation(std::unique_ptr<apache::thrift::RequestCallback> callback)4644 void service_with_special_namesAsyncClient::annotation(std::unique_ptr<apache::thrift::RequestCallback> callback) {
4645 ::apache::thrift::RpcOptions rpcOptions;
4646 annotation(rpcOptions, std::move(callback));
4647 }
4648
annotation(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)4649 void service_with_special_namesAsyncClient::annotation(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
4650 auto [ctx, header] = annotationCtx(&rpcOptions);
4651 apache::thrift::RequestCallback::Context callbackContext;
4652 callbackContext.protocolId =
4653 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
4654 auto* contextStack = ctx.get();
4655 if (callback) {
4656 callbackContext.ctx = std::move(ctx);
4657 }
4658 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
4659 annotationImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
4660 }
4661
annotationImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)4662 void service_with_special_namesAsyncClient::annotationImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
4663 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
4664 case apache::thrift::protocol::T_BINARY_PROTOCOL:
4665 {
4666 apache::thrift::BinaryProtocolWriter writer;
4667 if (stealRpcOptions) {
4668 annotationT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
4669 } else {
4670 annotationT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
4671 }
4672 break;
4673 }
4674 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
4675 {
4676 apache::thrift::CompactProtocolWriter writer;
4677 if (stealRpcOptions) {
4678 annotationT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
4679 } else {
4680 annotationT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
4681 }
4682 break;
4683 }
4684 default:
4685 {
4686 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
4687 }
4688 }
4689 }
4690
annotationCtx(apache::thrift::RpcOptions * rpcOptions)4691 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::annotationCtx(apache::thrift::RpcOptions* rpcOptions) {
4692 auto header = std::make_shared<apache::thrift::transport::THeader>(
4693 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
4694 header->setProtocolId(channel_->getProtocolId());
4695 if (rpcOptions) {
4696 header->setHeaders(rpcOptions->releaseWriteHeaders());
4697 }
4698
4699 auto ctx = apache::thrift::ContextStack::createWithClientContext(
4700 handlers_,
4701 getServiceName(),
4702 "service_with_special_names.annotation",
4703 *header);
4704
4705 return {std::move(ctx), std::move(header)};
4706 }
4707
sync_annotation()4708 ::std::int32_t service_with_special_namesAsyncClient::sync_annotation() {
4709 ::apache::thrift::RpcOptions rpcOptions;
4710 return sync_annotation(rpcOptions);
4711 }
4712
sync_annotation(apache::thrift::RpcOptions & rpcOptions)4713 ::std::int32_t service_with_special_namesAsyncClient::sync_annotation(apache::thrift::RpcOptions& rpcOptions) {
4714 apache::thrift::ClientReceiveState returnState;
4715 apache::thrift::ClientSyncCallback<false> callback(&returnState);
4716 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
4717 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
4718 auto ctxAndHeader = annotationCtx(&rpcOptions);
4719 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
4720 callback.waitUntilDone(
4721 evb,
4722 [&] {
4723 annotationImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
4724 });
4725
4726 if (returnState.isException()) {
4727 returnState.exception().throw_exception();
4728 }
4729 returnState.resetProtocolId(protocolId);
4730 returnState.resetCtx(std::move(ctxAndHeader.first));
4731 SCOPE_EXIT {
4732 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
4733 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
4734 }
4735 };
4736 return folly::fibers::runInMainContext([&] {
4737 return recv_annotation(returnState);
4738 });
4739 }
4740
4741
future_annotation()4742 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_annotation() {
4743 ::apache::thrift::RpcOptions rpcOptions;
4744 return future_annotation(rpcOptions);
4745 }
4746
semifuture_annotation()4747 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_annotation() {
4748 ::apache::thrift::RpcOptions rpcOptions;
4749 return semifuture_annotation(rpcOptions);
4750 }
4751
future_annotation(apache::thrift::RpcOptions & rpcOptions)4752 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_annotation(apache::thrift::RpcOptions& rpcOptions) {
4753 folly::Promise<::std::int32_t> promise;
4754 auto future = promise.getFuture();
4755 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_annotation, channel_);
4756 annotation(rpcOptions, std::move(callback));
4757 return future;
4758 }
4759
semifuture_annotation(apache::thrift::RpcOptions & rpcOptions)4760 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_annotation(apache::thrift::RpcOptions& rpcOptions) {
4761 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_annotation, channel_);
4762 auto callback = std::move(callbackAndFuture.first);
4763 annotation(rpcOptions, std::move(callback));
4764 return std::move(callbackAndFuture.second);
4765 }
4766
header_future_annotation(apache::thrift::RpcOptions & rpcOptions)4767 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_annotation(apache::thrift::RpcOptions& rpcOptions) {
4768 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
4769 auto future = promise.getFuture();
4770 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_annotation, channel_);
4771 annotation(rpcOptions, std::move(callback));
4772 return future;
4773 }
4774
header_semifuture_annotation(apache::thrift::RpcOptions & rpcOptions)4775 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_annotation(apache::thrift::RpcOptions& rpcOptions) {
4776 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_annotation, channel_);
4777 auto callback = std::move(callbackAndFuture.first);
4778 annotation(rpcOptions, std::move(callback));
4779 return std::move(callbackAndFuture.second);
4780 }
4781
annotation(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)4782 void service_with_special_namesAsyncClient::annotation(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
4783 annotation(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
4784 }
4785
4786 #if FOLLY_HAS_COROUTINES
4787 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_annotation(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)4788 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_annotation(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
4789 if (state.isException()) {
4790 return std::move(state.exception());
4791 }
4792 if (!state.hasResponseBuffer()) {
4793 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
4794 }
4795
4796 using result = service_with_special_names_annotation_presult;
4797 switch (state.protocolId()) {
4798 case apache::thrift::protocol::T_BINARY_PROTOCOL:
4799 {
4800 apache::thrift::BinaryProtocolReader reader;
4801 return apache::thrift::detail::ac::recv_wrapped<result>(
4802 &reader, state, _return);
4803 }
4804 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
4805 {
4806 apache::thrift::CompactProtocolReader reader;
4807 return apache::thrift::detail::ac::recv_wrapped<result>(
4808 &reader, state, _return);
4809 }
4810 default:
4811 {
4812 }
4813 }
4814 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
4815 }
4816
recv_annotation(::apache::thrift::ClientReceiveState & state)4817 ::std::int32_t service_with_special_namesAsyncClient::recv_annotation(::apache::thrift::ClientReceiveState& state) {
4818 ::std::int32_t _return;
4819 auto ew = recv_wrapped_annotation(_return, state);
4820 if (ew) {
4821 ew.throw_exception();
4822 }
4823 return _return;
4824 }
4825
recv_instance_annotation(::apache::thrift::ClientReceiveState & state)4826 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_annotation(::apache::thrift::ClientReceiveState& state) {
4827 return recv_annotation(state);
4828 }
4829
recv_instance_wrapped_annotation(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)4830 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_annotation(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
4831 return recv_wrapped_annotation(_return, state);
4832 }
4833
annotations(std::unique_ptr<apache::thrift::RequestCallback> callback)4834 void service_with_special_namesAsyncClient::annotations(std::unique_ptr<apache::thrift::RequestCallback> callback) {
4835 ::apache::thrift::RpcOptions rpcOptions;
4836 annotations(rpcOptions, std::move(callback));
4837 }
4838
annotations(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)4839 void service_with_special_namesAsyncClient::annotations(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
4840 auto [ctx, header] = annotationsCtx(&rpcOptions);
4841 apache::thrift::RequestCallback::Context callbackContext;
4842 callbackContext.protocolId =
4843 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
4844 auto* contextStack = ctx.get();
4845 if (callback) {
4846 callbackContext.ctx = std::move(ctx);
4847 }
4848 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
4849 annotationsImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
4850 }
4851
annotationsImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)4852 void service_with_special_namesAsyncClient::annotationsImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
4853 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
4854 case apache::thrift::protocol::T_BINARY_PROTOCOL:
4855 {
4856 apache::thrift::BinaryProtocolWriter writer;
4857 if (stealRpcOptions) {
4858 annotationsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
4859 } else {
4860 annotationsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
4861 }
4862 break;
4863 }
4864 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
4865 {
4866 apache::thrift::CompactProtocolWriter writer;
4867 if (stealRpcOptions) {
4868 annotationsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
4869 } else {
4870 annotationsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
4871 }
4872 break;
4873 }
4874 default:
4875 {
4876 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
4877 }
4878 }
4879 }
4880
annotationsCtx(apache::thrift::RpcOptions * rpcOptions)4881 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::annotationsCtx(apache::thrift::RpcOptions* rpcOptions) {
4882 auto header = std::make_shared<apache::thrift::transport::THeader>(
4883 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
4884 header->setProtocolId(channel_->getProtocolId());
4885 if (rpcOptions) {
4886 header->setHeaders(rpcOptions->releaseWriteHeaders());
4887 }
4888
4889 auto ctx = apache::thrift::ContextStack::createWithClientContext(
4890 handlers_,
4891 getServiceName(),
4892 "service_with_special_names.annotations",
4893 *header);
4894
4895 return {std::move(ctx), std::move(header)};
4896 }
4897
sync_annotations()4898 ::std::int32_t service_with_special_namesAsyncClient::sync_annotations() {
4899 ::apache::thrift::RpcOptions rpcOptions;
4900 return sync_annotations(rpcOptions);
4901 }
4902
sync_annotations(apache::thrift::RpcOptions & rpcOptions)4903 ::std::int32_t service_with_special_namesAsyncClient::sync_annotations(apache::thrift::RpcOptions& rpcOptions) {
4904 apache::thrift::ClientReceiveState returnState;
4905 apache::thrift::ClientSyncCallback<false> callback(&returnState);
4906 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
4907 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
4908 auto ctxAndHeader = annotationsCtx(&rpcOptions);
4909 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
4910 callback.waitUntilDone(
4911 evb,
4912 [&] {
4913 annotationsImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
4914 });
4915
4916 if (returnState.isException()) {
4917 returnState.exception().throw_exception();
4918 }
4919 returnState.resetProtocolId(protocolId);
4920 returnState.resetCtx(std::move(ctxAndHeader.first));
4921 SCOPE_EXIT {
4922 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
4923 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
4924 }
4925 };
4926 return folly::fibers::runInMainContext([&] {
4927 return recv_annotations(returnState);
4928 });
4929 }
4930
4931
future_annotations()4932 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_annotations() {
4933 ::apache::thrift::RpcOptions rpcOptions;
4934 return future_annotations(rpcOptions);
4935 }
4936
semifuture_annotations()4937 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_annotations() {
4938 ::apache::thrift::RpcOptions rpcOptions;
4939 return semifuture_annotations(rpcOptions);
4940 }
4941
future_annotations(apache::thrift::RpcOptions & rpcOptions)4942 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_annotations(apache::thrift::RpcOptions& rpcOptions) {
4943 folly::Promise<::std::int32_t> promise;
4944 auto future = promise.getFuture();
4945 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_annotations, channel_);
4946 annotations(rpcOptions, std::move(callback));
4947 return future;
4948 }
4949
semifuture_annotations(apache::thrift::RpcOptions & rpcOptions)4950 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_annotations(apache::thrift::RpcOptions& rpcOptions) {
4951 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_annotations, channel_);
4952 auto callback = std::move(callbackAndFuture.first);
4953 annotations(rpcOptions, std::move(callback));
4954 return std::move(callbackAndFuture.second);
4955 }
4956
header_future_annotations(apache::thrift::RpcOptions & rpcOptions)4957 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_annotations(apache::thrift::RpcOptions& rpcOptions) {
4958 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
4959 auto future = promise.getFuture();
4960 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_annotations, channel_);
4961 annotations(rpcOptions, std::move(callback));
4962 return future;
4963 }
4964
header_semifuture_annotations(apache::thrift::RpcOptions & rpcOptions)4965 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_annotations(apache::thrift::RpcOptions& rpcOptions) {
4966 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_annotations, channel_);
4967 auto callback = std::move(callbackAndFuture.first);
4968 annotations(rpcOptions, std::move(callback));
4969 return std::move(callbackAndFuture.second);
4970 }
4971
annotations(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)4972 void service_with_special_namesAsyncClient::annotations(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
4973 annotations(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
4974 }
4975
4976 #if FOLLY_HAS_COROUTINES
4977 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_annotations(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)4978 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_annotations(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
4979 if (state.isException()) {
4980 return std::move(state.exception());
4981 }
4982 if (!state.hasResponseBuffer()) {
4983 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
4984 }
4985
4986 using result = service_with_special_names_annotations_presult;
4987 switch (state.protocolId()) {
4988 case apache::thrift::protocol::T_BINARY_PROTOCOL:
4989 {
4990 apache::thrift::BinaryProtocolReader reader;
4991 return apache::thrift::detail::ac::recv_wrapped<result>(
4992 &reader, state, _return);
4993 }
4994 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
4995 {
4996 apache::thrift::CompactProtocolReader reader;
4997 return apache::thrift::detail::ac::recv_wrapped<result>(
4998 &reader, state, _return);
4999 }
5000 default:
5001 {
5002 }
5003 }
5004 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
5005 }
5006
recv_annotations(::apache::thrift::ClientReceiveState & state)5007 ::std::int32_t service_with_special_namesAsyncClient::recv_annotations(::apache::thrift::ClientReceiveState& state) {
5008 ::std::int32_t _return;
5009 auto ew = recv_wrapped_annotations(_return, state);
5010 if (ew) {
5011 ew.throw_exception();
5012 }
5013 return _return;
5014 }
5015
recv_instance_annotations(::apache::thrift::ClientReceiveState & state)5016 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_annotations(::apache::thrift::ClientReceiveState& state) {
5017 return recv_annotations(state);
5018 }
5019
recv_instance_wrapped_annotations(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)5020 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_annotations(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
5021 return recv_wrapped_annotations(_return, state);
5022 }
5023
member(std::unique_ptr<apache::thrift::RequestCallback> callback)5024 void service_with_special_namesAsyncClient::member(std::unique_ptr<apache::thrift::RequestCallback> callback) {
5025 ::apache::thrift::RpcOptions rpcOptions;
5026 member(rpcOptions, std::move(callback));
5027 }
5028
member(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)5029 void service_with_special_namesAsyncClient::member(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
5030 auto [ctx, header] = memberCtx(&rpcOptions);
5031 apache::thrift::RequestCallback::Context callbackContext;
5032 callbackContext.protocolId =
5033 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
5034 auto* contextStack = ctx.get();
5035 if (callback) {
5036 callbackContext.ctx = std::move(ctx);
5037 }
5038 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
5039 memberImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
5040 }
5041
memberImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)5042 void service_with_special_namesAsyncClient::memberImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
5043 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
5044 case apache::thrift::protocol::T_BINARY_PROTOCOL:
5045 {
5046 apache::thrift::BinaryProtocolWriter writer;
5047 if (stealRpcOptions) {
5048 memberT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
5049 } else {
5050 memberT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
5051 }
5052 break;
5053 }
5054 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
5055 {
5056 apache::thrift::CompactProtocolWriter writer;
5057 if (stealRpcOptions) {
5058 memberT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
5059 } else {
5060 memberT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
5061 }
5062 break;
5063 }
5064 default:
5065 {
5066 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
5067 }
5068 }
5069 }
5070
memberCtx(apache::thrift::RpcOptions * rpcOptions)5071 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::memberCtx(apache::thrift::RpcOptions* rpcOptions) {
5072 auto header = std::make_shared<apache::thrift::transport::THeader>(
5073 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
5074 header->setProtocolId(channel_->getProtocolId());
5075 if (rpcOptions) {
5076 header->setHeaders(rpcOptions->releaseWriteHeaders());
5077 }
5078
5079 auto ctx = apache::thrift::ContextStack::createWithClientContext(
5080 handlers_,
5081 getServiceName(),
5082 "service_with_special_names.member",
5083 *header);
5084
5085 return {std::move(ctx), std::move(header)};
5086 }
5087
sync_member()5088 ::std::int32_t service_with_special_namesAsyncClient::sync_member() {
5089 ::apache::thrift::RpcOptions rpcOptions;
5090 return sync_member(rpcOptions);
5091 }
5092
sync_member(apache::thrift::RpcOptions & rpcOptions)5093 ::std::int32_t service_with_special_namesAsyncClient::sync_member(apache::thrift::RpcOptions& rpcOptions) {
5094 apache::thrift::ClientReceiveState returnState;
5095 apache::thrift::ClientSyncCallback<false> callback(&returnState);
5096 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
5097 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
5098 auto ctxAndHeader = memberCtx(&rpcOptions);
5099 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
5100 callback.waitUntilDone(
5101 evb,
5102 [&] {
5103 memberImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
5104 });
5105
5106 if (returnState.isException()) {
5107 returnState.exception().throw_exception();
5108 }
5109 returnState.resetProtocolId(protocolId);
5110 returnState.resetCtx(std::move(ctxAndHeader.first));
5111 SCOPE_EXIT {
5112 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
5113 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
5114 }
5115 };
5116 return folly::fibers::runInMainContext([&] {
5117 return recv_member(returnState);
5118 });
5119 }
5120
5121
future_member()5122 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_member() {
5123 ::apache::thrift::RpcOptions rpcOptions;
5124 return future_member(rpcOptions);
5125 }
5126
semifuture_member()5127 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_member() {
5128 ::apache::thrift::RpcOptions rpcOptions;
5129 return semifuture_member(rpcOptions);
5130 }
5131
future_member(apache::thrift::RpcOptions & rpcOptions)5132 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_member(apache::thrift::RpcOptions& rpcOptions) {
5133 folly::Promise<::std::int32_t> promise;
5134 auto future = promise.getFuture();
5135 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_member, channel_);
5136 member(rpcOptions, std::move(callback));
5137 return future;
5138 }
5139
semifuture_member(apache::thrift::RpcOptions & rpcOptions)5140 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_member(apache::thrift::RpcOptions& rpcOptions) {
5141 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_member, channel_);
5142 auto callback = std::move(callbackAndFuture.first);
5143 member(rpcOptions, std::move(callback));
5144 return std::move(callbackAndFuture.second);
5145 }
5146
header_future_member(apache::thrift::RpcOptions & rpcOptions)5147 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_member(apache::thrift::RpcOptions& rpcOptions) {
5148 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
5149 auto future = promise.getFuture();
5150 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_member, channel_);
5151 member(rpcOptions, std::move(callback));
5152 return future;
5153 }
5154
header_semifuture_member(apache::thrift::RpcOptions & rpcOptions)5155 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_member(apache::thrift::RpcOptions& rpcOptions) {
5156 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_member, channel_);
5157 auto callback = std::move(callbackAndFuture.first);
5158 member(rpcOptions, std::move(callback));
5159 return std::move(callbackAndFuture.second);
5160 }
5161
member(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)5162 void service_with_special_namesAsyncClient::member(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
5163 member(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
5164 }
5165
5166 #if FOLLY_HAS_COROUTINES
5167 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_member(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)5168 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_member(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
5169 if (state.isException()) {
5170 return std::move(state.exception());
5171 }
5172 if (!state.hasResponseBuffer()) {
5173 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
5174 }
5175
5176 using result = service_with_special_names_member_presult;
5177 switch (state.protocolId()) {
5178 case apache::thrift::protocol::T_BINARY_PROTOCOL:
5179 {
5180 apache::thrift::BinaryProtocolReader reader;
5181 return apache::thrift::detail::ac::recv_wrapped<result>(
5182 &reader, state, _return);
5183 }
5184 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
5185 {
5186 apache::thrift::CompactProtocolReader reader;
5187 return apache::thrift::detail::ac::recv_wrapped<result>(
5188 &reader, state, _return);
5189 }
5190 default:
5191 {
5192 }
5193 }
5194 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
5195 }
5196
recv_member(::apache::thrift::ClientReceiveState & state)5197 ::std::int32_t service_with_special_namesAsyncClient::recv_member(::apache::thrift::ClientReceiveState& state) {
5198 ::std::int32_t _return;
5199 auto ew = recv_wrapped_member(_return, state);
5200 if (ew) {
5201 ew.throw_exception();
5202 }
5203 return _return;
5204 }
5205
recv_instance_member(::apache::thrift::ClientReceiveState & state)5206 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_member(::apache::thrift::ClientReceiveState& state) {
5207 return recv_member(state);
5208 }
5209
recv_instance_wrapped_member(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)5210 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_member(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
5211 return recv_wrapped_member(_return, state);
5212 }
5213
members(std::unique_ptr<apache::thrift::RequestCallback> callback)5214 void service_with_special_namesAsyncClient::members(std::unique_ptr<apache::thrift::RequestCallback> callback) {
5215 ::apache::thrift::RpcOptions rpcOptions;
5216 members(rpcOptions, std::move(callback));
5217 }
5218
members(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)5219 void service_with_special_namesAsyncClient::members(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
5220 auto [ctx, header] = membersCtx(&rpcOptions);
5221 apache::thrift::RequestCallback::Context callbackContext;
5222 callbackContext.protocolId =
5223 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
5224 auto* contextStack = ctx.get();
5225 if (callback) {
5226 callbackContext.ctx = std::move(ctx);
5227 }
5228 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
5229 membersImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
5230 }
5231
membersImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)5232 void service_with_special_namesAsyncClient::membersImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
5233 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
5234 case apache::thrift::protocol::T_BINARY_PROTOCOL:
5235 {
5236 apache::thrift::BinaryProtocolWriter writer;
5237 if (stealRpcOptions) {
5238 membersT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
5239 } else {
5240 membersT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
5241 }
5242 break;
5243 }
5244 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
5245 {
5246 apache::thrift::CompactProtocolWriter writer;
5247 if (stealRpcOptions) {
5248 membersT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
5249 } else {
5250 membersT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
5251 }
5252 break;
5253 }
5254 default:
5255 {
5256 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
5257 }
5258 }
5259 }
5260
membersCtx(apache::thrift::RpcOptions * rpcOptions)5261 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::membersCtx(apache::thrift::RpcOptions* rpcOptions) {
5262 auto header = std::make_shared<apache::thrift::transport::THeader>(
5263 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
5264 header->setProtocolId(channel_->getProtocolId());
5265 if (rpcOptions) {
5266 header->setHeaders(rpcOptions->releaseWriteHeaders());
5267 }
5268
5269 auto ctx = apache::thrift::ContextStack::createWithClientContext(
5270 handlers_,
5271 getServiceName(),
5272 "service_with_special_names.members",
5273 *header);
5274
5275 return {std::move(ctx), std::move(header)};
5276 }
5277
sync_members()5278 ::std::int32_t service_with_special_namesAsyncClient::sync_members() {
5279 ::apache::thrift::RpcOptions rpcOptions;
5280 return sync_members(rpcOptions);
5281 }
5282
sync_members(apache::thrift::RpcOptions & rpcOptions)5283 ::std::int32_t service_with_special_namesAsyncClient::sync_members(apache::thrift::RpcOptions& rpcOptions) {
5284 apache::thrift::ClientReceiveState returnState;
5285 apache::thrift::ClientSyncCallback<false> callback(&returnState);
5286 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
5287 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
5288 auto ctxAndHeader = membersCtx(&rpcOptions);
5289 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
5290 callback.waitUntilDone(
5291 evb,
5292 [&] {
5293 membersImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
5294 });
5295
5296 if (returnState.isException()) {
5297 returnState.exception().throw_exception();
5298 }
5299 returnState.resetProtocolId(protocolId);
5300 returnState.resetCtx(std::move(ctxAndHeader.first));
5301 SCOPE_EXIT {
5302 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
5303 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
5304 }
5305 };
5306 return folly::fibers::runInMainContext([&] {
5307 return recv_members(returnState);
5308 });
5309 }
5310
5311
future_members()5312 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_members() {
5313 ::apache::thrift::RpcOptions rpcOptions;
5314 return future_members(rpcOptions);
5315 }
5316
semifuture_members()5317 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_members() {
5318 ::apache::thrift::RpcOptions rpcOptions;
5319 return semifuture_members(rpcOptions);
5320 }
5321
future_members(apache::thrift::RpcOptions & rpcOptions)5322 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_members(apache::thrift::RpcOptions& rpcOptions) {
5323 folly::Promise<::std::int32_t> promise;
5324 auto future = promise.getFuture();
5325 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_members, channel_);
5326 members(rpcOptions, std::move(callback));
5327 return future;
5328 }
5329
semifuture_members(apache::thrift::RpcOptions & rpcOptions)5330 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_members(apache::thrift::RpcOptions& rpcOptions) {
5331 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_members, channel_);
5332 auto callback = std::move(callbackAndFuture.first);
5333 members(rpcOptions, std::move(callback));
5334 return std::move(callbackAndFuture.second);
5335 }
5336
header_future_members(apache::thrift::RpcOptions & rpcOptions)5337 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_members(apache::thrift::RpcOptions& rpcOptions) {
5338 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
5339 auto future = promise.getFuture();
5340 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_members, channel_);
5341 members(rpcOptions, std::move(callback));
5342 return future;
5343 }
5344
header_semifuture_members(apache::thrift::RpcOptions & rpcOptions)5345 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_members(apache::thrift::RpcOptions& rpcOptions) {
5346 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_members, channel_);
5347 auto callback = std::move(callbackAndFuture.first);
5348 members(rpcOptions, std::move(callback));
5349 return std::move(callbackAndFuture.second);
5350 }
5351
members(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)5352 void service_with_special_namesAsyncClient::members(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
5353 members(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
5354 }
5355
5356 #if FOLLY_HAS_COROUTINES
5357 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_members(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)5358 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_members(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
5359 if (state.isException()) {
5360 return std::move(state.exception());
5361 }
5362 if (!state.hasResponseBuffer()) {
5363 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
5364 }
5365
5366 using result = service_with_special_names_members_presult;
5367 switch (state.protocolId()) {
5368 case apache::thrift::protocol::T_BINARY_PROTOCOL:
5369 {
5370 apache::thrift::BinaryProtocolReader reader;
5371 return apache::thrift::detail::ac::recv_wrapped<result>(
5372 &reader, state, _return);
5373 }
5374 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
5375 {
5376 apache::thrift::CompactProtocolReader reader;
5377 return apache::thrift::detail::ac::recv_wrapped<result>(
5378 &reader, state, _return);
5379 }
5380 default:
5381 {
5382 }
5383 }
5384 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
5385 }
5386
recv_members(::apache::thrift::ClientReceiveState & state)5387 ::std::int32_t service_with_special_namesAsyncClient::recv_members(::apache::thrift::ClientReceiveState& state) {
5388 ::std::int32_t _return;
5389 auto ew = recv_wrapped_members(_return, state);
5390 if (ew) {
5391 ew.throw_exception();
5392 }
5393 return _return;
5394 }
5395
recv_instance_members(::apache::thrift::ClientReceiveState & state)5396 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_members(::apache::thrift::ClientReceiveState& state) {
5397 return recv_members(state);
5398 }
5399
recv_instance_wrapped_members(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)5400 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_members(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
5401 return recv_wrapped_members(_return, state);
5402 }
5403
field(std::unique_ptr<apache::thrift::RequestCallback> callback)5404 void service_with_special_namesAsyncClient::field(std::unique_ptr<apache::thrift::RequestCallback> callback) {
5405 ::apache::thrift::RpcOptions rpcOptions;
5406 field(rpcOptions, std::move(callback));
5407 }
5408
field(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)5409 void service_with_special_namesAsyncClient::field(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
5410 auto [ctx, header] = fieldCtx(&rpcOptions);
5411 apache::thrift::RequestCallback::Context callbackContext;
5412 callbackContext.protocolId =
5413 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
5414 auto* contextStack = ctx.get();
5415 if (callback) {
5416 callbackContext.ctx = std::move(ctx);
5417 }
5418 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
5419 fieldImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
5420 }
5421
fieldImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)5422 void service_with_special_namesAsyncClient::fieldImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
5423 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
5424 case apache::thrift::protocol::T_BINARY_PROTOCOL:
5425 {
5426 apache::thrift::BinaryProtocolWriter writer;
5427 if (stealRpcOptions) {
5428 fieldT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
5429 } else {
5430 fieldT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
5431 }
5432 break;
5433 }
5434 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
5435 {
5436 apache::thrift::CompactProtocolWriter writer;
5437 if (stealRpcOptions) {
5438 fieldT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
5439 } else {
5440 fieldT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
5441 }
5442 break;
5443 }
5444 default:
5445 {
5446 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
5447 }
5448 }
5449 }
5450
fieldCtx(apache::thrift::RpcOptions * rpcOptions)5451 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::fieldCtx(apache::thrift::RpcOptions* rpcOptions) {
5452 auto header = std::make_shared<apache::thrift::transport::THeader>(
5453 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
5454 header->setProtocolId(channel_->getProtocolId());
5455 if (rpcOptions) {
5456 header->setHeaders(rpcOptions->releaseWriteHeaders());
5457 }
5458
5459 auto ctx = apache::thrift::ContextStack::createWithClientContext(
5460 handlers_,
5461 getServiceName(),
5462 "service_with_special_names.field",
5463 *header);
5464
5465 return {std::move(ctx), std::move(header)};
5466 }
5467
sync_field()5468 ::std::int32_t service_with_special_namesAsyncClient::sync_field() {
5469 ::apache::thrift::RpcOptions rpcOptions;
5470 return sync_field(rpcOptions);
5471 }
5472
sync_field(apache::thrift::RpcOptions & rpcOptions)5473 ::std::int32_t service_with_special_namesAsyncClient::sync_field(apache::thrift::RpcOptions& rpcOptions) {
5474 apache::thrift::ClientReceiveState returnState;
5475 apache::thrift::ClientSyncCallback<false> callback(&returnState);
5476 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
5477 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
5478 auto ctxAndHeader = fieldCtx(&rpcOptions);
5479 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
5480 callback.waitUntilDone(
5481 evb,
5482 [&] {
5483 fieldImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
5484 });
5485
5486 if (returnState.isException()) {
5487 returnState.exception().throw_exception();
5488 }
5489 returnState.resetProtocolId(protocolId);
5490 returnState.resetCtx(std::move(ctxAndHeader.first));
5491 SCOPE_EXIT {
5492 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
5493 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
5494 }
5495 };
5496 return folly::fibers::runInMainContext([&] {
5497 return recv_field(returnState);
5498 });
5499 }
5500
5501
future_field()5502 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_field() {
5503 ::apache::thrift::RpcOptions rpcOptions;
5504 return future_field(rpcOptions);
5505 }
5506
semifuture_field()5507 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_field() {
5508 ::apache::thrift::RpcOptions rpcOptions;
5509 return semifuture_field(rpcOptions);
5510 }
5511
future_field(apache::thrift::RpcOptions & rpcOptions)5512 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_field(apache::thrift::RpcOptions& rpcOptions) {
5513 folly::Promise<::std::int32_t> promise;
5514 auto future = promise.getFuture();
5515 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_field, channel_);
5516 field(rpcOptions, std::move(callback));
5517 return future;
5518 }
5519
semifuture_field(apache::thrift::RpcOptions & rpcOptions)5520 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_field(apache::thrift::RpcOptions& rpcOptions) {
5521 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_field, channel_);
5522 auto callback = std::move(callbackAndFuture.first);
5523 field(rpcOptions, std::move(callback));
5524 return std::move(callbackAndFuture.second);
5525 }
5526
header_future_field(apache::thrift::RpcOptions & rpcOptions)5527 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_field(apache::thrift::RpcOptions& rpcOptions) {
5528 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
5529 auto future = promise.getFuture();
5530 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_field, channel_);
5531 field(rpcOptions, std::move(callback));
5532 return future;
5533 }
5534
header_semifuture_field(apache::thrift::RpcOptions & rpcOptions)5535 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_field(apache::thrift::RpcOptions& rpcOptions) {
5536 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_field, channel_);
5537 auto callback = std::move(callbackAndFuture.first);
5538 field(rpcOptions, std::move(callback));
5539 return std::move(callbackAndFuture.second);
5540 }
5541
field(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)5542 void service_with_special_namesAsyncClient::field(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
5543 field(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
5544 }
5545
5546 #if FOLLY_HAS_COROUTINES
5547 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_field(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)5548 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_field(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
5549 if (state.isException()) {
5550 return std::move(state.exception());
5551 }
5552 if (!state.hasResponseBuffer()) {
5553 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
5554 }
5555
5556 using result = service_with_special_names_field_presult;
5557 switch (state.protocolId()) {
5558 case apache::thrift::protocol::T_BINARY_PROTOCOL:
5559 {
5560 apache::thrift::BinaryProtocolReader reader;
5561 return apache::thrift::detail::ac::recv_wrapped<result>(
5562 &reader, state, _return);
5563 }
5564 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
5565 {
5566 apache::thrift::CompactProtocolReader reader;
5567 return apache::thrift::detail::ac::recv_wrapped<result>(
5568 &reader, state, _return);
5569 }
5570 default:
5571 {
5572 }
5573 }
5574 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
5575 }
5576
recv_field(::apache::thrift::ClientReceiveState & state)5577 ::std::int32_t service_with_special_namesAsyncClient::recv_field(::apache::thrift::ClientReceiveState& state) {
5578 ::std::int32_t _return;
5579 auto ew = recv_wrapped_field(_return, state);
5580 if (ew) {
5581 ew.throw_exception();
5582 }
5583 return _return;
5584 }
5585
recv_instance_field(::apache::thrift::ClientReceiveState & state)5586 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_field(::apache::thrift::ClientReceiveState& state) {
5587 return recv_field(state);
5588 }
5589
recv_instance_wrapped_field(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)5590 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_field(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
5591 return recv_wrapped_field(_return, state);
5592 }
5593
fields(std::unique_ptr<apache::thrift::RequestCallback> callback)5594 void service_with_special_namesAsyncClient::fields(std::unique_ptr<apache::thrift::RequestCallback> callback) {
5595 ::apache::thrift::RpcOptions rpcOptions;
5596 fields(rpcOptions, std::move(callback));
5597 }
5598
fields(apache::thrift::RpcOptions & rpcOptions,std::unique_ptr<apache::thrift::RequestCallback> callback)5599 void service_with_special_namesAsyncClient::fields(apache::thrift::RpcOptions& rpcOptions, std::unique_ptr<apache::thrift::RequestCallback> callback) {
5600 auto [ctx, header] = fieldsCtx(&rpcOptions);
5601 apache::thrift::RequestCallback::Context callbackContext;
5602 callbackContext.protocolId =
5603 apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
5604 auto* contextStack = ctx.get();
5605 if (callback) {
5606 callbackContext.ctx = std::move(ctx);
5607 }
5608 auto wrappedCallback = apache::thrift::toRequestClientCallbackPtr(std::move(callback), std::move(callbackContext));
5609 fieldsImpl(rpcOptions, std::move(header), contextStack, std::move(wrappedCallback));
5610 }
5611
fieldsImpl(apache::thrift::RpcOptions & rpcOptions,std::shared_ptr<apache::thrift::transport::THeader> header,apache::thrift::ContextStack * contextStack,apache::thrift::RequestClientCallback::Ptr callback,bool stealRpcOptions)5612 void service_with_special_namesAsyncClient::fieldsImpl(apache::thrift::RpcOptions& rpcOptions, std::shared_ptr<apache::thrift::transport::THeader> header, apache::thrift::ContextStack* contextStack, apache::thrift::RequestClientCallback::Ptr callback, bool stealRpcOptions) {
5613 switch (apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId()) {
5614 case apache::thrift::protocol::T_BINARY_PROTOCOL:
5615 {
5616 apache::thrift::BinaryProtocolWriter writer;
5617 if (stealRpcOptions) {
5618 fieldsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
5619 } else {
5620 fieldsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
5621 }
5622 break;
5623 }
5624 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
5625 {
5626 apache::thrift::CompactProtocolWriter writer;
5627 if (stealRpcOptions) {
5628 fieldsT(&writer, std::move(rpcOptions), std::move(header), contextStack, std::move(callback));
5629 } else {
5630 fieldsT(&writer, rpcOptions, std::move(header), contextStack, std::move(callback));
5631 }
5632 break;
5633 }
5634 default:
5635 {
5636 apache::thrift::detail::ac::throw_app_exn("Could not find Protocol");
5637 }
5638 }
5639 }
5640
fieldsCtx(apache::thrift::RpcOptions * rpcOptions)5641 std::pair<std::unique_ptr<::apache::thrift::ContextStack>, std::shared_ptr<::apache::thrift::transport::THeader>> service_with_special_namesAsyncClient::fieldsCtx(apache::thrift::RpcOptions* rpcOptions) {
5642 auto header = std::make_shared<apache::thrift::transport::THeader>(
5643 apache::thrift::transport::THeader::ALLOW_BIG_FRAMES);
5644 header->setProtocolId(channel_->getProtocolId());
5645 if (rpcOptions) {
5646 header->setHeaders(rpcOptions->releaseWriteHeaders());
5647 }
5648
5649 auto ctx = apache::thrift::ContextStack::createWithClientContext(
5650 handlers_,
5651 getServiceName(),
5652 "service_with_special_names.fields",
5653 *header);
5654
5655 return {std::move(ctx), std::move(header)};
5656 }
5657
sync_fields()5658 ::std::int32_t service_with_special_namesAsyncClient::sync_fields() {
5659 ::apache::thrift::RpcOptions rpcOptions;
5660 return sync_fields(rpcOptions);
5661 }
5662
sync_fields(apache::thrift::RpcOptions & rpcOptions)5663 ::std::int32_t service_with_special_namesAsyncClient::sync_fields(apache::thrift::RpcOptions& rpcOptions) {
5664 apache::thrift::ClientReceiveState returnState;
5665 apache::thrift::ClientSyncCallback<false> callback(&returnState);
5666 auto protocolId = apache::thrift::GeneratedAsyncClient::getChannel()->getProtocolId();
5667 auto evb = apache::thrift::GeneratedAsyncClient::getChannel()->getEventBase();
5668 auto ctxAndHeader = fieldsCtx(&rpcOptions);
5669 auto wrappedCallback = apache::thrift::RequestClientCallback::Ptr(&callback);
5670 callback.waitUntilDone(
5671 evb,
5672 [&] {
5673 fieldsImpl(rpcOptions, std::move(ctxAndHeader.second), ctxAndHeader.first.get(), std::move(wrappedCallback));
5674 });
5675
5676 if (returnState.isException()) {
5677 returnState.exception().throw_exception();
5678 }
5679 returnState.resetProtocolId(protocolId);
5680 returnState.resetCtx(std::move(ctxAndHeader.first));
5681 SCOPE_EXIT {
5682 if (returnState.header() && !returnState.header()->getHeaders().empty()) {
5683 rpcOptions.setReadHeaders(returnState.header()->releaseHeaders());
5684 }
5685 };
5686 return folly::fibers::runInMainContext([&] {
5687 return recv_fields(returnState);
5688 });
5689 }
5690
5691
future_fields()5692 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_fields() {
5693 ::apache::thrift::RpcOptions rpcOptions;
5694 return future_fields(rpcOptions);
5695 }
5696
semifuture_fields()5697 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_fields() {
5698 ::apache::thrift::RpcOptions rpcOptions;
5699 return semifuture_fields(rpcOptions);
5700 }
5701
future_fields(apache::thrift::RpcOptions & rpcOptions)5702 folly::Future<::std::int32_t> service_with_special_namesAsyncClient::future_fields(apache::thrift::RpcOptions& rpcOptions) {
5703 folly::Promise<::std::int32_t> promise;
5704 auto future = promise.getFuture();
5705 auto callback = std::make_unique<apache::thrift::FutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_fields, channel_);
5706 fields(rpcOptions, std::move(callback));
5707 return future;
5708 }
5709
semifuture_fields(apache::thrift::RpcOptions & rpcOptions)5710 folly::SemiFuture<::std::int32_t> service_with_special_namesAsyncClient::semifuture_fields(apache::thrift::RpcOptions& rpcOptions) {
5711 auto callbackAndFuture = makeSemiFutureCallback(recv_wrapped_fields, channel_);
5712 auto callback = std::move(callbackAndFuture.first);
5713 fields(rpcOptions, std::move(callback));
5714 return std::move(callbackAndFuture.second);
5715 }
5716
header_future_fields(apache::thrift::RpcOptions & rpcOptions)5717 folly::Future<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_future_fields(apache::thrift::RpcOptions& rpcOptions) {
5718 folly::Promise<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> promise;
5719 auto future = promise.getFuture();
5720 auto callback = std::make_unique<apache::thrift::HeaderFutureCallback<::std::int32_t>>(std::move(promise), recv_wrapped_fields, channel_);
5721 fields(rpcOptions, std::move(callback));
5722 return future;
5723 }
5724
header_semifuture_fields(apache::thrift::RpcOptions & rpcOptions)5725 folly::SemiFuture<std::pair<::std::int32_t, std::unique_ptr<apache::thrift::transport::THeader>>> service_with_special_namesAsyncClient::header_semifuture_fields(apache::thrift::RpcOptions& rpcOptions) {
5726 auto callbackAndFuture = makeHeaderSemiFutureCallback(recv_wrapped_fields, channel_);
5727 auto callback = std::move(callbackAndFuture.first);
5728 fields(rpcOptions, std::move(callback));
5729 return std::move(callbackAndFuture.second);
5730 }
5731
fields(folly::Function<void (::apache::thrift::ClientReceiveState &&)> callback)5732 void service_with_special_namesAsyncClient::fields(folly::Function<void (::apache::thrift::ClientReceiveState&&)> callback) {
5733 fields(std::make_unique<apache::thrift::FunctionReplyCallback>(std::move(callback)));
5734 }
5735
5736 #if FOLLY_HAS_COROUTINES
5737 #endif // FOLLY_HAS_COROUTINES
recv_wrapped_fields(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)5738 folly::exception_wrapper service_with_special_namesAsyncClient::recv_wrapped_fields(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
5739 if (state.isException()) {
5740 return std::move(state.exception());
5741 }
5742 if (!state.hasResponseBuffer()) {
5743 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("recv_ called without result");
5744 }
5745
5746 using result = service_with_special_names_fields_presult;
5747 switch (state.protocolId()) {
5748 case apache::thrift::protocol::T_BINARY_PROTOCOL:
5749 {
5750 apache::thrift::BinaryProtocolReader reader;
5751 return apache::thrift::detail::ac::recv_wrapped<result>(
5752 &reader, state, _return);
5753 }
5754 case apache::thrift::protocol::T_COMPACT_PROTOCOL:
5755 {
5756 apache::thrift::CompactProtocolReader reader;
5757 return apache::thrift::detail::ac::recv_wrapped<result>(
5758 &reader, state, _return);
5759 }
5760 default:
5761 {
5762 }
5763 }
5764 return folly::make_exception_wrapper<apache::thrift::TApplicationException>("Could not find Protocol");
5765 }
5766
recv_fields(::apache::thrift::ClientReceiveState & state)5767 ::std::int32_t service_with_special_namesAsyncClient::recv_fields(::apache::thrift::ClientReceiveState& state) {
5768 ::std::int32_t _return;
5769 auto ew = recv_wrapped_fields(_return, state);
5770 if (ew) {
5771 ew.throw_exception();
5772 }
5773 return _return;
5774 }
5775
recv_instance_fields(::apache::thrift::ClientReceiveState & state)5776 ::std::int32_t service_with_special_namesAsyncClient::recv_instance_fields(::apache::thrift::ClientReceiveState& state) {
5777 return recv_fields(state);
5778 }
5779
recv_instance_wrapped_fields(::std::int32_t & _return,::apache::thrift::ClientReceiveState & state)5780 folly::exception_wrapper service_with_special_namesAsyncClient::recv_instance_wrapped_fields(::std::int32_t& _return, ::apache::thrift::ClientReceiveState& state) {
5781 return recv_wrapped_fields(_return, state);
5782 }
5783
5784
5785 }} // test_cpp2::cpp_reflection
5786