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 #include "thrift/compiler/test/fixtures/fatal/gen-cpp2/module_types.h"
8 #include "thrift/compiler/test/fixtures/fatal/gen-cpp2/module_types.tcc"
9
10 #include <thrift/lib/cpp2/gen/module_types_cpp.h>
11
12 #include "thrift/compiler/test/fixtures/fatal/gen-cpp2/module_data.h"
13
14
15 namespace apache { namespace thrift {
16
17 constexpr std::size_t const TEnumTraits<::test_cpp2::cpp_reflection::enum1>::size;
18 folly::Range<::test_cpp2::cpp_reflection::enum1 const*> const TEnumTraits<::test_cpp2::cpp_reflection::enum1>::values = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::enum1>::values);
19 folly::Range<folly::StringPiece const*> const TEnumTraits<::test_cpp2::cpp_reflection::enum1>::names = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::enum1>::names);
20
findName(type value)21 char const* TEnumTraits<::test_cpp2::cpp_reflection::enum1>::findName(type value) {
22 using factory = ::test_cpp2::cpp_reflection::_enum1_EnumMapFactory;
23 static folly::Indestructible<factory::ValuesToNamesMapType> const map{
24 factory::makeValuesToNamesMap()};
25 auto found = map->find(value);
26 return found == map->end() ? nullptr : found->second;
27 }
28
findValue(char const * name,type * out)29 bool TEnumTraits<::test_cpp2::cpp_reflection::enum1>::findValue(char const* name, type* out) {
30 using factory = ::test_cpp2::cpp_reflection::_enum1_EnumMapFactory;
31 static folly::Indestructible<factory::NamesToValuesMapType> const map{
32 factory::makeNamesToValuesMap()};
33 auto found = map->find(name);
34 return found == map->end() ? false : (*out = found->second, true);
35 }
36
37 }} // apache::thrift
38
39 namespace test_cpp2 { namespace cpp_reflection {
40 FOLLY_PUSH_WARNING
41 FOLLY_GNU_DISABLE_WARNING("-Wdeprecated-declarations")
42 const _enum1_EnumMapFactory::ValuesToNamesMapType _enum1_VALUES_TO_NAMES = _enum1_EnumMapFactory::makeValuesToNamesMap();
43 const _enum1_EnumMapFactory::NamesToValuesMapType _enum1_NAMES_TO_VALUES = _enum1_EnumMapFactory::makeNamesToValuesMap();
44 FOLLY_POP_WARNING
45
46 }} // test_cpp2::cpp_reflection
47
48 namespace apache { namespace thrift {
49
50 constexpr std::size_t const TEnumTraits<::test_cpp2::cpp_reflection::enum2>::size;
51 folly::Range<::test_cpp2::cpp_reflection::enum2 const*> const TEnumTraits<::test_cpp2::cpp_reflection::enum2>::values = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::enum2>::values);
52 folly::Range<folly::StringPiece const*> const TEnumTraits<::test_cpp2::cpp_reflection::enum2>::names = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::enum2>::names);
53
findName(type value)54 char const* TEnumTraits<::test_cpp2::cpp_reflection::enum2>::findName(type value) {
55 using factory = ::test_cpp2::cpp_reflection::_enum2_EnumMapFactory;
56 static folly::Indestructible<factory::ValuesToNamesMapType> const map{
57 factory::makeValuesToNamesMap()};
58 auto found = map->find(value);
59 return found == map->end() ? nullptr : found->second;
60 }
61
findValue(char const * name,type * out)62 bool TEnumTraits<::test_cpp2::cpp_reflection::enum2>::findValue(char const* name, type* out) {
63 using factory = ::test_cpp2::cpp_reflection::_enum2_EnumMapFactory;
64 static folly::Indestructible<factory::NamesToValuesMapType> const map{
65 factory::makeNamesToValuesMap()};
66 auto found = map->find(name);
67 return found == map->end() ? false : (*out = found->second, true);
68 }
69
70 }} // apache::thrift
71
72 namespace test_cpp2 { namespace cpp_reflection {
73 FOLLY_PUSH_WARNING
74 FOLLY_GNU_DISABLE_WARNING("-Wdeprecated-declarations")
75 const _enum2_EnumMapFactory::ValuesToNamesMapType _enum2_VALUES_TO_NAMES = _enum2_EnumMapFactory::makeValuesToNamesMap();
76 const _enum2_EnumMapFactory::NamesToValuesMapType _enum2_NAMES_TO_VALUES = _enum2_EnumMapFactory::makeNamesToValuesMap();
77 FOLLY_POP_WARNING
78
79 }} // test_cpp2::cpp_reflection
80
81 namespace apache { namespace thrift {
82
83 constexpr std::size_t const TEnumTraits<::test_cpp2::cpp_reflection::enum3>::size;
84 folly::Range<::test_cpp2::cpp_reflection::enum3 const*> const TEnumTraits<::test_cpp2::cpp_reflection::enum3>::values = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::enum3>::values);
85 folly::Range<folly::StringPiece const*> const TEnumTraits<::test_cpp2::cpp_reflection::enum3>::names = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::enum3>::names);
86
findName(type value)87 char const* TEnumTraits<::test_cpp2::cpp_reflection::enum3>::findName(type value) {
88 using factory = ::test_cpp2::cpp_reflection::_enum3_EnumMapFactory;
89 static folly::Indestructible<factory::ValuesToNamesMapType> const map{
90 factory::makeValuesToNamesMap()};
91 auto found = map->find(value);
92 return found == map->end() ? nullptr : found->second;
93 }
94
findValue(char const * name,type * out)95 bool TEnumTraits<::test_cpp2::cpp_reflection::enum3>::findValue(char const* name, type* out) {
96 using factory = ::test_cpp2::cpp_reflection::_enum3_EnumMapFactory;
97 static folly::Indestructible<factory::NamesToValuesMapType> const map{
98 factory::makeNamesToValuesMap()};
99 auto found = map->find(name);
100 return found == map->end() ? false : (*out = found->second, true);
101 }
102
103 }} // apache::thrift
104
105 namespace test_cpp2 { namespace cpp_reflection {
106 FOLLY_PUSH_WARNING
107 FOLLY_GNU_DISABLE_WARNING("-Wdeprecated-declarations")
108 const _enum3_EnumMapFactory::ValuesToNamesMapType _enum3_VALUES_TO_NAMES = _enum3_EnumMapFactory::makeValuesToNamesMap();
109 const _enum3_EnumMapFactory::NamesToValuesMapType _enum3_NAMES_TO_VALUES = _enum3_EnumMapFactory::makeNamesToValuesMap();
110 FOLLY_POP_WARNING
111
112 }} // test_cpp2::cpp_reflection
113
114 namespace apache { namespace thrift {
115
116 constexpr std::size_t const TEnumTraits<::test_cpp2::cpp_reflection::enum_with_special_names>::size;
117 folly::Range<::test_cpp2::cpp_reflection::enum_with_special_names const*> const TEnumTraits<::test_cpp2::cpp_reflection::enum_with_special_names>::values = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::enum_with_special_names>::values);
118 folly::Range<folly::StringPiece const*> const TEnumTraits<::test_cpp2::cpp_reflection::enum_with_special_names>::names = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::enum_with_special_names>::names);
119
findName(type value)120 char const* TEnumTraits<::test_cpp2::cpp_reflection::enum_with_special_names>::findName(type value) {
121 using factory = ::test_cpp2::cpp_reflection::_enum_with_special_names_EnumMapFactory;
122 static folly::Indestructible<factory::ValuesToNamesMapType> const map{
123 factory::makeValuesToNamesMap()};
124 auto found = map->find(value);
125 return found == map->end() ? nullptr : found->second;
126 }
127
findValue(char const * name,type * out)128 bool TEnumTraits<::test_cpp2::cpp_reflection::enum_with_special_names>::findValue(char const* name, type* out) {
129 using factory = ::test_cpp2::cpp_reflection::_enum_with_special_names_EnumMapFactory;
130 static folly::Indestructible<factory::NamesToValuesMapType> const map{
131 factory::makeNamesToValuesMap()};
132 auto found = map->find(name);
133 return found == map->end() ? false : (*out = found->second, true);
134 }
135
136 }} // apache::thrift
137
138 namespace test_cpp2 { namespace cpp_reflection {
139 FOLLY_PUSH_WARNING
140 FOLLY_GNU_DISABLE_WARNING("-Wdeprecated-declarations")
141 const _enum_with_special_names_EnumMapFactory::ValuesToNamesMapType _enum_with_special_names_VALUES_TO_NAMES = _enum_with_special_names_EnumMapFactory::makeValuesToNamesMap();
142 const _enum_with_special_names_EnumMapFactory::NamesToValuesMapType _enum_with_special_names_NAMES_TO_VALUES = _enum_with_special_names_EnumMapFactory::makeNamesToValuesMap();
143 FOLLY_POP_WARNING
144
145 }} // test_cpp2::cpp_reflection
146
147 namespace apache {
148 namespace thrift {
149 namespace detail {
150
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)151 void TccStructTraits<::test_cpp2::cpp_reflection::union1>::translateFieldName(
152 folly::StringPiece _fname,
153 int16_t& fid,
154 apache::thrift::protocol::TType& _ftype) noexcept {
155 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::union1>;
156 static const st::translate_field_name_table table{
157 data::fields_size,
158 data::fields_names.data(),
159 data::fields_ids.data(),
160 data::fields_types.data()};
161 st::translate_field_name(_fname, fid, _ftype, table);
162 }
163
164 } // namespace detail
165 } // namespace thrift
166 } // namespace apache
167
168 namespace apache { namespace thrift {
169
170 constexpr std::size_t const TEnumTraits<::test_cpp2::cpp_reflection::union1::Type>::size;
171 folly::Range<::test_cpp2::cpp_reflection::union1::Type const*> const TEnumTraits<::test_cpp2::cpp_reflection::union1::Type>::values = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::union1::Type>::values);
172 folly::Range<folly::StringPiece const*> const TEnumTraits<::test_cpp2::cpp_reflection::union1::Type>::names = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::union1::Type>::names);
173
findName(type value)174 char const* TEnumTraits<::test_cpp2::cpp_reflection::union1::Type>::findName(type value) {
175 using factory = detail::TEnumMapFactory<::test_cpp2::cpp_reflection::union1::Type>;
176 static folly::Indestructible<factory::ValuesToNamesMapType> const map{
177 factory::makeValuesToNamesMap()};
178 auto found = map->find(value);
179 return found == map->end() ? nullptr : found->second;
180 }
181
findValue(char const * name,type * out)182 bool TEnumTraits<::test_cpp2::cpp_reflection::union1::Type>::findValue(char const* name, type* out) {
183 using factory = detail::TEnumMapFactory<::test_cpp2::cpp_reflection::union1::Type>;
184 static folly::Indestructible<factory::NamesToValuesMapType> const map{
185 factory::makeNamesToValuesMap()};
186 auto found = map->find(name);
187 return found == map->end() ? false : (*out = found->second, true);
188 }
189 }} // apache::thrift
190 namespace test_cpp2 { namespace cpp_reflection {
191
__fbthrift_clear()192 void union1::__fbthrift_clear() {
193 // clear all fields
194 if (type_ == Type::__EMPTY__) { return; }
195 switch(type_) {
196 case Type::ui:
197 destruct(value_.ui);
198 break;
199 case Type::ud:
200 destruct(value_.ud);
201 break;
202 case Type::us:
203 destruct(value_.us);
204 break;
205 case Type::ue:
206 destruct(value_.ue);
207 break;
208 default:
209 assert(false);
210 break;
211 }
212 type_ = Type::__EMPTY__;
213 }
214
operator ==(const union1 & rhs) const215 bool union1::operator==(const union1& rhs) const {
216 if (type_ != rhs.type_) { return false; }
217 switch(type_) {
218 case Type::ui:
219 return value_.ui == rhs.value_.ui;
220 case Type::ud:
221 return value_.ud == rhs.value_.ud;
222 case Type::us:
223 return value_.us == rhs.value_.us;
224 case Type::ue:
225 return value_.ue == rhs.value_.ue;
226 default:
227 return true;
228 }
229 }
230
operator <(const union1 & rhs) const231 bool union1::operator<(const union1& rhs) const {
232 (void)rhs;
233 auto& lhs = *this;
234 (void)lhs;
235 if (lhs.type_ != rhs.type_) {
236 return lhs.type_ < rhs.type_;
237 }
238 switch (lhs.type_) {
239 case Type::ui:
240 return lhs.value_.ui < rhs.value_.ui;
241 case Type::ud:
242 return lhs.value_.ud < rhs.value_.ud;
243 case Type::us:
244 return lhs.value_.us < rhs.value_.us;
245 case Type::ue:
246 return lhs.value_.ue < rhs.value_.ue;
247 default:
248 return false;
249 }
250 }
251
swap(union1 & a,union1 & b)252 void swap(union1& a, union1& b) {
253 union1 temp(std::move(a));
254 a = std::move(b);
255 b = std::move(temp);
256 }
257
258 template void union1::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
259 template uint32_t union1::write<>(apache::thrift::BinaryProtocolWriter*) const;
260 template uint32_t union1::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
261 template uint32_t union1::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
262 template void union1::readNoXfer<>(apache::thrift::CompactProtocolReader*);
263 template uint32_t union1::write<>(apache::thrift::CompactProtocolWriter*) const;
264 template uint32_t union1::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
265 template uint32_t union1::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
266
267
268
269 }} // test_cpp2::cpp_reflection
270
271 namespace apache {
272 namespace thrift {
273 namespace detail {
274
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)275 void TccStructTraits<::test_cpp2::cpp_reflection::union2>::translateFieldName(
276 folly::StringPiece _fname,
277 int16_t& fid,
278 apache::thrift::protocol::TType& _ftype) noexcept {
279 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::union2>;
280 static const st::translate_field_name_table table{
281 data::fields_size,
282 data::fields_names.data(),
283 data::fields_ids.data(),
284 data::fields_types.data()};
285 st::translate_field_name(_fname, fid, _ftype, table);
286 }
287
288 } // namespace detail
289 } // namespace thrift
290 } // namespace apache
291
292 namespace apache { namespace thrift {
293
294 constexpr std::size_t const TEnumTraits<::test_cpp2::cpp_reflection::union2::Type>::size;
295 folly::Range<::test_cpp2::cpp_reflection::union2::Type const*> const TEnumTraits<::test_cpp2::cpp_reflection::union2::Type>::values = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::union2::Type>::values);
296 folly::Range<folly::StringPiece const*> const TEnumTraits<::test_cpp2::cpp_reflection::union2::Type>::names = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::union2::Type>::names);
297
findName(type value)298 char const* TEnumTraits<::test_cpp2::cpp_reflection::union2::Type>::findName(type value) {
299 using factory = detail::TEnumMapFactory<::test_cpp2::cpp_reflection::union2::Type>;
300 static folly::Indestructible<factory::ValuesToNamesMapType> const map{
301 factory::makeValuesToNamesMap()};
302 auto found = map->find(value);
303 return found == map->end() ? nullptr : found->second;
304 }
305
findValue(char const * name,type * out)306 bool TEnumTraits<::test_cpp2::cpp_reflection::union2::Type>::findValue(char const* name, type* out) {
307 using factory = detail::TEnumMapFactory<::test_cpp2::cpp_reflection::union2::Type>;
308 static folly::Indestructible<factory::NamesToValuesMapType> const map{
309 factory::makeNamesToValuesMap()};
310 auto found = map->find(name);
311 return found == map->end() ? false : (*out = found->second, true);
312 }
313 }} // apache::thrift
314 namespace test_cpp2 { namespace cpp_reflection {
315
__fbthrift_clear()316 void union2::__fbthrift_clear() {
317 // clear all fields
318 if (type_ == Type::__EMPTY__) { return; }
319 switch(type_) {
320 case Type::ui_2:
321 destruct(value_.ui_2);
322 break;
323 case Type::ud_2:
324 destruct(value_.ud_2);
325 break;
326 case Type::us_2:
327 destruct(value_.us_2);
328 break;
329 case Type::ue_2:
330 destruct(value_.ue_2);
331 break;
332 default:
333 assert(false);
334 break;
335 }
336 type_ = Type::__EMPTY__;
337 }
338
operator ==(const union2 & rhs) const339 bool union2::operator==(const union2& rhs) const {
340 if (type_ != rhs.type_) { return false; }
341 switch(type_) {
342 case Type::ui_2:
343 return value_.ui_2 == rhs.value_.ui_2;
344 case Type::ud_2:
345 return value_.ud_2 == rhs.value_.ud_2;
346 case Type::us_2:
347 return value_.us_2 == rhs.value_.us_2;
348 case Type::ue_2:
349 return value_.ue_2 == rhs.value_.ue_2;
350 default:
351 return true;
352 }
353 }
354
operator <(const union2 & rhs) const355 bool union2::operator<(const union2& rhs) const {
356 (void)rhs;
357 auto& lhs = *this;
358 (void)lhs;
359 if (lhs.type_ != rhs.type_) {
360 return lhs.type_ < rhs.type_;
361 }
362 switch (lhs.type_) {
363 case Type::ui_2:
364 return lhs.value_.ui_2 < rhs.value_.ui_2;
365 case Type::ud_2:
366 return lhs.value_.ud_2 < rhs.value_.ud_2;
367 case Type::us_2:
368 return lhs.value_.us_2 < rhs.value_.us_2;
369 case Type::ue_2:
370 return lhs.value_.ue_2 < rhs.value_.ue_2;
371 default:
372 return false;
373 }
374 }
375
swap(union2 & a,union2 & b)376 void swap(union2& a, union2& b) {
377 union2 temp(std::move(a));
378 a = std::move(b);
379 b = std::move(temp);
380 }
381
382 template void union2::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
383 template uint32_t union2::write<>(apache::thrift::BinaryProtocolWriter*) const;
384 template uint32_t union2::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
385 template uint32_t union2::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
386 template void union2::readNoXfer<>(apache::thrift::CompactProtocolReader*);
387 template uint32_t union2::write<>(apache::thrift::CompactProtocolWriter*) const;
388 template uint32_t union2::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
389 template uint32_t union2::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
390
391
392
393 }} // test_cpp2::cpp_reflection
394
395 namespace apache {
396 namespace thrift {
397 namespace detail {
398
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)399 void TccStructTraits<::test_cpp2::cpp_reflection::union3>::translateFieldName(
400 folly::StringPiece _fname,
401 int16_t& fid,
402 apache::thrift::protocol::TType& _ftype) noexcept {
403 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::union3>;
404 static const st::translate_field_name_table table{
405 data::fields_size,
406 data::fields_names.data(),
407 data::fields_ids.data(),
408 data::fields_types.data()};
409 st::translate_field_name(_fname, fid, _ftype, table);
410 }
411
412 } // namespace detail
413 } // namespace thrift
414 } // namespace apache
415
416 namespace apache { namespace thrift {
417
418 constexpr std::size_t const TEnumTraits<::test_cpp2::cpp_reflection::union3::Type>::size;
419 folly::Range<::test_cpp2::cpp_reflection::union3::Type const*> const TEnumTraits<::test_cpp2::cpp_reflection::union3::Type>::values = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::union3::Type>::values);
420 folly::Range<folly::StringPiece const*> const TEnumTraits<::test_cpp2::cpp_reflection::union3::Type>::names = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::union3::Type>::names);
421
findName(type value)422 char const* TEnumTraits<::test_cpp2::cpp_reflection::union3::Type>::findName(type value) {
423 using factory = detail::TEnumMapFactory<::test_cpp2::cpp_reflection::union3::Type>;
424 static folly::Indestructible<factory::ValuesToNamesMapType> const map{
425 factory::makeValuesToNamesMap()};
426 auto found = map->find(value);
427 return found == map->end() ? nullptr : found->second;
428 }
429
findValue(char const * name,type * out)430 bool TEnumTraits<::test_cpp2::cpp_reflection::union3::Type>::findValue(char const* name, type* out) {
431 using factory = detail::TEnumMapFactory<::test_cpp2::cpp_reflection::union3::Type>;
432 static folly::Indestructible<factory::NamesToValuesMapType> const map{
433 factory::makeNamesToValuesMap()};
434 auto found = map->find(name);
435 return found == map->end() ? false : (*out = found->second, true);
436 }
437 }} // apache::thrift
438 namespace test_cpp2 { namespace cpp_reflection {
439
__fbthrift_clear()440 void union3::__fbthrift_clear() {
441 // clear all fields
442 if (type_ == Type::__EMPTY__) { return; }
443 switch(type_) {
444 case Type::ui_3:
445 destruct(value_.ui_3);
446 break;
447 case Type::ud_3:
448 destruct(value_.ud_3);
449 break;
450 case Type::us_3:
451 destruct(value_.us_3);
452 break;
453 case Type::ue_3:
454 destruct(value_.ue_3);
455 break;
456 default:
457 assert(false);
458 break;
459 }
460 type_ = Type::__EMPTY__;
461 }
462
operator ==(const union3 & rhs) const463 bool union3::operator==(const union3& rhs) const {
464 if (type_ != rhs.type_) { return false; }
465 switch(type_) {
466 case Type::ui_3:
467 return value_.ui_3 == rhs.value_.ui_3;
468 case Type::ud_3:
469 return value_.ud_3 == rhs.value_.ud_3;
470 case Type::us_3:
471 return value_.us_3 == rhs.value_.us_3;
472 case Type::ue_3:
473 return value_.ue_3 == rhs.value_.ue_3;
474 default:
475 return true;
476 }
477 }
478
operator <(const union3 & rhs) const479 bool union3::operator<(const union3& rhs) const {
480 (void)rhs;
481 auto& lhs = *this;
482 (void)lhs;
483 if (lhs.type_ != rhs.type_) {
484 return lhs.type_ < rhs.type_;
485 }
486 switch (lhs.type_) {
487 case Type::ui_3:
488 return lhs.value_.ui_3 < rhs.value_.ui_3;
489 case Type::ud_3:
490 return lhs.value_.ud_3 < rhs.value_.ud_3;
491 case Type::us_3:
492 return lhs.value_.us_3 < rhs.value_.us_3;
493 case Type::ue_3:
494 return lhs.value_.ue_3 < rhs.value_.ue_3;
495 default:
496 return false;
497 }
498 }
499
swap(union3 & a,union3 & b)500 void swap(union3& a, union3& b) {
501 union3 temp(std::move(a));
502 a = std::move(b);
503 b = std::move(temp);
504 }
505
506 template void union3::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
507 template uint32_t union3::write<>(apache::thrift::BinaryProtocolWriter*) const;
508 template uint32_t union3::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
509 template uint32_t union3::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
510 template void union3::readNoXfer<>(apache::thrift::CompactProtocolReader*);
511 template uint32_t union3::write<>(apache::thrift::CompactProtocolWriter*) const;
512 template uint32_t union3::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
513 template uint32_t union3::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
514
515
516
517 }} // test_cpp2::cpp_reflection
518
519 namespace apache {
520 namespace thrift {
521 namespace detail {
522
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)523 void TccStructTraits<::test_cpp2::cpp_reflection::structA>::translateFieldName(
524 folly::StringPiece _fname,
525 int16_t& fid,
526 apache::thrift::protocol::TType& _ftype) noexcept {
527 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::structA>;
528 static const st::translate_field_name_table table{
529 data::fields_size,
530 data::fields_names.data(),
531 data::fields_ids.data(),
532 data::fields_types.data()};
533 st::translate_field_name(_fname, fid, _ftype, table);
534 }
535
536 } // namespace detail
537 } // namespace thrift
538 } // namespace apache
539
540 namespace test_cpp2 { namespace cpp_reflection {
541
542 structA::structA(const structA&) = default;
543 structA& structA::operator=(const structA&) = default;
structA(structA && other)544 structA::structA(structA&& other) noexcept :
545 __fbthrift_field_a(std::move(other.__fbthrift_field_a)),
546 __fbthrift_field_b(std::move(other.__fbthrift_field_b)),
547 __isset(other.__isset) {
548 }
549
operator =(FOLLY_MAYBE_UNUSED structA && other)550 structA& structA::operator=(FOLLY_MAYBE_UNUSED structA&& other) noexcept {
551 this->__fbthrift_field_a = std::move(other.__fbthrift_field_a);
552 this->__fbthrift_field_b = std::move(other.__fbthrift_field_b);
553 __isset = other.__isset;
554 return *this;
555 }
556
557
structA(apache::thrift::FragileConstructor,::std::int32_t a__arg,::std::string b__arg)558 structA::structA(apache::thrift::FragileConstructor, ::std::int32_t a__arg, ::std::string b__arg) :
559 __fbthrift_field_a(std::move(a__arg)),
560 __fbthrift_field_b(std::move(b__arg)) {
561 __isset.set(folly::index_constant<0>(), true);
562 __isset.set(folly::index_constant<1>(), true);
563 }
564
565
__fbthrift_clear()566 void structA::__fbthrift_clear() {
567 // clear all fields
568 this->__fbthrift_field_a = ::std::int32_t();
569 this->__fbthrift_field_b = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
570 __isset = {};
571 }
572
operator ==(const structA & rhs) const573 bool structA::operator==(const structA& rhs) const {
574 (void)rhs;
575 auto& lhs = *this;
576 (void)lhs;
577 if (!(lhs.a_ref() == rhs.a_ref())) {
578 return false;
579 }
580 if (!(lhs.b_ref() == rhs.b_ref())) {
581 return false;
582 }
583 return true;
584 }
585
operator <(const structA & rhs) const586 bool structA::operator<(const structA& rhs) const {
587 (void)rhs;
588 auto& lhs = *this;
589 (void)lhs;
590 if (!(lhs.a_ref() == rhs.a_ref())) {
591 return lhs.a_ref() < rhs.a_ref();
592 }
593 if (!(lhs.b_ref() == rhs.b_ref())) {
594 return lhs.b_ref() < rhs.b_ref();
595 }
596 return false;
597 }
598
599
swap(structA & a,structA & b)600 void swap(structA& a, structA& b) {
601 using ::std::swap;
602 swap(a.a_ref().value(), b.a_ref().value());
603 swap(a.b_ref().value(), b.b_ref().value());
604 swap(a.__isset, b.__isset);
605 }
606
607 template void structA::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
608 template uint32_t structA::write<>(apache::thrift::BinaryProtocolWriter*) const;
609 template uint32_t structA::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
610 template uint32_t structA::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
611 template void structA::readNoXfer<>(apache::thrift::CompactProtocolReader*);
612 template uint32_t structA::write<>(apache::thrift::CompactProtocolWriter*) const;
613 template uint32_t structA::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
614 template uint32_t structA::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
615
616
617
618 }} // test_cpp2::cpp_reflection
619
620 namespace apache {
621 namespace thrift {
622 namespace detail {
623
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)624 void TccStructTraits<::test_cpp2::cpp_reflection::unionA>::translateFieldName(
625 folly::StringPiece _fname,
626 int16_t& fid,
627 apache::thrift::protocol::TType& _ftype) noexcept {
628 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::unionA>;
629 static const st::translate_field_name_table table{
630 data::fields_size,
631 data::fields_names.data(),
632 data::fields_ids.data(),
633 data::fields_types.data()};
634 st::translate_field_name(_fname, fid, _ftype, table);
635 }
636
637 } // namespace detail
638 } // namespace thrift
639 } // namespace apache
640
641 namespace apache { namespace thrift {
642
643 constexpr std::size_t const TEnumTraits<::test_cpp2::cpp_reflection::unionA::Type>::size;
644 folly::Range<::test_cpp2::cpp_reflection::unionA::Type const*> const TEnumTraits<::test_cpp2::cpp_reflection::unionA::Type>::values = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::unionA::Type>::values);
645 folly::Range<folly::StringPiece const*> const TEnumTraits<::test_cpp2::cpp_reflection::unionA::Type>::names = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::unionA::Type>::names);
646
findName(type value)647 char const* TEnumTraits<::test_cpp2::cpp_reflection::unionA::Type>::findName(type value) {
648 using factory = detail::TEnumMapFactory<::test_cpp2::cpp_reflection::unionA::Type>;
649 static folly::Indestructible<factory::ValuesToNamesMapType> const map{
650 factory::makeValuesToNamesMap()};
651 auto found = map->find(value);
652 return found == map->end() ? nullptr : found->second;
653 }
654
findValue(char const * name,type * out)655 bool TEnumTraits<::test_cpp2::cpp_reflection::unionA::Type>::findValue(char const* name, type* out) {
656 using factory = detail::TEnumMapFactory<::test_cpp2::cpp_reflection::unionA::Type>;
657 static folly::Indestructible<factory::NamesToValuesMapType> const map{
658 factory::makeNamesToValuesMap()};
659 auto found = map->find(name);
660 return found == map->end() ? false : (*out = found->second, true);
661 }
662 }} // apache::thrift
663 namespace test_cpp2 { namespace cpp_reflection {
664
__fbthrift_clear()665 void unionA::__fbthrift_clear() {
666 // clear all fields
667 if (type_ == Type::__EMPTY__) { return; }
668 switch(type_) {
669 case Type::i:
670 destruct(value_.i);
671 break;
672 case Type::d:
673 destruct(value_.d);
674 break;
675 case Type::s:
676 destruct(value_.s);
677 break;
678 case Type::e:
679 destruct(value_.e);
680 break;
681 case Type::a:
682 destruct(value_.a);
683 break;
684 default:
685 assert(false);
686 break;
687 }
688 type_ = Type::__EMPTY__;
689 }
690
operator ==(const unionA & rhs) const691 bool unionA::operator==(const unionA& rhs) const {
692 if (type_ != rhs.type_) { return false; }
693 switch(type_) {
694 case Type::i:
695 return value_.i == rhs.value_.i;
696 case Type::d:
697 return value_.d == rhs.value_.d;
698 case Type::s:
699 return value_.s == rhs.value_.s;
700 case Type::e:
701 return value_.e == rhs.value_.e;
702 case Type::a:
703 return value_.a == rhs.value_.a;
704 default:
705 return true;
706 }
707 }
708
operator <(const unionA & rhs) const709 bool unionA::operator<(const unionA& rhs) const {
710 (void)rhs;
711 auto& lhs = *this;
712 (void)lhs;
713 if (lhs.type_ != rhs.type_) {
714 return lhs.type_ < rhs.type_;
715 }
716 switch (lhs.type_) {
717 case Type::i:
718 return lhs.value_.i < rhs.value_.i;
719 case Type::d:
720 return lhs.value_.d < rhs.value_.d;
721 case Type::s:
722 return lhs.value_.s < rhs.value_.s;
723 case Type::e:
724 return lhs.value_.e < rhs.value_.e;
725 case Type::a:
726 return lhs.value_.a < rhs.value_.a;
727 default:
728 return false;
729 }
730 }
731
swap(unionA & a,unionA & b)732 void swap(unionA& a, unionA& b) {
733 unionA temp(std::move(a));
734 a = std::move(b);
735 b = std::move(temp);
736 }
737
738 template void unionA::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
739 template uint32_t unionA::write<>(apache::thrift::BinaryProtocolWriter*) const;
740 template uint32_t unionA::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
741 template uint32_t unionA::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
742 template void unionA::readNoXfer<>(apache::thrift::CompactProtocolReader*);
743 template uint32_t unionA::write<>(apache::thrift::CompactProtocolWriter*) const;
744 template uint32_t unionA::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
745 template uint32_t unionA::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
746
747 static_assert(
748 ::apache::thrift::detail::st::gen_check_json<
749 unionA,
750 ::apache::thrift::type_class::structure,
751 ::test_cpp2::cpp_reflection::structA>,
752 "inconsistent use of json option");
753
754 static_assert(
755 ::apache::thrift::detail::st::gen_check_nimble<
756 unionA,
757 ::apache::thrift::type_class::structure,
758 ::test_cpp2::cpp_reflection::structA>,
759 "inconsistent use of nimble option");
760
761 }} // test_cpp2::cpp_reflection
762
763 namespace apache {
764 namespace thrift {
765 namespace detail {
766
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)767 void TccStructTraits<::test_cpp2::cpp_reflection::structB>::translateFieldName(
768 folly::StringPiece _fname,
769 int16_t& fid,
770 apache::thrift::protocol::TType& _ftype) noexcept {
771 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::structB>;
772 static const st::translate_field_name_table table{
773 data::fields_size,
774 data::fields_names.data(),
775 data::fields_ids.data(),
776 data::fields_types.data()};
777 st::translate_field_name(_fname, fid, _ftype, table);
778 }
779
780 } // namespace detail
781 } // namespace thrift
782 } // namespace apache
783
784 namespace test_cpp2 { namespace cpp_reflection {
785
786
structB(apache::thrift::FragileConstructor,double c__arg,bool d__arg)787 structB::structB(apache::thrift::FragileConstructor, double c__arg, bool d__arg) :
788 __fbthrift_field_c(std::move(c__arg)),
789 __fbthrift_field_d(std::move(d__arg)) {
790 __isset.set(folly::index_constant<0>(), true);
791 __isset.set(folly::index_constant<1>(), true);
792 }
793
794
__fbthrift_clear()795 void structB::__fbthrift_clear() {
796 // clear all fields
797 this->__fbthrift_field_c = double();
798 this->__fbthrift_field_d = bool();
799 __isset = {};
800 }
801
operator ==(const structB & rhs) const802 bool structB::operator==(const structB& rhs) const {
803 (void)rhs;
804 auto& lhs = *this;
805 (void)lhs;
806 if (!(lhs.c_ref() == rhs.c_ref())) {
807 return false;
808 }
809 if (!(lhs.d_ref() == rhs.d_ref())) {
810 return false;
811 }
812 return true;
813 }
814
operator <(const structB & rhs) const815 bool structB::operator<(const structB& rhs) const {
816 (void)rhs;
817 auto& lhs = *this;
818 (void)lhs;
819 if (!(lhs.c_ref() == rhs.c_ref())) {
820 return lhs.c_ref() < rhs.c_ref();
821 }
822 if (!(lhs.d_ref() == rhs.d_ref())) {
823 return lhs.d_ref() < rhs.d_ref();
824 }
825 return false;
826 }
827
828
swap(structB & a,structB & b)829 void swap(structB& a, structB& b) {
830 using ::std::swap;
831 swap(a.c_ref().value(), b.c_ref().value());
832 swap(a.d_ref().value(), b.d_ref().value());
833 swap(a.__isset, b.__isset);
834 }
835
836 template void structB::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
837 template uint32_t structB::write<>(apache::thrift::BinaryProtocolWriter*) const;
838 template uint32_t structB::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
839 template uint32_t structB::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
840 template void structB::readNoXfer<>(apache::thrift::CompactProtocolReader*);
841 template uint32_t structB::write<>(apache::thrift::CompactProtocolWriter*) const;
842 template uint32_t structB::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
843 template uint32_t structB::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
844
845
846
847 }} // test_cpp2::cpp_reflection
848
849 namespace apache {
850 namespace thrift {
851 namespace detail {
852
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)853 void TccStructTraits<::test_cpp2::cpp_reflection::structC>::translateFieldName(
854 folly::StringPiece _fname,
855 int16_t& fid,
856 apache::thrift::protocol::TType& _ftype) noexcept {
857 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::structC>;
858 static const st::translate_field_name_table table{
859 data::fields_size,
860 data::fields_names.data(),
861 data::fields_ids.data(),
862 data::fields_types.data()};
863 st::translate_field_name(_fname, fid, _ftype, table);
864 }
865
866 } // namespace detail
867 } // namespace thrift
868 } // namespace apache
869
870 namespace test_cpp2 { namespace cpp_reflection {
871
872 structC::structC(const structC&) = default;
873 structC& structC::operator=(const structC&) = default;
structC()874 structC::structC() :
875 __fbthrift_field_a(),
876 __fbthrift_field_c(),
877 __fbthrift_field_d(),
878 __fbthrift_field_e(),
879 __fbthrift_field_f() {
880 }
881
882
~structC()883 structC::~structC() {}
884
structC(structC && other)885 structC::structC(structC&& other) noexcept :
886 __fbthrift_field_a(std::move(other.__fbthrift_field_a)),
887 __fbthrift_field_b(std::move(other.__fbthrift_field_b)),
888 __fbthrift_field_c(std::move(other.__fbthrift_field_c)),
889 __fbthrift_field_d(std::move(other.__fbthrift_field_d)),
890 __fbthrift_field_e(std::move(other.__fbthrift_field_e)),
891 __fbthrift_field_f(std::move(other.__fbthrift_field_f)),
892 __fbthrift_field_g(std::move(other.__fbthrift_field_g)),
893 __fbthrift_field_h(std::move(other.__fbthrift_field_h)),
894 __fbthrift_field_i(std::move(other.__fbthrift_field_i)),
895 __fbthrift_field_j(std::move(other.__fbthrift_field_j)),
896 __fbthrift_field_j1(std::move(other.__fbthrift_field_j1)),
897 __fbthrift_field_j2(std::move(other.__fbthrift_field_j2)),
898 __fbthrift_field_j3(std::move(other.__fbthrift_field_j3)),
899 __fbthrift_field_k(std::move(other.__fbthrift_field_k)),
900 __fbthrift_field_k1(std::move(other.__fbthrift_field_k1)),
901 __fbthrift_field_k2(std::move(other.__fbthrift_field_k2)),
902 __fbthrift_field_k3(std::move(other.__fbthrift_field_k3)),
903 __fbthrift_field_l(std::move(other.__fbthrift_field_l)),
904 __fbthrift_field_l1(std::move(other.__fbthrift_field_l1)),
905 __fbthrift_field_l2(std::move(other.__fbthrift_field_l2)),
906 __fbthrift_field_l3(std::move(other.__fbthrift_field_l3)),
907 __fbthrift_field_m1(std::move(other.__fbthrift_field_m1)),
908 __fbthrift_field_m2(std::move(other.__fbthrift_field_m2)),
909 __fbthrift_field_m3(std::move(other.__fbthrift_field_m3)),
910 __fbthrift_field_n1(std::move(other.__fbthrift_field_n1)),
911 __fbthrift_field_n2(std::move(other.__fbthrift_field_n2)),
912 __fbthrift_field_n3(std::move(other.__fbthrift_field_n3)),
913 __fbthrift_field_o1(std::move(other.__fbthrift_field_o1)),
914 __fbthrift_field_o2(std::move(other.__fbthrift_field_o2)),
915 __fbthrift_field_o3(std::move(other.__fbthrift_field_o3)),
916 __isset(other.__isset) {
917 }
918
operator =(FOLLY_MAYBE_UNUSED structC && other)919 structC& structC::operator=(FOLLY_MAYBE_UNUSED structC&& other) noexcept {
920 this->__fbthrift_field_a = std::move(other.__fbthrift_field_a);
921 this->__fbthrift_field_b = std::move(other.__fbthrift_field_b);
922 this->__fbthrift_field_c = std::move(other.__fbthrift_field_c);
923 this->__fbthrift_field_d = std::move(other.__fbthrift_field_d);
924 this->__fbthrift_field_e = std::move(other.__fbthrift_field_e);
925 this->__fbthrift_field_f = std::move(other.__fbthrift_field_f);
926 this->__fbthrift_field_g = std::move(other.__fbthrift_field_g);
927 this->__fbthrift_field_h = std::move(other.__fbthrift_field_h);
928 this->__fbthrift_field_i = std::move(other.__fbthrift_field_i);
929 this->__fbthrift_field_j = std::move(other.__fbthrift_field_j);
930 this->__fbthrift_field_j1 = std::move(other.__fbthrift_field_j1);
931 this->__fbthrift_field_j2 = std::move(other.__fbthrift_field_j2);
932 this->__fbthrift_field_j3 = std::move(other.__fbthrift_field_j3);
933 this->__fbthrift_field_k = std::move(other.__fbthrift_field_k);
934 this->__fbthrift_field_k1 = std::move(other.__fbthrift_field_k1);
935 this->__fbthrift_field_k2 = std::move(other.__fbthrift_field_k2);
936 this->__fbthrift_field_k3 = std::move(other.__fbthrift_field_k3);
937 this->__fbthrift_field_l = std::move(other.__fbthrift_field_l);
938 this->__fbthrift_field_l1 = std::move(other.__fbthrift_field_l1);
939 this->__fbthrift_field_l2 = std::move(other.__fbthrift_field_l2);
940 this->__fbthrift_field_l3 = std::move(other.__fbthrift_field_l3);
941 this->__fbthrift_field_m1 = std::move(other.__fbthrift_field_m1);
942 this->__fbthrift_field_m2 = std::move(other.__fbthrift_field_m2);
943 this->__fbthrift_field_m3 = std::move(other.__fbthrift_field_m3);
944 this->__fbthrift_field_n1 = std::move(other.__fbthrift_field_n1);
945 this->__fbthrift_field_n2 = std::move(other.__fbthrift_field_n2);
946 this->__fbthrift_field_n3 = std::move(other.__fbthrift_field_n3);
947 this->__fbthrift_field_o1 = std::move(other.__fbthrift_field_o1);
948 this->__fbthrift_field_o2 = std::move(other.__fbthrift_field_o2);
949 this->__fbthrift_field_o3 = std::move(other.__fbthrift_field_o3);
950 __isset = other.__isset;
951 return *this;
952 }
953
954
structC(apache::thrift::FragileConstructor,::std::int32_t a__arg,::std::string b__arg,double c__arg,bool d__arg,::test_cpp2::cpp_reflection::enum1 e__arg,::test_cpp2::cpp_reflection::enum2 f__arg,::test_cpp2::cpp_reflection::union1 g__arg,::test_cpp2::cpp_reflection::unionA h__arg,::test_cpp2::cpp_reflection::unionA i__arg,::std::vector<::std::int32_t> j__arg,::std::vector<::std::int32_t> j1__arg,::std::vector<::test_cpp2::cpp_reflection::enum1> j2__arg,::std::vector<::test_cpp2::cpp_reflection::structA> j3__arg,::std::set<::std::int32_t> k__arg,::std::set<::std::int32_t> k1__arg,::std::set<::test_cpp2::cpp_reflection::enum2> k2__arg,::std::set<::test_cpp2::cpp_reflection::structB> k3__arg,::std::map<::std::int32_t,::std::int32_t> l__arg,::std::map<::std::int32_t,::std::int32_t> l1__arg,::std::map<::std::int32_t,::test_cpp2::cpp_reflection::enum1> l2__arg,::std::map<::std::int32_t,::test_cpp2::cpp_reflection::structB> l3__arg,::std::map<::test_cpp2::cpp_reflection::enum1,::std::int32_t> m1__arg,::std::map<::test_cpp2::cpp_reflection::enum1,::test_cpp2::cpp_reflection::enum2> m2__arg,::std::map<::test_cpp2::cpp_reflection::enum1,::test_cpp2::cpp_reflection::structB> m3__arg,::std::map<::std::string,::std::int32_t> n1__arg,::std::map<::std::string,::test_cpp2::cpp_reflection::enum1> n2__arg,::std::map<::std::string,::test_cpp2::cpp_reflection::structB> n3__arg,::std::map<::test_cpp2::cpp_reflection::structA,::std::int32_t> o1__arg,::std::map<::test_cpp2::cpp_reflection::structA,::test_cpp2::cpp_reflection::enum1> o2__arg,::std::map<::test_cpp2::cpp_reflection::structA,::test_cpp2::cpp_reflection::structB> o3__arg)955 structC::structC(apache::thrift::FragileConstructor, ::std::int32_t a__arg, ::std::string b__arg, double c__arg, bool d__arg, ::test_cpp2::cpp_reflection::enum1 e__arg, ::test_cpp2::cpp_reflection::enum2 f__arg, ::test_cpp2::cpp_reflection::union1 g__arg, ::test_cpp2::cpp_reflection::unionA h__arg, ::test_cpp2::cpp_reflection::unionA i__arg, ::std::vector<::std::int32_t> j__arg, ::std::vector<::std::int32_t> j1__arg, ::std::vector<::test_cpp2::cpp_reflection::enum1> j2__arg, ::std::vector<::test_cpp2::cpp_reflection::structA> j3__arg, ::std::set<::std::int32_t> k__arg, ::std::set<::std::int32_t> k1__arg, ::std::set<::test_cpp2::cpp_reflection::enum2> k2__arg, ::std::set<::test_cpp2::cpp_reflection::structB> k3__arg, ::std::map<::std::int32_t, ::std::int32_t> l__arg, ::std::map<::std::int32_t, ::std::int32_t> l1__arg, ::std::map<::std::int32_t, ::test_cpp2::cpp_reflection::enum1> l2__arg, ::std::map<::std::int32_t, ::test_cpp2::cpp_reflection::structB> l3__arg, ::std::map<::test_cpp2::cpp_reflection::enum1, ::std::int32_t> m1__arg, ::std::map<::test_cpp2::cpp_reflection::enum1, ::test_cpp2::cpp_reflection::enum2> m2__arg, ::std::map<::test_cpp2::cpp_reflection::enum1, ::test_cpp2::cpp_reflection::structB> m3__arg, ::std::map<::std::string, ::std::int32_t> n1__arg, ::std::map<::std::string, ::test_cpp2::cpp_reflection::enum1> n2__arg, ::std::map<::std::string, ::test_cpp2::cpp_reflection::structB> n3__arg, ::std::map<::test_cpp2::cpp_reflection::structA, ::std::int32_t> o1__arg, ::std::map<::test_cpp2::cpp_reflection::structA, ::test_cpp2::cpp_reflection::enum1> o2__arg, ::std::map<::test_cpp2::cpp_reflection::structA, ::test_cpp2::cpp_reflection::structB> o3__arg) :
956 __fbthrift_field_a(std::move(a__arg)),
957 __fbthrift_field_b(std::move(b__arg)),
958 __fbthrift_field_c(std::move(c__arg)),
959 __fbthrift_field_d(std::move(d__arg)),
960 __fbthrift_field_e(std::move(e__arg)),
961 __fbthrift_field_f(std::move(f__arg)),
962 __fbthrift_field_g(std::move(g__arg)),
963 __fbthrift_field_h(std::move(h__arg)),
964 __fbthrift_field_i(std::move(i__arg)),
965 __fbthrift_field_j(std::move(j__arg)),
966 __fbthrift_field_j1(std::move(j1__arg)),
967 __fbthrift_field_j2(std::move(j2__arg)),
968 __fbthrift_field_j3(std::move(j3__arg)),
969 __fbthrift_field_k(std::move(k__arg)),
970 __fbthrift_field_k1(std::move(k1__arg)),
971 __fbthrift_field_k2(std::move(k2__arg)),
972 __fbthrift_field_k3(std::move(k3__arg)),
973 __fbthrift_field_l(std::move(l__arg)),
974 __fbthrift_field_l1(std::move(l1__arg)),
975 __fbthrift_field_l2(std::move(l2__arg)),
976 __fbthrift_field_l3(std::move(l3__arg)),
977 __fbthrift_field_m1(std::move(m1__arg)),
978 __fbthrift_field_m2(std::move(m2__arg)),
979 __fbthrift_field_m3(std::move(m3__arg)),
980 __fbthrift_field_n1(std::move(n1__arg)),
981 __fbthrift_field_n2(std::move(n2__arg)),
982 __fbthrift_field_n3(std::move(n3__arg)),
983 __fbthrift_field_o1(std::move(o1__arg)),
984 __fbthrift_field_o2(std::move(o2__arg)),
985 __fbthrift_field_o3(std::move(o3__arg)) {
986 __isset.set(folly::index_constant<0>(), true);
987 __isset.set(folly::index_constant<1>(), true);
988 __isset.set(folly::index_constant<2>(), true);
989 __isset.set(folly::index_constant<3>(), true);
990 __isset.set(folly::index_constant<4>(), true);
991 __isset.set(folly::index_constant<5>(), true);
992 __isset.set(folly::index_constant<6>(), true);
993 __isset.set(folly::index_constant<7>(), true);
994 __isset.set(folly::index_constant<8>(), true);
995 __isset.set(folly::index_constant<9>(), true);
996 __isset.set(folly::index_constant<10>(), true);
997 __isset.set(folly::index_constant<11>(), true);
998 __isset.set(folly::index_constant<12>(), true);
999 __isset.set(folly::index_constant<13>(), true);
1000 __isset.set(folly::index_constant<14>(), true);
1001 __isset.set(folly::index_constant<15>(), true);
1002 __isset.set(folly::index_constant<16>(), true);
1003 __isset.set(folly::index_constant<17>(), true);
1004 __isset.set(folly::index_constant<18>(), true);
1005 __isset.set(folly::index_constant<19>(), true);
1006 __isset.set(folly::index_constant<20>(), true);
1007 __isset.set(folly::index_constant<21>(), true);
1008 __isset.set(folly::index_constant<22>(), true);
1009 __isset.set(folly::index_constant<23>(), true);
1010 __isset.set(folly::index_constant<24>(), true);
1011 __isset.set(folly::index_constant<25>(), true);
1012 __isset.set(folly::index_constant<26>(), true);
1013 __isset.set(folly::index_constant<27>(), true);
1014 __isset.set(folly::index_constant<28>(), true);
1015 __isset.set(folly::index_constant<29>(), true);
1016 }
1017
1018
__fbthrift_clear()1019 void structC::__fbthrift_clear() {
1020 // clear all fields
1021 this->__fbthrift_field_a = ::std::int32_t();
1022 this->__fbthrift_field_b = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
1023 this->__fbthrift_field_c = double();
1024 this->__fbthrift_field_d = bool();
1025 this->__fbthrift_field_e = ::test_cpp2::cpp_reflection::enum1();
1026 this->__fbthrift_field_f = ::test_cpp2::cpp_reflection::enum2();
1027 apache::thrift::clear(this->__fbthrift_field_g);
1028 apache::thrift::clear(this->__fbthrift_field_h);
1029 apache::thrift::clear(this->__fbthrift_field_i);
1030 this->__fbthrift_field_j.clear();
1031 this->__fbthrift_field_j1.clear();
1032 this->__fbthrift_field_j2.clear();
1033 this->__fbthrift_field_j3.clear();
1034 this->__fbthrift_field_k.clear();
1035 this->__fbthrift_field_k1.clear();
1036 this->__fbthrift_field_k2.clear();
1037 this->__fbthrift_field_k3.clear();
1038 this->__fbthrift_field_l.clear();
1039 this->__fbthrift_field_l1.clear();
1040 this->__fbthrift_field_l2.clear();
1041 this->__fbthrift_field_l3.clear();
1042 this->__fbthrift_field_m1.clear();
1043 this->__fbthrift_field_m2.clear();
1044 this->__fbthrift_field_m3.clear();
1045 this->__fbthrift_field_n1.clear();
1046 this->__fbthrift_field_n2.clear();
1047 this->__fbthrift_field_n3.clear();
1048 this->__fbthrift_field_o1.clear();
1049 this->__fbthrift_field_o2.clear();
1050 this->__fbthrift_field_o3.clear();
1051 __isset = {};
1052 }
1053
operator ==(const structC & rhs) const1054 bool structC::operator==(const structC& rhs) const {
1055 (void)rhs;
1056 auto& lhs = *this;
1057 (void)lhs;
1058 if (!(lhs.a_ref() == rhs.a_ref())) {
1059 return false;
1060 }
1061 if (!(lhs.b_ref() == rhs.b_ref())) {
1062 return false;
1063 }
1064 if (!(lhs.c_ref() == rhs.c_ref())) {
1065 return false;
1066 }
1067 if (!(lhs.d_ref() == rhs.d_ref())) {
1068 return false;
1069 }
1070 if (!(lhs.e_ref() == rhs.e_ref())) {
1071 return false;
1072 }
1073 if (!(lhs.f_ref() == rhs.f_ref())) {
1074 return false;
1075 }
1076 if (!(lhs.g_ref() == rhs.g_ref())) {
1077 return false;
1078 }
1079 if (!(lhs.h_ref() == rhs.h_ref())) {
1080 return false;
1081 }
1082 if (!(lhs.i_ref() == rhs.i_ref())) {
1083 return false;
1084 }
1085 if (!(lhs.j_ref() == rhs.j_ref())) {
1086 return false;
1087 }
1088 if (!(lhs.j1_ref() == rhs.j1_ref())) {
1089 return false;
1090 }
1091 if (!(lhs.j2_ref() == rhs.j2_ref())) {
1092 return false;
1093 }
1094 if (!(lhs.j3_ref() == rhs.j3_ref())) {
1095 return false;
1096 }
1097 if (!(lhs.k_ref() == rhs.k_ref())) {
1098 return false;
1099 }
1100 if (!(lhs.k1_ref() == rhs.k1_ref())) {
1101 return false;
1102 }
1103 if (!(lhs.k2_ref() == rhs.k2_ref())) {
1104 return false;
1105 }
1106 if (!(lhs.k3_ref() == rhs.k3_ref())) {
1107 return false;
1108 }
1109 if (!(lhs.l_ref() == rhs.l_ref())) {
1110 return false;
1111 }
1112 if (!(lhs.l1_ref() == rhs.l1_ref())) {
1113 return false;
1114 }
1115 if (!(lhs.l2_ref() == rhs.l2_ref())) {
1116 return false;
1117 }
1118 if (!(lhs.l3_ref() == rhs.l3_ref())) {
1119 return false;
1120 }
1121 if (!(lhs.m1_ref() == rhs.m1_ref())) {
1122 return false;
1123 }
1124 if (!(lhs.m2_ref() == rhs.m2_ref())) {
1125 return false;
1126 }
1127 if (!(lhs.m3_ref() == rhs.m3_ref())) {
1128 return false;
1129 }
1130 if (!(lhs.n1_ref() == rhs.n1_ref())) {
1131 return false;
1132 }
1133 if (!(lhs.n2_ref() == rhs.n2_ref())) {
1134 return false;
1135 }
1136 if (!(lhs.n3_ref() == rhs.n3_ref())) {
1137 return false;
1138 }
1139 if (!(lhs.o1_ref() == rhs.o1_ref())) {
1140 return false;
1141 }
1142 if (!(lhs.o2_ref() == rhs.o2_ref())) {
1143 return false;
1144 }
1145 if (!(lhs.o3_ref() == rhs.o3_ref())) {
1146 return false;
1147 }
1148 return true;
1149 }
1150
operator <(const structC & rhs) const1151 bool structC::operator<(const structC& rhs) const {
1152 (void)rhs;
1153 auto& lhs = *this;
1154 (void)lhs;
1155 if (!(lhs.a_ref() == rhs.a_ref())) {
1156 return lhs.a_ref() < rhs.a_ref();
1157 }
1158 if (!(lhs.b_ref() == rhs.b_ref())) {
1159 return lhs.b_ref() < rhs.b_ref();
1160 }
1161 if (!(lhs.c_ref() == rhs.c_ref())) {
1162 return lhs.c_ref() < rhs.c_ref();
1163 }
1164 if (!(lhs.d_ref() == rhs.d_ref())) {
1165 return lhs.d_ref() < rhs.d_ref();
1166 }
1167 if (!(lhs.e_ref() == rhs.e_ref())) {
1168 return lhs.e_ref() < rhs.e_ref();
1169 }
1170 if (!(lhs.f_ref() == rhs.f_ref())) {
1171 return lhs.f_ref() < rhs.f_ref();
1172 }
1173 if (!(lhs.g_ref() == rhs.g_ref())) {
1174 return lhs.g_ref() < rhs.g_ref();
1175 }
1176 if (!(lhs.h_ref() == rhs.h_ref())) {
1177 return lhs.h_ref() < rhs.h_ref();
1178 }
1179 if (!(lhs.i_ref() == rhs.i_ref())) {
1180 return lhs.i_ref() < rhs.i_ref();
1181 }
1182 if (!(lhs.j_ref() == rhs.j_ref())) {
1183 return lhs.j_ref() < rhs.j_ref();
1184 }
1185 if (!(lhs.j1_ref() == rhs.j1_ref())) {
1186 return lhs.j1_ref() < rhs.j1_ref();
1187 }
1188 if (!(lhs.j2_ref() == rhs.j2_ref())) {
1189 return lhs.j2_ref() < rhs.j2_ref();
1190 }
1191 if (!(lhs.j3_ref() == rhs.j3_ref())) {
1192 return lhs.j3_ref() < rhs.j3_ref();
1193 }
1194 if (!(lhs.k_ref() == rhs.k_ref())) {
1195 return lhs.k_ref() < rhs.k_ref();
1196 }
1197 if (!(lhs.k1_ref() == rhs.k1_ref())) {
1198 return lhs.k1_ref() < rhs.k1_ref();
1199 }
1200 if (!(lhs.k2_ref() == rhs.k2_ref())) {
1201 return lhs.k2_ref() < rhs.k2_ref();
1202 }
1203 if (!(lhs.k3_ref() == rhs.k3_ref())) {
1204 return lhs.k3_ref() < rhs.k3_ref();
1205 }
1206 if (!(lhs.l_ref() == rhs.l_ref())) {
1207 return lhs.l_ref() < rhs.l_ref();
1208 }
1209 if (!(lhs.l1_ref() == rhs.l1_ref())) {
1210 return lhs.l1_ref() < rhs.l1_ref();
1211 }
1212 if (!(lhs.l2_ref() == rhs.l2_ref())) {
1213 return lhs.l2_ref() < rhs.l2_ref();
1214 }
1215 if (!(lhs.l3_ref() == rhs.l3_ref())) {
1216 return lhs.l3_ref() < rhs.l3_ref();
1217 }
1218 if (!(lhs.m1_ref() == rhs.m1_ref())) {
1219 return lhs.m1_ref() < rhs.m1_ref();
1220 }
1221 if (!(lhs.m2_ref() == rhs.m2_ref())) {
1222 return lhs.m2_ref() < rhs.m2_ref();
1223 }
1224 if (!(lhs.m3_ref() == rhs.m3_ref())) {
1225 return lhs.m3_ref() < rhs.m3_ref();
1226 }
1227 if (!(lhs.n1_ref() == rhs.n1_ref())) {
1228 return lhs.n1_ref() < rhs.n1_ref();
1229 }
1230 if (!(lhs.n2_ref() == rhs.n2_ref())) {
1231 return lhs.n2_ref() < rhs.n2_ref();
1232 }
1233 if (!(lhs.n3_ref() == rhs.n3_ref())) {
1234 return lhs.n3_ref() < rhs.n3_ref();
1235 }
1236 if (!(lhs.o1_ref() == rhs.o1_ref())) {
1237 return lhs.o1_ref() < rhs.o1_ref();
1238 }
1239 if (!(lhs.o2_ref() == rhs.o2_ref())) {
1240 return lhs.o2_ref() < rhs.o2_ref();
1241 }
1242 if (!(lhs.o3_ref() == rhs.o3_ref())) {
1243 return lhs.o3_ref() < rhs.o3_ref();
1244 }
1245 return false;
1246 }
1247
get_g() const1248 const ::test_cpp2::cpp_reflection::union1& structC::get_g() const& {
1249 return __fbthrift_field_g;
1250 }
1251
get_g()1252 ::test_cpp2::cpp_reflection::union1 structC::get_g() && {
1253 return std::move(__fbthrift_field_g);
1254 }
1255
get_h() const1256 const ::test_cpp2::cpp_reflection::unionA& structC::get_h() const& {
1257 return __fbthrift_field_h;
1258 }
1259
get_h()1260 ::test_cpp2::cpp_reflection::unionA structC::get_h() && {
1261 return std::move(__fbthrift_field_h);
1262 }
1263
get_i() const1264 const ::test_cpp2::cpp_reflection::unionA& structC::get_i() const& {
1265 return __fbthrift_field_i;
1266 }
1267
get_i()1268 ::test_cpp2::cpp_reflection::unionA structC::get_i() && {
1269 return std::move(__fbthrift_field_i);
1270 }
1271
get_j() const1272 const ::std::vector<::std::int32_t>& structC::get_j() const& {
1273 return __fbthrift_field_j;
1274 }
1275
get_j()1276 ::std::vector<::std::int32_t> structC::get_j() && {
1277 return std::move(__fbthrift_field_j);
1278 }
1279
get_j1() const1280 const ::std::vector<::std::int32_t>& structC::get_j1() const& {
1281 return __fbthrift_field_j1;
1282 }
1283
get_j1()1284 ::std::vector<::std::int32_t> structC::get_j1() && {
1285 return std::move(__fbthrift_field_j1);
1286 }
1287
get_j2() const1288 const ::std::vector<::test_cpp2::cpp_reflection::enum1>& structC::get_j2() const& {
1289 return __fbthrift_field_j2;
1290 }
1291
get_j2()1292 ::std::vector<::test_cpp2::cpp_reflection::enum1> structC::get_j2() && {
1293 return std::move(__fbthrift_field_j2);
1294 }
1295
get_j3() const1296 const ::std::vector<::test_cpp2::cpp_reflection::structA>& structC::get_j3() const& {
1297 return __fbthrift_field_j3;
1298 }
1299
get_j3()1300 ::std::vector<::test_cpp2::cpp_reflection::structA> structC::get_j3() && {
1301 return std::move(__fbthrift_field_j3);
1302 }
1303
get_k() const1304 const ::std::set<::std::int32_t>& structC::get_k() const& {
1305 return __fbthrift_field_k;
1306 }
1307
get_k()1308 ::std::set<::std::int32_t> structC::get_k() && {
1309 return std::move(__fbthrift_field_k);
1310 }
1311
get_k1() const1312 const ::std::set<::std::int32_t>& structC::get_k1() const& {
1313 return __fbthrift_field_k1;
1314 }
1315
get_k1()1316 ::std::set<::std::int32_t> structC::get_k1() && {
1317 return std::move(__fbthrift_field_k1);
1318 }
1319
get_k2() const1320 const ::std::set<::test_cpp2::cpp_reflection::enum2>& structC::get_k2() const& {
1321 return __fbthrift_field_k2;
1322 }
1323
get_k2()1324 ::std::set<::test_cpp2::cpp_reflection::enum2> structC::get_k2() && {
1325 return std::move(__fbthrift_field_k2);
1326 }
1327
get_k3() const1328 const ::std::set<::test_cpp2::cpp_reflection::structB>& structC::get_k3() const& {
1329 return __fbthrift_field_k3;
1330 }
1331
get_k3()1332 ::std::set<::test_cpp2::cpp_reflection::structB> structC::get_k3() && {
1333 return std::move(__fbthrift_field_k3);
1334 }
1335
get_l() const1336 const ::std::map<::std::int32_t, ::std::int32_t>& structC::get_l() const& {
1337 return __fbthrift_field_l;
1338 }
1339
get_l()1340 ::std::map<::std::int32_t, ::std::int32_t> structC::get_l() && {
1341 return std::move(__fbthrift_field_l);
1342 }
1343
get_l1() const1344 const ::std::map<::std::int32_t, ::std::int32_t>& structC::get_l1() const& {
1345 return __fbthrift_field_l1;
1346 }
1347
get_l1()1348 ::std::map<::std::int32_t, ::std::int32_t> structC::get_l1() && {
1349 return std::move(__fbthrift_field_l1);
1350 }
1351
get_l2() const1352 const ::std::map<::std::int32_t, ::test_cpp2::cpp_reflection::enum1>& structC::get_l2() const& {
1353 return __fbthrift_field_l2;
1354 }
1355
get_l2()1356 ::std::map<::std::int32_t, ::test_cpp2::cpp_reflection::enum1> structC::get_l2() && {
1357 return std::move(__fbthrift_field_l2);
1358 }
1359
get_l3() const1360 const ::std::map<::std::int32_t, ::test_cpp2::cpp_reflection::structB>& structC::get_l3() const& {
1361 return __fbthrift_field_l3;
1362 }
1363
get_l3()1364 ::std::map<::std::int32_t, ::test_cpp2::cpp_reflection::structB> structC::get_l3() && {
1365 return std::move(__fbthrift_field_l3);
1366 }
1367
get_m1() const1368 const ::std::map<::test_cpp2::cpp_reflection::enum1, ::std::int32_t>& structC::get_m1() const& {
1369 return __fbthrift_field_m1;
1370 }
1371
get_m1()1372 ::std::map<::test_cpp2::cpp_reflection::enum1, ::std::int32_t> structC::get_m1() && {
1373 return std::move(__fbthrift_field_m1);
1374 }
1375
get_m2() const1376 const ::std::map<::test_cpp2::cpp_reflection::enum1, ::test_cpp2::cpp_reflection::enum2>& structC::get_m2() const& {
1377 return __fbthrift_field_m2;
1378 }
1379
get_m2()1380 ::std::map<::test_cpp2::cpp_reflection::enum1, ::test_cpp2::cpp_reflection::enum2> structC::get_m2() && {
1381 return std::move(__fbthrift_field_m2);
1382 }
1383
get_m3() const1384 const ::std::map<::test_cpp2::cpp_reflection::enum1, ::test_cpp2::cpp_reflection::structB>& structC::get_m3() const& {
1385 return __fbthrift_field_m3;
1386 }
1387
get_m3()1388 ::std::map<::test_cpp2::cpp_reflection::enum1, ::test_cpp2::cpp_reflection::structB> structC::get_m3() && {
1389 return std::move(__fbthrift_field_m3);
1390 }
1391
get_n1() const1392 const ::std::map<::std::string, ::std::int32_t>& structC::get_n1() const& {
1393 return __fbthrift_field_n1;
1394 }
1395
get_n1()1396 ::std::map<::std::string, ::std::int32_t> structC::get_n1() && {
1397 return std::move(__fbthrift_field_n1);
1398 }
1399
get_n2() const1400 const ::std::map<::std::string, ::test_cpp2::cpp_reflection::enum1>& structC::get_n2() const& {
1401 return __fbthrift_field_n2;
1402 }
1403
get_n2()1404 ::std::map<::std::string, ::test_cpp2::cpp_reflection::enum1> structC::get_n2() && {
1405 return std::move(__fbthrift_field_n2);
1406 }
1407
get_n3() const1408 const ::std::map<::std::string, ::test_cpp2::cpp_reflection::structB>& structC::get_n3() const& {
1409 return __fbthrift_field_n3;
1410 }
1411
get_n3()1412 ::std::map<::std::string, ::test_cpp2::cpp_reflection::structB> structC::get_n3() && {
1413 return std::move(__fbthrift_field_n3);
1414 }
1415
get_o1() const1416 const ::std::map<::test_cpp2::cpp_reflection::structA, ::std::int32_t>& structC::get_o1() const& {
1417 return __fbthrift_field_o1;
1418 }
1419
get_o1()1420 ::std::map<::test_cpp2::cpp_reflection::structA, ::std::int32_t> structC::get_o1() && {
1421 return std::move(__fbthrift_field_o1);
1422 }
1423
get_o2() const1424 const ::std::map<::test_cpp2::cpp_reflection::structA, ::test_cpp2::cpp_reflection::enum1>& structC::get_o2() const& {
1425 return __fbthrift_field_o2;
1426 }
1427
get_o2()1428 ::std::map<::test_cpp2::cpp_reflection::structA, ::test_cpp2::cpp_reflection::enum1> structC::get_o2() && {
1429 return std::move(__fbthrift_field_o2);
1430 }
1431
get_o3() const1432 const ::std::map<::test_cpp2::cpp_reflection::structA, ::test_cpp2::cpp_reflection::structB>& structC::get_o3() const& {
1433 return __fbthrift_field_o3;
1434 }
1435
get_o3()1436 ::std::map<::test_cpp2::cpp_reflection::structA, ::test_cpp2::cpp_reflection::structB> structC::get_o3() && {
1437 return std::move(__fbthrift_field_o3);
1438 }
1439
1440
swap(structC & a,structC & b)1441 void swap(structC& a, structC& b) {
1442 using ::std::swap;
1443 swap(a.a_ref().value(), b.a_ref().value());
1444 swap(a.b_ref().value(), b.b_ref().value());
1445 swap(a.c_ref().value(), b.c_ref().value());
1446 swap(a.d_ref().value(), b.d_ref().value());
1447 swap(a.e_ref().value(), b.e_ref().value());
1448 swap(a.f_ref().value(), b.f_ref().value());
1449 swap(a.g_ref().value(), b.g_ref().value());
1450 swap(a.h_ref().value(), b.h_ref().value());
1451 swap(a.i_ref().value(), b.i_ref().value());
1452 swap(a.j_ref().value(), b.j_ref().value());
1453 swap(a.j1_ref().value(), b.j1_ref().value());
1454 swap(a.j2_ref().value(), b.j2_ref().value());
1455 swap(a.j3_ref().value(), b.j3_ref().value());
1456 swap(a.k_ref().value(), b.k_ref().value());
1457 swap(a.k1_ref().value(), b.k1_ref().value());
1458 swap(a.k2_ref().value(), b.k2_ref().value());
1459 swap(a.k3_ref().value(), b.k3_ref().value());
1460 swap(a.l_ref().value(), b.l_ref().value());
1461 swap(a.l1_ref().value(), b.l1_ref().value());
1462 swap(a.l2_ref().value(), b.l2_ref().value());
1463 swap(a.l3_ref().value(), b.l3_ref().value());
1464 swap(a.m1_ref().value(), b.m1_ref().value());
1465 swap(a.m2_ref().value(), b.m2_ref().value());
1466 swap(a.m3_ref().value(), b.m3_ref().value());
1467 swap(a.n1_ref().value(), b.n1_ref().value());
1468 swap(a.n2_ref().value(), b.n2_ref().value());
1469 swap(a.n3_ref().value(), b.n3_ref().value());
1470 swap(a.o1_ref().value(), b.o1_ref().value());
1471 swap(a.o2_ref().value(), b.o2_ref().value());
1472 swap(a.o3_ref().value(), b.o3_ref().value());
1473 swap(a.__isset, b.__isset);
1474 }
1475
1476 template void structC::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
1477 template uint32_t structC::write<>(apache::thrift::BinaryProtocolWriter*) const;
1478 template uint32_t structC::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
1479 template uint32_t structC::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
1480 template void structC::readNoXfer<>(apache::thrift::CompactProtocolReader*);
1481 template uint32_t structC::write<>(apache::thrift::CompactProtocolWriter*) const;
1482 template uint32_t structC::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
1483 template uint32_t structC::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
1484
1485 static_assert(
1486 ::apache::thrift::detail::st::gen_check_json<
1487 structC,
1488 ::apache::thrift::type_class::variant,
1489 ::test_cpp2::cpp_reflection::union1>,
1490 "inconsistent use of json option");
1491 static_assert(
1492 ::apache::thrift::detail::st::gen_check_json<
1493 structC,
1494 ::apache::thrift::type_class::variant,
1495 ::test_cpp2::cpp_reflection::unionA>,
1496 "inconsistent use of json option");
1497 static_assert(
1498 ::apache::thrift::detail::st::gen_check_json<
1499 structC,
1500 ::apache::thrift::type_class::variant,
1501 ::test_cpp2::cpp_reflection::unionA>,
1502 "inconsistent use of json option");
1503 static_assert(
1504 ::apache::thrift::detail::st::gen_check_json<
1505 structC,
1506 ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>,
1507 ::std::vector<::test_cpp2::cpp_reflection::structA>>,
1508 "inconsistent use of json option");
1509 static_assert(
1510 ::apache::thrift::detail::st::gen_check_json<
1511 structC,
1512 ::apache::thrift::type_class::set<::apache::thrift::type_class::structure>,
1513 ::std::set<::test_cpp2::cpp_reflection::structB>>,
1514 "inconsistent use of json option");
1515 static_assert(
1516 ::apache::thrift::detail::st::gen_check_json<
1517 structC,
1518 ::apache::thrift::type_class::map<::apache::thrift::type_class::integral, ::apache::thrift::type_class::structure>,
1519 ::std::map<::std::int32_t, ::test_cpp2::cpp_reflection::structB>>,
1520 "inconsistent use of json option");
1521 static_assert(
1522 ::apache::thrift::detail::st::gen_check_json<
1523 structC,
1524 ::apache::thrift::type_class::map<::apache::thrift::type_class::enumeration, ::apache::thrift::type_class::structure>,
1525 ::std::map<::test_cpp2::cpp_reflection::enum1, ::test_cpp2::cpp_reflection::structB>>,
1526 "inconsistent use of json option");
1527 static_assert(
1528 ::apache::thrift::detail::st::gen_check_json<
1529 structC,
1530 ::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::structure>,
1531 ::std::map<::std::string, ::test_cpp2::cpp_reflection::structB>>,
1532 "inconsistent use of json option");
1533 static_assert(
1534 ::apache::thrift::detail::st::gen_check_json<
1535 structC,
1536 ::apache::thrift::type_class::map<::apache::thrift::type_class::structure, ::apache::thrift::type_class::integral>,
1537 ::std::map<::test_cpp2::cpp_reflection::structA, ::std::int32_t>>,
1538 "inconsistent use of json option");
1539 static_assert(
1540 ::apache::thrift::detail::st::gen_check_json<
1541 structC,
1542 ::apache::thrift::type_class::map<::apache::thrift::type_class::structure, ::apache::thrift::type_class::enumeration>,
1543 ::std::map<::test_cpp2::cpp_reflection::structA, ::test_cpp2::cpp_reflection::enum1>>,
1544 "inconsistent use of json option");
1545 static_assert(
1546 ::apache::thrift::detail::st::gen_check_json<
1547 structC,
1548 ::apache::thrift::type_class::map<::apache::thrift::type_class::structure, ::apache::thrift::type_class::structure>,
1549 ::std::map<::test_cpp2::cpp_reflection::structA, ::test_cpp2::cpp_reflection::structB>>,
1550 "inconsistent use of json option");
1551
1552 static_assert(
1553 ::apache::thrift::detail::st::gen_check_nimble<
1554 structC,
1555 ::apache::thrift::type_class::variant,
1556 ::test_cpp2::cpp_reflection::union1>,
1557 "inconsistent use of nimble option");
1558 static_assert(
1559 ::apache::thrift::detail::st::gen_check_nimble<
1560 structC,
1561 ::apache::thrift::type_class::variant,
1562 ::test_cpp2::cpp_reflection::unionA>,
1563 "inconsistent use of nimble option");
1564 static_assert(
1565 ::apache::thrift::detail::st::gen_check_nimble<
1566 structC,
1567 ::apache::thrift::type_class::variant,
1568 ::test_cpp2::cpp_reflection::unionA>,
1569 "inconsistent use of nimble option");
1570 static_assert(
1571 ::apache::thrift::detail::st::gen_check_nimble<
1572 structC,
1573 ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>,
1574 ::std::vector<::test_cpp2::cpp_reflection::structA>>,
1575 "inconsistent use of nimble option");
1576 static_assert(
1577 ::apache::thrift::detail::st::gen_check_nimble<
1578 structC,
1579 ::apache::thrift::type_class::set<::apache::thrift::type_class::structure>,
1580 ::std::set<::test_cpp2::cpp_reflection::structB>>,
1581 "inconsistent use of nimble option");
1582 static_assert(
1583 ::apache::thrift::detail::st::gen_check_nimble<
1584 structC,
1585 ::apache::thrift::type_class::map<::apache::thrift::type_class::integral, ::apache::thrift::type_class::structure>,
1586 ::std::map<::std::int32_t, ::test_cpp2::cpp_reflection::structB>>,
1587 "inconsistent use of nimble option");
1588 static_assert(
1589 ::apache::thrift::detail::st::gen_check_nimble<
1590 structC,
1591 ::apache::thrift::type_class::map<::apache::thrift::type_class::enumeration, ::apache::thrift::type_class::structure>,
1592 ::std::map<::test_cpp2::cpp_reflection::enum1, ::test_cpp2::cpp_reflection::structB>>,
1593 "inconsistent use of nimble option");
1594 static_assert(
1595 ::apache::thrift::detail::st::gen_check_nimble<
1596 structC,
1597 ::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::structure>,
1598 ::std::map<::std::string, ::test_cpp2::cpp_reflection::structB>>,
1599 "inconsistent use of nimble option");
1600 static_assert(
1601 ::apache::thrift::detail::st::gen_check_nimble<
1602 structC,
1603 ::apache::thrift::type_class::map<::apache::thrift::type_class::structure, ::apache::thrift::type_class::integral>,
1604 ::std::map<::test_cpp2::cpp_reflection::structA, ::std::int32_t>>,
1605 "inconsistent use of nimble option");
1606 static_assert(
1607 ::apache::thrift::detail::st::gen_check_nimble<
1608 structC,
1609 ::apache::thrift::type_class::map<::apache::thrift::type_class::structure, ::apache::thrift::type_class::enumeration>,
1610 ::std::map<::test_cpp2::cpp_reflection::structA, ::test_cpp2::cpp_reflection::enum1>>,
1611 "inconsistent use of nimble option");
1612 static_assert(
1613 ::apache::thrift::detail::st::gen_check_nimble<
1614 structC,
1615 ::apache::thrift::type_class::map<::apache::thrift::type_class::structure, ::apache::thrift::type_class::structure>,
1616 ::std::map<::test_cpp2::cpp_reflection::structA, ::test_cpp2::cpp_reflection::structB>>,
1617 "inconsistent use of nimble option");
1618
1619 }} // test_cpp2::cpp_reflection
1620
1621 namespace apache {
1622 namespace thrift {
1623 namespace detail {
1624
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)1625 void TccStructTraits<::test_cpp2::cpp_reflection::struct1>::translateFieldName(
1626 folly::StringPiece _fname,
1627 int16_t& fid,
1628 apache::thrift::protocol::TType& _ftype) noexcept {
1629 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::struct1>;
1630 static const st::translate_field_name_table table{
1631 data::fields_size,
1632 data::fields_names.data(),
1633 data::fields_ids.data(),
1634 data::fields_types.data()};
1635 st::translate_field_name(_fname, fid, _ftype, table);
1636 }
1637
1638 } // namespace detail
1639 } // namespace thrift
1640 } // namespace apache
1641
1642 namespace test_cpp2 { namespace cpp_reflection {
1643
1644 struct1::struct1(const struct1&) = default;
1645 struct1& struct1::operator=(const struct1&) = default;
struct1()1646 struct1::struct1() :
1647 field0(),
1648 __fbthrift_field_field2(),
1649 field3() {
1650 }
1651
1652
~struct1()1653 struct1::~struct1() {}
1654
struct1(struct1 && other)1655 struct1::struct1(struct1&& other) noexcept :
1656 field0(std::move(other.field0)),
1657 __fbthrift_field_field1(std::move(other.__fbthrift_field_field1)),
1658 __fbthrift_field_field2(std::move(other.__fbthrift_field_field2)),
1659 field3(std::move(other.field3)),
1660 __fbthrift_field_field4(std::move(other.__fbthrift_field_field4)),
1661 __fbthrift_field_field5(std::move(other.__fbthrift_field_field5)),
1662 __isset(other.__isset) {
1663 }
1664
operator =(FOLLY_MAYBE_UNUSED struct1 && other)1665 struct1& struct1::operator=(FOLLY_MAYBE_UNUSED struct1&& other) noexcept {
1666 this->field0 = std::move(other.field0);
1667 this->__fbthrift_field_field1 = std::move(other.__fbthrift_field_field1);
1668 this->__fbthrift_field_field2 = std::move(other.__fbthrift_field_field2);
1669 this->field3 = std::move(other.field3);
1670 this->__fbthrift_field_field4 = std::move(other.__fbthrift_field_field4);
1671 this->__fbthrift_field_field5 = std::move(other.__fbthrift_field_field5);
1672 __isset = other.__isset;
1673 return *this;
1674 }
1675
1676
struct1(apache::thrift::FragileConstructor,::std::int32_t field0__arg,::std::string field1__arg,::test_cpp2::cpp_reflection::enum1 field2__arg,::test_cpp2::cpp_reflection::enum2 field3__arg,::test_cpp2::cpp_reflection::union1 field4__arg,::test_cpp2::cpp_reflection::union2 field5__arg)1677 struct1::struct1(apache::thrift::FragileConstructor, ::std::int32_t field0__arg, ::std::string field1__arg, ::test_cpp2::cpp_reflection::enum1 field2__arg, ::test_cpp2::cpp_reflection::enum2 field3__arg, ::test_cpp2::cpp_reflection::union1 field4__arg, ::test_cpp2::cpp_reflection::union2 field5__arg) :
1678 field0(std::move(field0__arg)),
1679 __fbthrift_field_field1(std::move(field1__arg)),
1680 __fbthrift_field_field2(std::move(field2__arg)),
1681 field3(std::move(field3__arg)),
1682 __fbthrift_field_field4(std::move(field4__arg)),
1683 __fbthrift_field_field5(std::move(field5__arg)) {
1684 __isset.set(folly::index_constant<0>(), true);
1685 __isset.set(folly::index_constant<1>(), true);
1686 __isset.set(folly::index_constant<2>(), true);
1687 __isset.set(folly::index_constant<3>(), true);
1688 }
1689
1690
__fbthrift_clear()1691 void struct1::__fbthrift_clear() {
1692 // clear all fields
1693 this->field0 = ::std::int32_t();
1694 this->__fbthrift_field_field1 = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
1695 this->__fbthrift_field_field2 = ::test_cpp2::cpp_reflection::enum1();
1696 this->field3 = ::test_cpp2::cpp_reflection::enum2();
1697 apache::thrift::clear(this->__fbthrift_field_field4);
1698 apache::thrift::clear(this->__fbthrift_field_field5);
1699 __isset = {};
1700 }
1701
operator ==(const struct1 & rhs) const1702 bool struct1::operator==(const struct1& rhs) const {
1703 (void)rhs;
1704 auto& lhs = *this;
1705 (void)lhs;
1706 if (!(lhs.field0_ref() == rhs.field0_ref())) {
1707 return false;
1708 }
1709 if (!(lhs.field1_ref() == rhs.field1_ref())) {
1710 return false;
1711 }
1712 if (!(lhs.field2_ref() == rhs.field2_ref())) {
1713 return false;
1714 }
1715 if (!(lhs.field3_ref() == rhs.field3_ref())) {
1716 return false;
1717 }
1718 if (!(lhs.field4_ref() == rhs.field4_ref())) {
1719 return false;
1720 }
1721 if (!(lhs.field5_ref() == rhs.field5_ref())) {
1722 return false;
1723 }
1724 return true;
1725 }
1726
operator <(const struct1 & rhs) const1727 bool struct1::operator<(const struct1& rhs) const {
1728 (void)rhs;
1729 auto& lhs = *this;
1730 (void)lhs;
1731 if (!(lhs.field0_ref() == rhs.field0_ref())) {
1732 return lhs.field0_ref() < rhs.field0_ref();
1733 }
1734 if (!(lhs.field1_ref() == rhs.field1_ref())) {
1735 return lhs.field1_ref() < rhs.field1_ref();
1736 }
1737 if (!(lhs.field2_ref() == rhs.field2_ref())) {
1738 return lhs.field2_ref() < rhs.field2_ref();
1739 }
1740 if (!(lhs.field3_ref() == rhs.field3_ref())) {
1741 return lhs.field3_ref() < rhs.field3_ref();
1742 }
1743 if (!(lhs.field4_ref() == rhs.field4_ref())) {
1744 return lhs.field4_ref() < rhs.field4_ref();
1745 }
1746 if (!(lhs.field5_ref() == rhs.field5_ref())) {
1747 return lhs.field5_ref() < rhs.field5_ref();
1748 }
1749 return false;
1750 }
1751
get_field4() const1752 const ::test_cpp2::cpp_reflection::union1* struct1::get_field4() const& {
1753 return field4_ref().has_value() ? std::addressof(__fbthrift_field_field4) : nullptr;
1754 }
1755
get_field4()1756 ::test_cpp2::cpp_reflection::union1* struct1::get_field4() & {
1757 return field4_ref().has_value() ? std::addressof(__fbthrift_field_field4) : nullptr;
1758 }
1759
get_field5() const1760 const ::test_cpp2::cpp_reflection::union2& struct1::get_field5() const& {
1761 return __fbthrift_field_field5;
1762 }
1763
get_field5()1764 ::test_cpp2::cpp_reflection::union2 struct1::get_field5() && {
1765 return std::move(__fbthrift_field_field5);
1766 }
1767
1768
swap(struct1 & a,struct1 & b)1769 void swap(struct1& a, struct1& b) {
1770 using ::std::swap;
1771 swap(a.field0_ref().value(), b.field0_ref().value());
1772 swap(a.field1_ref().value_unchecked(), b.field1_ref().value_unchecked());
1773 swap(a.field2_ref().value(), b.field2_ref().value());
1774 swap(a.field3_ref().value(), b.field3_ref().value());
1775 swap(a.field4_ref().value_unchecked(), b.field4_ref().value_unchecked());
1776 swap(a.field5_ref().value(), b.field5_ref().value());
1777 swap(a.__isset, b.__isset);
1778 }
1779
1780 template void struct1::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
1781 template uint32_t struct1::write<>(apache::thrift::BinaryProtocolWriter*) const;
1782 template uint32_t struct1::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
1783 template uint32_t struct1::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
1784 template void struct1::readNoXfer<>(apache::thrift::CompactProtocolReader*);
1785 template uint32_t struct1::write<>(apache::thrift::CompactProtocolWriter*) const;
1786 template uint32_t struct1::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
1787 template uint32_t struct1::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
1788
1789 static_assert(
1790 ::apache::thrift::detail::st::gen_check_json<
1791 struct1,
1792 ::apache::thrift::type_class::variant,
1793 ::test_cpp2::cpp_reflection::union1>,
1794 "inconsistent use of json option");
1795 static_assert(
1796 ::apache::thrift::detail::st::gen_check_json<
1797 struct1,
1798 ::apache::thrift::type_class::variant,
1799 ::test_cpp2::cpp_reflection::union2>,
1800 "inconsistent use of json option");
1801
1802 static_assert(
1803 ::apache::thrift::detail::st::gen_check_nimble<
1804 struct1,
1805 ::apache::thrift::type_class::variant,
1806 ::test_cpp2::cpp_reflection::union1>,
1807 "inconsistent use of nimble option");
1808 static_assert(
1809 ::apache::thrift::detail::st::gen_check_nimble<
1810 struct1,
1811 ::apache::thrift::type_class::variant,
1812 ::test_cpp2::cpp_reflection::union2>,
1813 "inconsistent use of nimble option");
1814
1815 }} // test_cpp2::cpp_reflection
1816
1817 namespace apache {
1818 namespace thrift {
1819 namespace detail {
1820
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)1821 void TccStructTraits<::test_cpp2::cpp_reflection::struct2>::translateFieldName(
1822 folly::StringPiece _fname,
1823 int16_t& fid,
1824 apache::thrift::protocol::TType& _ftype) noexcept {
1825 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::struct2>;
1826 static const st::translate_field_name_table table{
1827 data::fields_size,
1828 data::fields_names.data(),
1829 data::fields_ids.data(),
1830 data::fields_types.data()};
1831 st::translate_field_name(_fname, fid, _ftype, table);
1832 }
1833
1834 } // namespace detail
1835 } // namespace thrift
1836 } // namespace apache
1837
1838 namespace test_cpp2 { namespace cpp_reflection {
1839
1840 struct2::struct2(const struct2&) = default;
1841 struct2& struct2::operator=(const struct2&) = default;
struct2()1842 struct2::struct2() :
1843 __fbthrift_field_fieldA(),
1844 __fbthrift_field_fieldC(),
1845 __fbthrift_field_fieldD() {
1846 }
1847
1848
~struct2()1849 struct2::~struct2() {}
1850
struct2(struct2 && other)1851 struct2::struct2(struct2&& other) noexcept :
1852 __fbthrift_field_fieldA(std::move(other.__fbthrift_field_fieldA)),
1853 __fbthrift_field_fieldB(std::move(other.__fbthrift_field_fieldB)),
1854 __fbthrift_field_fieldC(std::move(other.__fbthrift_field_fieldC)),
1855 __fbthrift_field_fieldD(std::move(other.__fbthrift_field_fieldD)),
1856 __fbthrift_field_fieldE(std::move(other.__fbthrift_field_fieldE)),
1857 __fbthrift_field_fieldF(std::move(other.__fbthrift_field_fieldF)),
1858 __fbthrift_field_fieldG(std::move(other.__fbthrift_field_fieldG)),
1859 __isset(other.__isset) {
1860 }
1861
operator =(FOLLY_MAYBE_UNUSED struct2 && other)1862 struct2& struct2::operator=(FOLLY_MAYBE_UNUSED struct2&& other) noexcept {
1863 this->__fbthrift_field_fieldA = std::move(other.__fbthrift_field_fieldA);
1864 this->__fbthrift_field_fieldB = std::move(other.__fbthrift_field_fieldB);
1865 this->__fbthrift_field_fieldC = std::move(other.__fbthrift_field_fieldC);
1866 this->__fbthrift_field_fieldD = std::move(other.__fbthrift_field_fieldD);
1867 this->__fbthrift_field_fieldE = std::move(other.__fbthrift_field_fieldE);
1868 this->__fbthrift_field_fieldF = std::move(other.__fbthrift_field_fieldF);
1869 this->__fbthrift_field_fieldG = std::move(other.__fbthrift_field_fieldG);
1870 __isset = other.__isset;
1871 return *this;
1872 }
1873
1874
struct2(apache::thrift::FragileConstructor,::std::int32_t fieldA__arg,::std::string fieldB__arg,::test_cpp2::cpp_reflection::enum1 fieldC__arg,::test_cpp2::cpp_reflection::enum2 fieldD__arg,::test_cpp2::cpp_reflection::union1 fieldE__arg,::test_cpp2::cpp_reflection::union2 fieldF__arg,::test_cpp2::cpp_reflection::struct1 fieldG__arg)1875 struct2::struct2(apache::thrift::FragileConstructor, ::std::int32_t fieldA__arg, ::std::string fieldB__arg, ::test_cpp2::cpp_reflection::enum1 fieldC__arg, ::test_cpp2::cpp_reflection::enum2 fieldD__arg, ::test_cpp2::cpp_reflection::union1 fieldE__arg, ::test_cpp2::cpp_reflection::union2 fieldF__arg, ::test_cpp2::cpp_reflection::struct1 fieldG__arg) :
1876 __fbthrift_field_fieldA(std::move(fieldA__arg)),
1877 __fbthrift_field_fieldB(std::move(fieldB__arg)),
1878 __fbthrift_field_fieldC(std::move(fieldC__arg)),
1879 __fbthrift_field_fieldD(std::move(fieldD__arg)),
1880 __fbthrift_field_fieldE(std::move(fieldE__arg)),
1881 __fbthrift_field_fieldF(std::move(fieldF__arg)),
1882 __fbthrift_field_fieldG(std::move(fieldG__arg)) {
1883 __isset.set(folly::index_constant<0>(), true);
1884 __isset.set(folly::index_constant<1>(), true);
1885 __isset.set(folly::index_constant<2>(), true);
1886 __isset.set(folly::index_constant<3>(), true);
1887 __isset.set(folly::index_constant<4>(), true);
1888 __isset.set(folly::index_constant<5>(), true);
1889 __isset.set(folly::index_constant<6>(), true);
1890 }
1891
1892
__fbthrift_clear()1893 void struct2::__fbthrift_clear() {
1894 // clear all fields
1895 this->__fbthrift_field_fieldA = ::std::int32_t();
1896 this->__fbthrift_field_fieldB = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
1897 this->__fbthrift_field_fieldC = ::test_cpp2::cpp_reflection::enum1();
1898 this->__fbthrift_field_fieldD = ::test_cpp2::cpp_reflection::enum2();
1899 apache::thrift::clear(this->__fbthrift_field_fieldE);
1900 apache::thrift::clear(this->__fbthrift_field_fieldF);
1901 apache::thrift::clear(this->__fbthrift_field_fieldG);
1902 __isset = {};
1903 }
1904
operator ==(const struct2 & rhs) const1905 bool struct2::operator==(const struct2& rhs) const {
1906 (void)rhs;
1907 auto& lhs = *this;
1908 (void)lhs;
1909 if (!(lhs.fieldA_ref() == rhs.fieldA_ref())) {
1910 return false;
1911 }
1912 if (!(lhs.fieldB_ref() == rhs.fieldB_ref())) {
1913 return false;
1914 }
1915 if (!(lhs.fieldC_ref() == rhs.fieldC_ref())) {
1916 return false;
1917 }
1918 if (!(lhs.fieldD_ref() == rhs.fieldD_ref())) {
1919 return false;
1920 }
1921 if (!(lhs.fieldE_ref() == rhs.fieldE_ref())) {
1922 return false;
1923 }
1924 if (!(lhs.fieldF_ref() == rhs.fieldF_ref())) {
1925 return false;
1926 }
1927 if (!(lhs.fieldG_ref() == rhs.fieldG_ref())) {
1928 return false;
1929 }
1930 return true;
1931 }
1932
operator <(const struct2 & rhs) const1933 bool struct2::operator<(const struct2& rhs) const {
1934 (void)rhs;
1935 auto& lhs = *this;
1936 (void)lhs;
1937 if (!(lhs.fieldA_ref() == rhs.fieldA_ref())) {
1938 return lhs.fieldA_ref() < rhs.fieldA_ref();
1939 }
1940 if (!(lhs.fieldB_ref() == rhs.fieldB_ref())) {
1941 return lhs.fieldB_ref() < rhs.fieldB_ref();
1942 }
1943 if (!(lhs.fieldC_ref() == rhs.fieldC_ref())) {
1944 return lhs.fieldC_ref() < rhs.fieldC_ref();
1945 }
1946 if (!(lhs.fieldD_ref() == rhs.fieldD_ref())) {
1947 return lhs.fieldD_ref() < rhs.fieldD_ref();
1948 }
1949 if (!(lhs.fieldE_ref() == rhs.fieldE_ref())) {
1950 return lhs.fieldE_ref() < rhs.fieldE_ref();
1951 }
1952 if (!(lhs.fieldF_ref() == rhs.fieldF_ref())) {
1953 return lhs.fieldF_ref() < rhs.fieldF_ref();
1954 }
1955 if (!(lhs.fieldG_ref() == rhs.fieldG_ref())) {
1956 return lhs.fieldG_ref() < rhs.fieldG_ref();
1957 }
1958 return false;
1959 }
1960
get_fieldE() const1961 const ::test_cpp2::cpp_reflection::union1& struct2::get_fieldE() const& {
1962 return __fbthrift_field_fieldE;
1963 }
1964
get_fieldE()1965 ::test_cpp2::cpp_reflection::union1 struct2::get_fieldE() && {
1966 return std::move(__fbthrift_field_fieldE);
1967 }
1968
get_fieldF() const1969 const ::test_cpp2::cpp_reflection::union2& struct2::get_fieldF() const& {
1970 return __fbthrift_field_fieldF;
1971 }
1972
get_fieldF()1973 ::test_cpp2::cpp_reflection::union2 struct2::get_fieldF() && {
1974 return std::move(__fbthrift_field_fieldF);
1975 }
1976
get_fieldG() const1977 const ::test_cpp2::cpp_reflection::struct1& struct2::get_fieldG() const& {
1978 return __fbthrift_field_fieldG;
1979 }
1980
get_fieldG()1981 ::test_cpp2::cpp_reflection::struct1 struct2::get_fieldG() && {
1982 return std::move(__fbthrift_field_fieldG);
1983 }
1984
1985
swap(struct2 & a,struct2 & b)1986 void swap(struct2& a, struct2& b) {
1987 using ::std::swap;
1988 swap(a.fieldA_ref().value(), b.fieldA_ref().value());
1989 swap(a.fieldB_ref().value(), b.fieldB_ref().value());
1990 swap(a.fieldC_ref().value(), b.fieldC_ref().value());
1991 swap(a.fieldD_ref().value(), b.fieldD_ref().value());
1992 swap(a.fieldE_ref().value(), b.fieldE_ref().value());
1993 swap(a.fieldF_ref().value(), b.fieldF_ref().value());
1994 swap(a.fieldG_ref().value(), b.fieldG_ref().value());
1995 swap(a.__isset, b.__isset);
1996 }
1997
1998 template void struct2::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
1999 template uint32_t struct2::write<>(apache::thrift::BinaryProtocolWriter*) const;
2000 template uint32_t struct2::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
2001 template uint32_t struct2::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
2002 template void struct2::readNoXfer<>(apache::thrift::CompactProtocolReader*);
2003 template uint32_t struct2::write<>(apache::thrift::CompactProtocolWriter*) const;
2004 template uint32_t struct2::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
2005 template uint32_t struct2::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
2006
2007 static_assert(
2008 ::apache::thrift::detail::st::gen_check_json<
2009 struct2,
2010 ::apache::thrift::type_class::variant,
2011 ::test_cpp2::cpp_reflection::union1>,
2012 "inconsistent use of json option");
2013 static_assert(
2014 ::apache::thrift::detail::st::gen_check_json<
2015 struct2,
2016 ::apache::thrift::type_class::variant,
2017 ::test_cpp2::cpp_reflection::union2>,
2018 "inconsistent use of json option");
2019 static_assert(
2020 ::apache::thrift::detail::st::gen_check_json<
2021 struct2,
2022 ::apache::thrift::type_class::structure,
2023 ::test_cpp2::cpp_reflection::struct1>,
2024 "inconsistent use of json option");
2025
2026 static_assert(
2027 ::apache::thrift::detail::st::gen_check_nimble<
2028 struct2,
2029 ::apache::thrift::type_class::variant,
2030 ::test_cpp2::cpp_reflection::union1>,
2031 "inconsistent use of nimble option");
2032 static_assert(
2033 ::apache::thrift::detail::st::gen_check_nimble<
2034 struct2,
2035 ::apache::thrift::type_class::variant,
2036 ::test_cpp2::cpp_reflection::union2>,
2037 "inconsistent use of nimble option");
2038 static_assert(
2039 ::apache::thrift::detail::st::gen_check_nimble<
2040 struct2,
2041 ::apache::thrift::type_class::structure,
2042 ::test_cpp2::cpp_reflection::struct1>,
2043 "inconsistent use of nimble option");
2044
2045 }} // test_cpp2::cpp_reflection
2046
2047 namespace apache {
2048 namespace thrift {
2049 namespace detail {
2050
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)2051 void TccStructTraits<::test_cpp2::cpp_reflection::struct3>::translateFieldName(
2052 folly::StringPiece _fname,
2053 int16_t& fid,
2054 apache::thrift::protocol::TType& _ftype) noexcept {
2055 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::struct3>;
2056 static const st::translate_field_name_table table{
2057 data::fields_size,
2058 data::fields_names.data(),
2059 data::fields_ids.data(),
2060 data::fields_types.data()};
2061 st::translate_field_name(_fname, fid, _ftype, table);
2062 }
2063
2064 } // namespace detail
2065 } // namespace thrift
2066 } // namespace apache
2067
2068 namespace test_cpp2 { namespace cpp_reflection {
2069
2070 struct3::struct3(const struct3&) = default;
2071 struct3& struct3::operator=(const struct3&) = default;
struct3()2072 struct3::struct3() :
2073 __fbthrift_field_fieldA(),
2074 __fbthrift_field_fieldC(),
2075 __fbthrift_field_fieldD() {
2076 }
2077
2078
~struct3()2079 struct3::~struct3() {}
2080
struct3(struct3 && other)2081 struct3::struct3(struct3&& other) noexcept :
2082 __fbthrift_field_fieldA(std::move(other.__fbthrift_field_fieldA)),
2083 __fbthrift_field_fieldB(std::move(other.__fbthrift_field_fieldB)),
2084 __fbthrift_field_fieldC(std::move(other.__fbthrift_field_fieldC)),
2085 __fbthrift_field_fieldD(std::move(other.__fbthrift_field_fieldD)),
2086 __fbthrift_field_fieldE(std::move(other.__fbthrift_field_fieldE)),
2087 __fbthrift_field_fieldF(std::move(other.__fbthrift_field_fieldF)),
2088 __fbthrift_field_fieldG(std::move(other.__fbthrift_field_fieldG)),
2089 __fbthrift_field_fieldH(std::move(other.__fbthrift_field_fieldH)),
2090 __fbthrift_field_fieldI(std::move(other.__fbthrift_field_fieldI)),
2091 __fbthrift_field_fieldJ(std::move(other.__fbthrift_field_fieldJ)),
2092 __fbthrift_field_fieldK(std::move(other.__fbthrift_field_fieldK)),
2093 __fbthrift_field_fieldL(std::move(other.__fbthrift_field_fieldL)),
2094 __fbthrift_field_fieldM(std::move(other.__fbthrift_field_fieldM)),
2095 __fbthrift_field_fieldN(std::move(other.__fbthrift_field_fieldN)),
2096 __fbthrift_field_fieldO(std::move(other.__fbthrift_field_fieldO)),
2097 __fbthrift_field_fieldP(std::move(other.__fbthrift_field_fieldP)),
2098 __fbthrift_field_fieldQ(std::move(other.__fbthrift_field_fieldQ)),
2099 __fbthrift_field_fieldR(std::move(other.__fbthrift_field_fieldR)),
2100 __isset(other.__isset) {
2101 }
2102
operator =(FOLLY_MAYBE_UNUSED struct3 && other)2103 struct3& struct3::operator=(FOLLY_MAYBE_UNUSED struct3&& other) noexcept {
2104 this->__fbthrift_field_fieldA = std::move(other.__fbthrift_field_fieldA);
2105 this->__fbthrift_field_fieldB = std::move(other.__fbthrift_field_fieldB);
2106 this->__fbthrift_field_fieldC = std::move(other.__fbthrift_field_fieldC);
2107 this->__fbthrift_field_fieldD = std::move(other.__fbthrift_field_fieldD);
2108 this->__fbthrift_field_fieldE = std::move(other.__fbthrift_field_fieldE);
2109 this->__fbthrift_field_fieldF = std::move(other.__fbthrift_field_fieldF);
2110 this->__fbthrift_field_fieldG = std::move(other.__fbthrift_field_fieldG);
2111 this->__fbthrift_field_fieldH = std::move(other.__fbthrift_field_fieldH);
2112 this->__fbthrift_field_fieldI = std::move(other.__fbthrift_field_fieldI);
2113 this->__fbthrift_field_fieldJ = std::move(other.__fbthrift_field_fieldJ);
2114 this->__fbthrift_field_fieldK = std::move(other.__fbthrift_field_fieldK);
2115 this->__fbthrift_field_fieldL = std::move(other.__fbthrift_field_fieldL);
2116 this->__fbthrift_field_fieldM = std::move(other.__fbthrift_field_fieldM);
2117 this->__fbthrift_field_fieldN = std::move(other.__fbthrift_field_fieldN);
2118 this->__fbthrift_field_fieldO = std::move(other.__fbthrift_field_fieldO);
2119 this->__fbthrift_field_fieldP = std::move(other.__fbthrift_field_fieldP);
2120 this->__fbthrift_field_fieldQ = std::move(other.__fbthrift_field_fieldQ);
2121 this->__fbthrift_field_fieldR = std::move(other.__fbthrift_field_fieldR);
2122 __isset = other.__isset;
2123 return *this;
2124 }
2125
2126
struct3(apache::thrift::FragileConstructor,::std::int32_t fieldA__arg,::std::string fieldB__arg,::test_cpp2::cpp_reflection::enum1 fieldC__arg,::test_cpp2::cpp_reflection::enum2 fieldD__arg,::test_cpp2::cpp_reflection::union1 fieldE__arg,::test_cpp2::cpp_reflection::union2 fieldF__arg,::test_cpp2::cpp_reflection::struct1 fieldG__arg,::test_cpp2::cpp_reflection::union2 fieldH__arg,::std::vector<::std::int32_t> fieldI__arg,::std::vector<::std::string> fieldJ__arg,::std::vector<::std::string> fieldK__arg,::std::vector<::test_cpp2::cpp_reflection::structA> fieldL__arg,::std::set<::std::int32_t> fieldM__arg,::std::set<::std::string> fieldN__arg,::std::set<::std::string> fieldO__arg,::std::set<::test_cpp2::cpp_reflection::structB> fieldP__arg,::std::map<::std::string,::test_cpp2::cpp_reflection::structA> fieldQ__arg,::std::map<::std::string,::test_cpp2::cpp_reflection::structB> fieldR__arg)2127 struct3::struct3(apache::thrift::FragileConstructor, ::std::int32_t fieldA__arg, ::std::string fieldB__arg, ::test_cpp2::cpp_reflection::enum1 fieldC__arg, ::test_cpp2::cpp_reflection::enum2 fieldD__arg, ::test_cpp2::cpp_reflection::union1 fieldE__arg, ::test_cpp2::cpp_reflection::union2 fieldF__arg, ::test_cpp2::cpp_reflection::struct1 fieldG__arg, ::test_cpp2::cpp_reflection::union2 fieldH__arg, ::std::vector<::std::int32_t> fieldI__arg, ::std::vector<::std::string> fieldJ__arg, ::std::vector<::std::string> fieldK__arg, ::std::vector<::test_cpp2::cpp_reflection::structA> fieldL__arg, ::std::set<::std::int32_t> fieldM__arg, ::std::set<::std::string> fieldN__arg, ::std::set<::std::string> fieldO__arg, ::std::set<::test_cpp2::cpp_reflection::structB> fieldP__arg, ::std::map<::std::string, ::test_cpp2::cpp_reflection::structA> fieldQ__arg, ::std::map<::std::string, ::test_cpp2::cpp_reflection::structB> fieldR__arg) :
2128 __fbthrift_field_fieldA(std::move(fieldA__arg)),
2129 __fbthrift_field_fieldB(std::move(fieldB__arg)),
2130 __fbthrift_field_fieldC(std::move(fieldC__arg)),
2131 __fbthrift_field_fieldD(std::move(fieldD__arg)),
2132 __fbthrift_field_fieldE(std::move(fieldE__arg)),
2133 __fbthrift_field_fieldF(std::move(fieldF__arg)),
2134 __fbthrift_field_fieldG(std::move(fieldG__arg)),
2135 __fbthrift_field_fieldH(std::move(fieldH__arg)),
2136 __fbthrift_field_fieldI(std::move(fieldI__arg)),
2137 __fbthrift_field_fieldJ(std::move(fieldJ__arg)),
2138 __fbthrift_field_fieldK(std::move(fieldK__arg)),
2139 __fbthrift_field_fieldL(std::move(fieldL__arg)),
2140 __fbthrift_field_fieldM(std::move(fieldM__arg)),
2141 __fbthrift_field_fieldN(std::move(fieldN__arg)),
2142 __fbthrift_field_fieldO(std::move(fieldO__arg)),
2143 __fbthrift_field_fieldP(std::move(fieldP__arg)),
2144 __fbthrift_field_fieldQ(std::move(fieldQ__arg)),
2145 __fbthrift_field_fieldR(std::move(fieldR__arg)) {
2146 __isset.set(folly::index_constant<0>(), true);
2147 __isset.set(folly::index_constant<1>(), true);
2148 __isset.set(folly::index_constant<2>(), true);
2149 __isset.set(folly::index_constant<3>(), true);
2150 __isset.set(folly::index_constant<4>(), true);
2151 __isset.set(folly::index_constant<5>(), true);
2152 __isset.set(folly::index_constant<6>(), true);
2153 __isset.set(folly::index_constant<7>(), true);
2154 __isset.set(folly::index_constant<8>(), true);
2155 __isset.set(folly::index_constant<9>(), true);
2156 __isset.set(folly::index_constant<10>(), true);
2157 __isset.set(folly::index_constant<11>(), true);
2158 __isset.set(folly::index_constant<12>(), true);
2159 __isset.set(folly::index_constant<13>(), true);
2160 __isset.set(folly::index_constant<14>(), true);
2161 __isset.set(folly::index_constant<15>(), true);
2162 __isset.set(folly::index_constant<16>(), true);
2163 __isset.set(folly::index_constant<17>(), true);
2164 }
2165
2166
__fbthrift_clear()2167 void struct3::__fbthrift_clear() {
2168 // clear all fields
2169 this->__fbthrift_field_fieldA = ::std::int32_t();
2170 this->__fbthrift_field_fieldB = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
2171 this->__fbthrift_field_fieldC = ::test_cpp2::cpp_reflection::enum1();
2172 this->__fbthrift_field_fieldD = ::test_cpp2::cpp_reflection::enum2();
2173 apache::thrift::clear(this->__fbthrift_field_fieldE);
2174 apache::thrift::clear(this->__fbthrift_field_fieldF);
2175 apache::thrift::clear(this->__fbthrift_field_fieldG);
2176 apache::thrift::clear(this->__fbthrift_field_fieldH);
2177 this->__fbthrift_field_fieldI.clear();
2178 this->__fbthrift_field_fieldJ.clear();
2179 this->__fbthrift_field_fieldK.clear();
2180 this->__fbthrift_field_fieldL.clear();
2181 this->__fbthrift_field_fieldM.clear();
2182 this->__fbthrift_field_fieldN.clear();
2183 this->__fbthrift_field_fieldO.clear();
2184 this->__fbthrift_field_fieldP.clear();
2185 this->__fbthrift_field_fieldQ.clear();
2186 this->__fbthrift_field_fieldR.clear();
2187 __isset = {};
2188 }
2189
operator ==(const struct3 & rhs) const2190 bool struct3::operator==(const struct3& rhs) const {
2191 (void)rhs;
2192 auto& lhs = *this;
2193 (void)lhs;
2194 if (!(lhs.fieldA_ref() == rhs.fieldA_ref())) {
2195 return false;
2196 }
2197 if (!(lhs.fieldB_ref() == rhs.fieldB_ref())) {
2198 return false;
2199 }
2200 if (!(lhs.fieldC_ref() == rhs.fieldC_ref())) {
2201 return false;
2202 }
2203 if (!(lhs.fieldD_ref() == rhs.fieldD_ref())) {
2204 return false;
2205 }
2206 if (!(lhs.fieldE_ref() == rhs.fieldE_ref())) {
2207 return false;
2208 }
2209 if (!(lhs.fieldF_ref() == rhs.fieldF_ref())) {
2210 return false;
2211 }
2212 if (!(lhs.fieldG_ref() == rhs.fieldG_ref())) {
2213 return false;
2214 }
2215 if (!(lhs.fieldH_ref() == rhs.fieldH_ref())) {
2216 return false;
2217 }
2218 if (!(lhs.fieldI_ref() == rhs.fieldI_ref())) {
2219 return false;
2220 }
2221 if (!(lhs.fieldJ_ref() == rhs.fieldJ_ref())) {
2222 return false;
2223 }
2224 if (!(lhs.fieldK_ref() == rhs.fieldK_ref())) {
2225 return false;
2226 }
2227 if (!(lhs.fieldL_ref() == rhs.fieldL_ref())) {
2228 return false;
2229 }
2230 if (!(lhs.fieldM_ref() == rhs.fieldM_ref())) {
2231 return false;
2232 }
2233 if (!(lhs.fieldN_ref() == rhs.fieldN_ref())) {
2234 return false;
2235 }
2236 if (!(lhs.fieldO_ref() == rhs.fieldO_ref())) {
2237 return false;
2238 }
2239 if (!(lhs.fieldP_ref() == rhs.fieldP_ref())) {
2240 return false;
2241 }
2242 if (!(lhs.fieldQ_ref() == rhs.fieldQ_ref())) {
2243 return false;
2244 }
2245 if (!(lhs.fieldR_ref() == rhs.fieldR_ref())) {
2246 return false;
2247 }
2248 return true;
2249 }
2250
operator <(const struct3 & rhs) const2251 bool struct3::operator<(const struct3& rhs) const {
2252 (void)rhs;
2253 auto& lhs = *this;
2254 (void)lhs;
2255 if (!(lhs.fieldA_ref() == rhs.fieldA_ref())) {
2256 return lhs.fieldA_ref() < rhs.fieldA_ref();
2257 }
2258 if (!(lhs.fieldB_ref() == rhs.fieldB_ref())) {
2259 return lhs.fieldB_ref() < rhs.fieldB_ref();
2260 }
2261 if (!(lhs.fieldC_ref() == rhs.fieldC_ref())) {
2262 return lhs.fieldC_ref() < rhs.fieldC_ref();
2263 }
2264 if (!(lhs.fieldD_ref() == rhs.fieldD_ref())) {
2265 return lhs.fieldD_ref() < rhs.fieldD_ref();
2266 }
2267 if (!(lhs.fieldE_ref() == rhs.fieldE_ref())) {
2268 return lhs.fieldE_ref() < rhs.fieldE_ref();
2269 }
2270 if (!(lhs.fieldF_ref() == rhs.fieldF_ref())) {
2271 return lhs.fieldF_ref() < rhs.fieldF_ref();
2272 }
2273 if (!(lhs.fieldG_ref() == rhs.fieldG_ref())) {
2274 return lhs.fieldG_ref() < rhs.fieldG_ref();
2275 }
2276 if (!(lhs.fieldH_ref() == rhs.fieldH_ref())) {
2277 return lhs.fieldH_ref() < rhs.fieldH_ref();
2278 }
2279 if (!(lhs.fieldI_ref() == rhs.fieldI_ref())) {
2280 return lhs.fieldI_ref() < rhs.fieldI_ref();
2281 }
2282 if (!(lhs.fieldJ_ref() == rhs.fieldJ_ref())) {
2283 return lhs.fieldJ_ref() < rhs.fieldJ_ref();
2284 }
2285 if (!(lhs.fieldK_ref() == rhs.fieldK_ref())) {
2286 return lhs.fieldK_ref() < rhs.fieldK_ref();
2287 }
2288 if (!(lhs.fieldL_ref() == rhs.fieldL_ref())) {
2289 return lhs.fieldL_ref() < rhs.fieldL_ref();
2290 }
2291 if (!(lhs.fieldM_ref() == rhs.fieldM_ref())) {
2292 return lhs.fieldM_ref() < rhs.fieldM_ref();
2293 }
2294 if (!(lhs.fieldN_ref() == rhs.fieldN_ref())) {
2295 return lhs.fieldN_ref() < rhs.fieldN_ref();
2296 }
2297 if (!(lhs.fieldO_ref() == rhs.fieldO_ref())) {
2298 return lhs.fieldO_ref() < rhs.fieldO_ref();
2299 }
2300 if (!(lhs.fieldP_ref() == rhs.fieldP_ref())) {
2301 return lhs.fieldP_ref() < rhs.fieldP_ref();
2302 }
2303 if (!(lhs.fieldQ_ref() == rhs.fieldQ_ref())) {
2304 return lhs.fieldQ_ref() < rhs.fieldQ_ref();
2305 }
2306 if (!(lhs.fieldR_ref() == rhs.fieldR_ref())) {
2307 return lhs.fieldR_ref() < rhs.fieldR_ref();
2308 }
2309 return false;
2310 }
2311
get_fieldE() const2312 const ::test_cpp2::cpp_reflection::union1& struct3::get_fieldE() const& {
2313 return __fbthrift_field_fieldE;
2314 }
2315
get_fieldE()2316 ::test_cpp2::cpp_reflection::union1 struct3::get_fieldE() && {
2317 return std::move(__fbthrift_field_fieldE);
2318 }
2319
get_fieldF() const2320 const ::test_cpp2::cpp_reflection::union2& struct3::get_fieldF() const& {
2321 return __fbthrift_field_fieldF;
2322 }
2323
get_fieldF()2324 ::test_cpp2::cpp_reflection::union2 struct3::get_fieldF() && {
2325 return std::move(__fbthrift_field_fieldF);
2326 }
2327
get_fieldG() const2328 const ::test_cpp2::cpp_reflection::struct1& struct3::get_fieldG() const& {
2329 return __fbthrift_field_fieldG;
2330 }
2331
get_fieldG()2332 ::test_cpp2::cpp_reflection::struct1 struct3::get_fieldG() && {
2333 return std::move(__fbthrift_field_fieldG);
2334 }
2335
get_fieldH() const2336 const ::test_cpp2::cpp_reflection::union2& struct3::get_fieldH() const& {
2337 return __fbthrift_field_fieldH;
2338 }
2339
get_fieldH()2340 ::test_cpp2::cpp_reflection::union2 struct3::get_fieldH() && {
2341 return std::move(__fbthrift_field_fieldH);
2342 }
2343
get_fieldI() const2344 const ::std::vector<::std::int32_t>& struct3::get_fieldI() const& {
2345 return __fbthrift_field_fieldI;
2346 }
2347
get_fieldI()2348 ::std::vector<::std::int32_t> struct3::get_fieldI() && {
2349 return std::move(__fbthrift_field_fieldI);
2350 }
2351
get_fieldJ() const2352 const ::std::vector<::std::string>& struct3::get_fieldJ() const& {
2353 return __fbthrift_field_fieldJ;
2354 }
2355
get_fieldJ()2356 ::std::vector<::std::string> struct3::get_fieldJ() && {
2357 return std::move(__fbthrift_field_fieldJ);
2358 }
2359
get_fieldK() const2360 const ::std::vector<::std::string>& struct3::get_fieldK() const& {
2361 return __fbthrift_field_fieldK;
2362 }
2363
get_fieldK()2364 ::std::vector<::std::string> struct3::get_fieldK() && {
2365 return std::move(__fbthrift_field_fieldK);
2366 }
2367
get_fieldL() const2368 const ::std::vector<::test_cpp2::cpp_reflection::structA>& struct3::get_fieldL() const& {
2369 return __fbthrift_field_fieldL;
2370 }
2371
get_fieldL()2372 ::std::vector<::test_cpp2::cpp_reflection::structA> struct3::get_fieldL() && {
2373 return std::move(__fbthrift_field_fieldL);
2374 }
2375
get_fieldM() const2376 const ::std::set<::std::int32_t>& struct3::get_fieldM() const& {
2377 return __fbthrift_field_fieldM;
2378 }
2379
get_fieldM()2380 ::std::set<::std::int32_t> struct3::get_fieldM() && {
2381 return std::move(__fbthrift_field_fieldM);
2382 }
2383
get_fieldN() const2384 const ::std::set<::std::string>& struct3::get_fieldN() const& {
2385 return __fbthrift_field_fieldN;
2386 }
2387
get_fieldN()2388 ::std::set<::std::string> struct3::get_fieldN() && {
2389 return std::move(__fbthrift_field_fieldN);
2390 }
2391
get_fieldO() const2392 const ::std::set<::std::string>& struct3::get_fieldO() const& {
2393 return __fbthrift_field_fieldO;
2394 }
2395
get_fieldO()2396 ::std::set<::std::string> struct3::get_fieldO() && {
2397 return std::move(__fbthrift_field_fieldO);
2398 }
2399
get_fieldP() const2400 const ::std::set<::test_cpp2::cpp_reflection::structB>& struct3::get_fieldP() const& {
2401 return __fbthrift_field_fieldP;
2402 }
2403
get_fieldP()2404 ::std::set<::test_cpp2::cpp_reflection::structB> struct3::get_fieldP() && {
2405 return std::move(__fbthrift_field_fieldP);
2406 }
2407
get_fieldQ() const2408 const ::std::map<::std::string, ::test_cpp2::cpp_reflection::structA>& struct3::get_fieldQ() const& {
2409 return __fbthrift_field_fieldQ;
2410 }
2411
get_fieldQ()2412 ::std::map<::std::string, ::test_cpp2::cpp_reflection::structA> struct3::get_fieldQ() && {
2413 return std::move(__fbthrift_field_fieldQ);
2414 }
2415
get_fieldR() const2416 const ::std::map<::std::string, ::test_cpp2::cpp_reflection::structB>& struct3::get_fieldR() const& {
2417 return __fbthrift_field_fieldR;
2418 }
2419
get_fieldR()2420 ::std::map<::std::string, ::test_cpp2::cpp_reflection::structB> struct3::get_fieldR() && {
2421 return std::move(__fbthrift_field_fieldR);
2422 }
2423
2424
swap(struct3 & a,struct3 & b)2425 void swap(struct3& a, struct3& b) {
2426 using ::std::swap;
2427 swap(a.fieldA_ref().value(), b.fieldA_ref().value());
2428 swap(a.fieldB_ref().value(), b.fieldB_ref().value());
2429 swap(a.fieldC_ref().value(), b.fieldC_ref().value());
2430 swap(a.fieldD_ref().value(), b.fieldD_ref().value());
2431 swap(a.fieldE_ref().value(), b.fieldE_ref().value());
2432 swap(a.fieldF_ref().value(), b.fieldF_ref().value());
2433 swap(a.fieldG_ref().value(), b.fieldG_ref().value());
2434 swap(a.fieldH_ref().value(), b.fieldH_ref().value());
2435 swap(a.fieldI_ref().value(), b.fieldI_ref().value());
2436 swap(a.fieldJ_ref().value(), b.fieldJ_ref().value());
2437 swap(a.fieldK_ref().value(), b.fieldK_ref().value());
2438 swap(a.fieldL_ref().value(), b.fieldL_ref().value());
2439 swap(a.fieldM_ref().value(), b.fieldM_ref().value());
2440 swap(a.fieldN_ref().value(), b.fieldN_ref().value());
2441 swap(a.fieldO_ref().value(), b.fieldO_ref().value());
2442 swap(a.fieldP_ref().value(), b.fieldP_ref().value());
2443 swap(a.fieldQ_ref().value(), b.fieldQ_ref().value());
2444 swap(a.fieldR_ref().value(), b.fieldR_ref().value());
2445 swap(a.__isset, b.__isset);
2446 }
2447
2448 template void struct3::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
2449 template uint32_t struct3::write<>(apache::thrift::BinaryProtocolWriter*) const;
2450 template uint32_t struct3::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
2451 template uint32_t struct3::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
2452 template void struct3::readNoXfer<>(apache::thrift::CompactProtocolReader*);
2453 template uint32_t struct3::write<>(apache::thrift::CompactProtocolWriter*) const;
2454 template uint32_t struct3::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
2455 template uint32_t struct3::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
2456
2457 static_assert(
2458 ::apache::thrift::detail::st::gen_check_json<
2459 struct3,
2460 ::apache::thrift::type_class::variant,
2461 ::test_cpp2::cpp_reflection::union1>,
2462 "inconsistent use of json option");
2463 static_assert(
2464 ::apache::thrift::detail::st::gen_check_json<
2465 struct3,
2466 ::apache::thrift::type_class::variant,
2467 ::test_cpp2::cpp_reflection::union2>,
2468 "inconsistent use of json option");
2469 static_assert(
2470 ::apache::thrift::detail::st::gen_check_json<
2471 struct3,
2472 ::apache::thrift::type_class::structure,
2473 ::test_cpp2::cpp_reflection::struct1>,
2474 "inconsistent use of json option");
2475 static_assert(
2476 ::apache::thrift::detail::st::gen_check_json<
2477 struct3,
2478 ::apache::thrift::type_class::variant,
2479 ::test_cpp2::cpp_reflection::union2>,
2480 "inconsistent use of json option");
2481 static_assert(
2482 ::apache::thrift::detail::st::gen_check_json<
2483 struct3,
2484 ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>,
2485 ::std::vector<::test_cpp2::cpp_reflection::structA>>,
2486 "inconsistent use of json option");
2487 static_assert(
2488 ::apache::thrift::detail::st::gen_check_json<
2489 struct3,
2490 ::apache::thrift::type_class::set<::apache::thrift::type_class::structure>,
2491 ::std::set<::test_cpp2::cpp_reflection::structB>>,
2492 "inconsistent use of json option");
2493 static_assert(
2494 ::apache::thrift::detail::st::gen_check_json<
2495 struct3,
2496 ::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::structure>,
2497 ::std::map<::std::string, ::test_cpp2::cpp_reflection::structA>>,
2498 "inconsistent use of json option");
2499 static_assert(
2500 ::apache::thrift::detail::st::gen_check_json<
2501 struct3,
2502 ::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::structure>,
2503 ::std::map<::std::string, ::test_cpp2::cpp_reflection::structB>>,
2504 "inconsistent use of json option");
2505
2506 static_assert(
2507 ::apache::thrift::detail::st::gen_check_nimble<
2508 struct3,
2509 ::apache::thrift::type_class::variant,
2510 ::test_cpp2::cpp_reflection::union1>,
2511 "inconsistent use of nimble option");
2512 static_assert(
2513 ::apache::thrift::detail::st::gen_check_nimble<
2514 struct3,
2515 ::apache::thrift::type_class::variant,
2516 ::test_cpp2::cpp_reflection::union2>,
2517 "inconsistent use of nimble option");
2518 static_assert(
2519 ::apache::thrift::detail::st::gen_check_nimble<
2520 struct3,
2521 ::apache::thrift::type_class::structure,
2522 ::test_cpp2::cpp_reflection::struct1>,
2523 "inconsistent use of nimble option");
2524 static_assert(
2525 ::apache::thrift::detail::st::gen_check_nimble<
2526 struct3,
2527 ::apache::thrift::type_class::variant,
2528 ::test_cpp2::cpp_reflection::union2>,
2529 "inconsistent use of nimble option");
2530 static_assert(
2531 ::apache::thrift::detail::st::gen_check_nimble<
2532 struct3,
2533 ::apache::thrift::type_class::list<::apache::thrift::type_class::structure>,
2534 ::std::vector<::test_cpp2::cpp_reflection::structA>>,
2535 "inconsistent use of nimble option");
2536 static_assert(
2537 ::apache::thrift::detail::st::gen_check_nimble<
2538 struct3,
2539 ::apache::thrift::type_class::set<::apache::thrift::type_class::structure>,
2540 ::std::set<::test_cpp2::cpp_reflection::structB>>,
2541 "inconsistent use of nimble option");
2542 static_assert(
2543 ::apache::thrift::detail::st::gen_check_nimble<
2544 struct3,
2545 ::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::structure>,
2546 ::std::map<::std::string, ::test_cpp2::cpp_reflection::structA>>,
2547 "inconsistent use of nimble option");
2548 static_assert(
2549 ::apache::thrift::detail::st::gen_check_nimble<
2550 struct3,
2551 ::apache::thrift::type_class::map<::apache::thrift::type_class::string, ::apache::thrift::type_class::structure>,
2552 ::std::map<::std::string, ::test_cpp2::cpp_reflection::structB>>,
2553 "inconsistent use of nimble option");
2554
2555 }} // test_cpp2::cpp_reflection
2556
2557 namespace apache {
2558 namespace thrift {
2559 namespace detail {
2560
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)2561 void TccStructTraits<::test_cpp2::cpp_reflection::struct4>::translateFieldName(
2562 folly::StringPiece _fname,
2563 int16_t& fid,
2564 apache::thrift::protocol::TType& _ftype) noexcept {
2565 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::struct4>;
2566 static const st::translate_field_name_table table{
2567 data::fields_size,
2568 data::fields_names.data(),
2569 data::fields_ids.data(),
2570 data::fields_types.data()};
2571 st::translate_field_name(_fname, fid, _ftype, table);
2572 }
2573
2574 } // namespace detail
2575 } // namespace thrift
2576 } // namespace apache
2577
2578 namespace test_cpp2 { namespace cpp_reflection {
2579
struct4(const struct4 & srcObj)2580 struct4::struct4(const struct4& srcObj) {
2581 field0 = srcObj.field0;
2582 __fbthrift_field_field1 = srcObj.__fbthrift_field_field1;
2583 __isset.set(0,srcObj.__isset.get(0));
2584 __fbthrift_field_field2 = srcObj.__fbthrift_field_field2;
2585 __isset.set(1,srcObj.__isset.get(1));
2586 field3 = ::apache::thrift::detail::st::copy_field<
2587 ::apache::thrift::type_class::structure>(srcObj.field3);
2588 }
2589
operator =(const struct4 & src)2590 struct4& struct4::operator=(const struct4& src) {
2591 struct4 tmp(src);
2592 swap(*this, tmp);
2593 return *this;
2594 }
2595
struct4(struct4 && other)2596 struct4::struct4(struct4&& other) noexcept :
2597 field0(std::move(other.field0)),
2598 __fbthrift_field_field1(std::move(other.__fbthrift_field_field1)),
2599 __fbthrift_field_field2(std::move(other.__fbthrift_field_field2)),
2600 field3(std::move(other.field3)),
2601 __isset(other.__isset) {
2602 }
2603
operator =(FOLLY_MAYBE_UNUSED struct4 && other)2604 struct4& struct4::operator=(FOLLY_MAYBE_UNUSED struct4&& other) noexcept {
2605 this->field0 = std::move(other.field0);
2606 this->__fbthrift_field_field1 = std::move(other.__fbthrift_field_field1);
2607 this->__fbthrift_field_field2 = std::move(other.__fbthrift_field_field2);
2608 this->field3 = std::move(other.field3);
2609 __isset = other.__isset;
2610 return *this;
2611 }
2612
2613
struct4(apache::thrift::FragileConstructor,::std::int32_t field0__arg,::std::string field1__arg,::test_cpp2::cpp_reflection::enum1 field2__arg,::std::unique_ptr<::test_cpp2::cpp_reflection::structA> field3__arg)2614 struct4::struct4(apache::thrift::FragileConstructor, ::std::int32_t field0__arg, ::std::string field1__arg, ::test_cpp2::cpp_reflection::enum1 field2__arg, ::std::unique_ptr<::test_cpp2::cpp_reflection::structA> field3__arg) :
2615 field0(std::move(field0__arg)),
2616 __fbthrift_field_field1(std::move(field1__arg)),
2617 __fbthrift_field_field2(std::move(field2__arg)),
2618 field3(std::move(field3__arg)) {
2619 __isset.set(folly::index_constant<0>(), true);
2620 __isset.set(folly::index_constant<1>(), true);
2621 }
2622
2623
__fbthrift_clear()2624 void struct4::__fbthrift_clear() {
2625 // clear all fields
2626 this->field0 = ::std::int32_t();
2627 this->__fbthrift_field_field1 = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
2628 this->__fbthrift_field_field2 = ::test_cpp2::cpp_reflection::enum1();
2629 if (this->field3) apache::thrift::clear(*this->field3);
2630 __isset = {};
2631 }
2632
operator ==(const struct4 & rhs) const2633 bool struct4::operator==(const struct4& rhs) const {
2634 (void)rhs;
2635 auto& lhs = *this;
2636 (void)lhs;
2637 if (!(lhs.field0_ref() == rhs.field0_ref())) {
2638 return false;
2639 }
2640 if (!(lhs.field1_ref() == rhs.field1_ref())) {
2641 return false;
2642 }
2643 if (!(lhs.field2_ref() == rhs.field2_ref())) {
2644 return false;
2645 }
2646 if ((!::apache::thrift::detail::pointer_equal(lhs.field3_ref(), rhs.field3_ref()))) {
2647 return false;
2648 }
2649 return true;
2650 }
2651
operator <(const struct4 & rhs) const2652 bool struct4::operator<(const struct4& rhs) const {
2653 (void)rhs;
2654 auto& lhs = *this;
2655 (void)lhs;
2656 if (!(lhs.field0_ref() == rhs.field0_ref())) {
2657 return lhs.field0_ref() < rhs.field0_ref();
2658 }
2659 if (!(lhs.field1_ref() == rhs.field1_ref())) {
2660 return lhs.field1_ref() < rhs.field1_ref();
2661 }
2662 if (!(lhs.field2_ref() == rhs.field2_ref())) {
2663 return lhs.field2_ref() < rhs.field2_ref();
2664 }
2665 if ((!::apache::thrift::detail::pointer_equal(lhs.field3_ref(), rhs.field3_ref()))) {
2666 return ::apache::thrift::detail::pointer_less(lhs.field3_ref(), rhs.field3_ref());
2667 }
2668 return false;
2669 }
2670
2671
swap(struct4 & a,struct4 & b)2672 void swap(struct4& a, struct4& b) {
2673 using ::std::swap;
2674 swap(a.field0_ref().value(), b.field0_ref().value());
2675 swap(a.field1_ref().value_unchecked(), b.field1_ref().value_unchecked());
2676 swap(a.field2_ref().value(), b.field2_ref().value());
2677 swap(a.field3, b.field3);
2678 swap(a.__isset, b.__isset);
2679 }
2680
2681 template void struct4::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
2682 template uint32_t struct4::write<>(apache::thrift::BinaryProtocolWriter*) const;
2683 template uint32_t struct4::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
2684 template uint32_t struct4::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
2685 template void struct4::readNoXfer<>(apache::thrift::CompactProtocolReader*);
2686 template uint32_t struct4::write<>(apache::thrift::CompactProtocolWriter*) const;
2687 template uint32_t struct4::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
2688 template uint32_t struct4::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
2689
2690 static_assert(
2691 ::apache::thrift::detail::st::gen_check_json<
2692 struct4,
2693 ::apache::thrift::type_class::structure,
2694 ::test_cpp2::cpp_reflection::structA>,
2695 "inconsistent use of json option");
2696
2697 static_assert(
2698 ::apache::thrift::detail::st::gen_check_nimble<
2699 struct4,
2700 ::apache::thrift::type_class::structure,
2701 ::test_cpp2::cpp_reflection::structA>,
2702 "inconsistent use of nimble option");
2703
2704 }} // test_cpp2::cpp_reflection
2705
2706 namespace apache {
2707 namespace thrift {
2708 namespace detail {
2709
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)2710 void TccStructTraits<::test_cpp2::cpp_reflection::struct5>::translateFieldName(
2711 folly::StringPiece _fname,
2712 int16_t& fid,
2713 apache::thrift::protocol::TType& _ftype) noexcept {
2714 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::struct5>;
2715 static const st::translate_field_name_table table{
2716 data::fields_size,
2717 data::fields_names.data(),
2718 data::fields_ids.data(),
2719 data::fields_types.data()};
2720 st::translate_field_name(_fname, fid, _ftype, table);
2721 }
2722
2723 } // namespace detail
2724 } // namespace thrift
2725 } // namespace apache
2726
2727 namespace test_cpp2 { namespace cpp_reflection {
2728
2729 struct5::struct5(const struct5&) = default;
2730 struct5& struct5::operator=(const struct5&) = default;
struct5()2731 struct5::struct5() :
2732 field0(),
2733 __fbthrift_field_field2() {
2734 }
2735
2736
~struct5()2737 struct5::~struct5() {}
2738
struct5(struct5 && other)2739 struct5::struct5(struct5&& other) noexcept :
2740 field0(std::move(other.field0)),
2741 __fbthrift_field_field1(std::move(other.__fbthrift_field_field1)),
2742 __fbthrift_field_field2(std::move(other.__fbthrift_field_field2)),
2743 __fbthrift_field_field3(std::move(other.__fbthrift_field_field3)),
2744 __fbthrift_field_field4(std::move(other.__fbthrift_field_field4)),
2745 __isset(other.__isset) {
2746 }
2747
operator =(FOLLY_MAYBE_UNUSED struct5 && other)2748 struct5& struct5::operator=(FOLLY_MAYBE_UNUSED struct5&& other) noexcept {
2749 this->field0 = std::move(other.field0);
2750 this->__fbthrift_field_field1 = std::move(other.__fbthrift_field_field1);
2751 this->__fbthrift_field_field2 = std::move(other.__fbthrift_field_field2);
2752 this->__fbthrift_field_field3 = std::move(other.__fbthrift_field_field3);
2753 this->__fbthrift_field_field4 = std::move(other.__fbthrift_field_field4);
2754 __isset = other.__isset;
2755 return *this;
2756 }
2757
2758
struct5(apache::thrift::FragileConstructor,::std::int32_t field0__arg,::std::string field1__arg,::test_cpp2::cpp_reflection::enum1 field2__arg,::test_cpp2::cpp_reflection::structA field3__arg,::test_cpp2::cpp_reflection::structB field4__arg)2759 struct5::struct5(apache::thrift::FragileConstructor, ::std::int32_t field0__arg, ::std::string field1__arg, ::test_cpp2::cpp_reflection::enum1 field2__arg, ::test_cpp2::cpp_reflection::structA field3__arg, ::test_cpp2::cpp_reflection::structB field4__arg) :
2760 field0(std::move(field0__arg)),
2761 __fbthrift_field_field1(std::move(field1__arg)),
2762 __fbthrift_field_field2(std::move(field2__arg)),
2763 __fbthrift_field_field3(std::move(field3__arg)),
2764 __fbthrift_field_field4(std::move(field4__arg)) {
2765 __isset.set(folly::index_constant<0>(), true);
2766 __isset.set(folly::index_constant<1>(), true);
2767 __isset.set(folly::index_constant<2>(), true);
2768 __isset.set(folly::index_constant<3>(), true);
2769 }
2770
2771
__fbthrift_clear()2772 void struct5::__fbthrift_clear() {
2773 // clear all fields
2774 this->field0 = ::std::int32_t();
2775 this->__fbthrift_field_field1 = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
2776 this->__fbthrift_field_field2 = ::test_cpp2::cpp_reflection::enum1();
2777 apache::thrift::clear(this->__fbthrift_field_field3);
2778 apache::thrift::clear(this->__fbthrift_field_field4);
2779 __isset = {};
2780 }
2781
operator ==(const struct5 & rhs) const2782 bool struct5::operator==(const struct5& rhs) const {
2783 (void)rhs;
2784 auto& lhs = *this;
2785 (void)lhs;
2786 if (!(lhs.field0_ref() == rhs.field0_ref())) {
2787 return false;
2788 }
2789 if (!(lhs.field1_ref() == rhs.field1_ref())) {
2790 return false;
2791 }
2792 if (!(lhs.field2_ref() == rhs.field2_ref())) {
2793 return false;
2794 }
2795 if (!(lhs.field3_ref() == rhs.field3_ref())) {
2796 return false;
2797 }
2798 if (!(lhs.field4_ref() == rhs.field4_ref())) {
2799 return false;
2800 }
2801 return true;
2802 }
2803
operator <(const struct5 & rhs) const2804 bool struct5::operator<(const struct5& rhs) const {
2805 (void)rhs;
2806 auto& lhs = *this;
2807 (void)lhs;
2808 if (!(lhs.field0_ref() == rhs.field0_ref())) {
2809 return lhs.field0_ref() < rhs.field0_ref();
2810 }
2811 if (!(lhs.field1_ref() == rhs.field1_ref())) {
2812 return lhs.field1_ref() < rhs.field1_ref();
2813 }
2814 if (!(lhs.field2_ref() == rhs.field2_ref())) {
2815 return lhs.field2_ref() < rhs.field2_ref();
2816 }
2817 if (!(lhs.field3_ref() == rhs.field3_ref())) {
2818 return lhs.field3_ref() < rhs.field3_ref();
2819 }
2820 if (!(lhs.field4_ref() == rhs.field4_ref())) {
2821 return lhs.field4_ref() < rhs.field4_ref();
2822 }
2823 return false;
2824 }
2825
get_field3() const2826 const ::test_cpp2::cpp_reflection::structA& struct5::get_field3() const& {
2827 return __fbthrift_field_field3;
2828 }
2829
get_field3()2830 ::test_cpp2::cpp_reflection::structA struct5::get_field3() && {
2831 return std::move(__fbthrift_field_field3);
2832 }
2833
get_field4() const2834 const ::test_cpp2::cpp_reflection::structB& struct5::get_field4() const& {
2835 return __fbthrift_field_field4;
2836 }
2837
get_field4()2838 ::test_cpp2::cpp_reflection::structB struct5::get_field4() && {
2839 return std::move(__fbthrift_field_field4);
2840 }
2841
2842
swap(struct5 & a,struct5 & b)2843 void swap(struct5& a, struct5& b) {
2844 using ::std::swap;
2845 swap(a.field0_ref().value(), b.field0_ref().value());
2846 swap(a.field1_ref().value_unchecked(), b.field1_ref().value_unchecked());
2847 swap(a.field2_ref().value(), b.field2_ref().value());
2848 swap(a.field3_ref().value(), b.field3_ref().value());
2849 swap(a.field4_ref().value(), b.field4_ref().value());
2850 swap(a.__isset, b.__isset);
2851 }
2852
2853 template void struct5::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
2854 template uint32_t struct5::write<>(apache::thrift::BinaryProtocolWriter*) const;
2855 template uint32_t struct5::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
2856 template uint32_t struct5::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
2857 template void struct5::readNoXfer<>(apache::thrift::CompactProtocolReader*);
2858 template uint32_t struct5::write<>(apache::thrift::CompactProtocolWriter*) const;
2859 template uint32_t struct5::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
2860 template uint32_t struct5::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
2861
2862 static_assert(
2863 ::apache::thrift::detail::st::gen_check_json<
2864 struct5,
2865 ::apache::thrift::type_class::structure,
2866 ::test_cpp2::cpp_reflection::structA>,
2867 "inconsistent use of json option");
2868 static_assert(
2869 ::apache::thrift::detail::st::gen_check_json<
2870 struct5,
2871 ::apache::thrift::type_class::structure,
2872 ::test_cpp2::cpp_reflection::structB>,
2873 "inconsistent use of json option");
2874
2875 static_assert(
2876 ::apache::thrift::detail::st::gen_check_nimble<
2877 struct5,
2878 ::apache::thrift::type_class::structure,
2879 ::test_cpp2::cpp_reflection::structA>,
2880 "inconsistent use of nimble option");
2881 static_assert(
2882 ::apache::thrift::detail::st::gen_check_nimble<
2883 struct5,
2884 ::apache::thrift::type_class::structure,
2885 ::test_cpp2::cpp_reflection::structB>,
2886 "inconsistent use of nimble option");
2887
2888 }} // test_cpp2::cpp_reflection
2889
2890 namespace apache {
2891 namespace thrift {
2892 namespace detail {
2893
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)2894 void TccStructTraits<::test_cpp2::cpp_reflection::struct_binary>::translateFieldName(
2895 folly::StringPiece _fname,
2896 int16_t& fid,
2897 apache::thrift::protocol::TType& _ftype) noexcept {
2898 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::struct_binary>;
2899 static const st::translate_field_name_table table{
2900 data::fields_size,
2901 data::fields_names.data(),
2902 data::fields_ids.data(),
2903 data::fields_types.data()};
2904 st::translate_field_name(_fname, fid, _ftype, table);
2905 }
2906
2907 } // namespace detail
2908 } // namespace thrift
2909 } // namespace apache
2910
2911 namespace test_cpp2 { namespace cpp_reflection {
2912
2913 struct_binary::struct_binary(const struct_binary&) = default;
2914 struct_binary& struct_binary::operator=(const struct_binary&) = default;
struct_binary(struct_binary && other)2915 struct_binary::struct_binary(struct_binary&& other) noexcept :
2916 __fbthrift_field_bi(std::move(other.__fbthrift_field_bi)),
2917 __isset(other.__isset) {
2918 }
2919
operator =(FOLLY_MAYBE_UNUSED struct_binary && other)2920 struct_binary& struct_binary::operator=(FOLLY_MAYBE_UNUSED struct_binary&& other) noexcept {
2921 this->__fbthrift_field_bi = std::move(other.__fbthrift_field_bi);
2922 __isset = other.__isset;
2923 return *this;
2924 }
2925
2926
struct_binary(apache::thrift::FragileConstructor,::std::string bi__arg)2927 struct_binary::struct_binary(apache::thrift::FragileConstructor, ::std::string bi__arg) :
2928 __fbthrift_field_bi(std::move(bi__arg)) {
2929 __isset.set(folly::index_constant<0>(), true);
2930 }
2931
2932
__fbthrift_clear()2933 void struct_binary::__fbthrift_clear() {
2934 // clear all fields
2935 this->__fbthrift_field_bi = apache::thrift::StringTraits<std::string>::fromStringLiteral("");
2936 __isset = {};
2937 }
2938
operator ==(const struct_binary & rhs) const2939 bool struct_binary::operator==(const struct_binary& rhs) const {
2940 (void)rhs;
2941 auto& lhs = *this;
2942 (void)lhs;
2943 if (!apache::thrift::StringTraits<std::string>::isEqual(lhs.__fbthrift_field_bi, rhs.__fbthrift_field_bi)) {
2944 return false;
2945 }
2946 return true;
2947 }
2948
operator <(const struct_binary & rhs) const2949 bool struct_binary::operator<(const struct_binary& rhs) const {
2950 (void)rhs;
2951 auto& lhs = *this;
2952 (void)lhs;
2953 if (!apache::thrift::StringTraits<std::string>::isEqual(lhs.__fbthrift_field_bi, rhs.__fbthrift_field_bi)) {
2954 return apache::thrift::StringTraits<std::string>::isLess(lhs.__fbthrift_field_bi, rhs.__fbthrift_field_bi);
2955 }
2956 return false;
2957 }
2958
2959
swap(struct_binary & a,struct_binary & b)2960 void swap(struct_binary& a, struct_binary& b) {
2961 using ::std::swap;
2962 swap(a.bi_ref().value(), b.bi_ref().value());
2963 swap(a.__isset, b.__isset);
2964 }
2965
2966 template void struct_binary::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
2967 template uint32_t struct_binary::write<>(apache::thrift::BinaryProtocolWriter*) const;
2968 template uint32_t struct_binary::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
2969 template uint32_t struct_binary::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
2970 template void struct_binary::readNoXfer<>(apache::thrift::CompactProtocolReader*);
2971 template uint32_t struct_binary::write<>(apache::thrift::CompactProtocolWriter*) const;
2972 template uint32_t struct_binary::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
2973 template uint32_t struct_binary::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
2974
2975
2976
2977 }} // test_cpp2::cpp_reflection
2978
2979 namespace apache {
2980 namespace thrift {
2981 namespace detail {
2982
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)2983 void TccStructTraits<::test_cpp2::cpp_reflection::dep_A_struct>::translateFieldName(
2984 folly::StringPiece _fname,
2985 int16_t& fid,
2986 apache::thrift::protocol::TType& _ftype) noexcept {
2987 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::dep_A_struct>;
2988 static const st::translate_field_name_table table{
2989 data::fields_size,
2990 data::fields_names.data(),
2991 data::fields_ids.data(),
2992 data::fields_types.data()};
2993 st::translate_field_name(_fname, fid, _ftype, table);
2994 }
2995
2996 } // namespace detail
2997 } // namespace thrift
2998 } // namespace apache
2999
3000 namespace test_cpp2 { namespace cpp_reflection {
3001
3002
dep_A_struct(apache::thrift::FragileConstructor,::test_cpp2::cpp_reflection::dep_B_struct b__arg,::test_cpp2::cpp_reflection::dep_C_struct c__arg,::std::int32_t i_a__arg)3003 dep_A_struct::dep_A_struct(apache::thrift::FragileConstructor, ::test_cpp2::cpp_reflection::dep_B_struct b__arg, ::test_cpp2::cpp_reflection::dep_C_struct c__arg, ::std::int32_t i_a__arg) :
3004 __fbthrift_field_b(std::move(b__arg)),
3005 __fbthrift_field_c(std::move(c__arg)),
3006 __fbthrift_field_i_a(std::move(i_a__arg)) {
3007 __isset.set(folly::index_constant<0>(), true);
3008 __isset.set(folly::index_constant<1>(), true);
3009 __isset.set(folly::index_constant<2>(), true);
3010 }
3011
3012
__fbthrift_clear()3013 void dep_A_struct::__fbthrift_clear() {
3014 // clear all fields
3015 apache::thrift::clear(this->__fbthrift_field_b);
3016 apache::thrift::clear(this->__fbthrift_field_c);
3017 this->__fbthrift_field_i_a = ::std::int32_t();
3018 __isset = {};
3019 }
3020
operator ==(const dep_A_struct & rhs) const3021 bool dep_A_struct::operator==(const dep_A_struct& rhs) const {
3022 (void)rhs;
3023 auto& lhs = *this;
3024 (void)lhs;
3025 if (!(lhs.b_ref() == rhs.b_ref())) {
3026 return false;
3027 }
3028 if (!(lhs.c_ref() == rhs.c_ref())) {
3029 return false;
3030 }
3031 if (!(lhs.i_a_ref() == rhs.i_a_ref())) {
3032 return false;
3033 }
3034 return true;
3035 }
3036
operator <(const dep_A_struct & rhs) const3037 bool dep_A_struct::operator<(const dep_A_struct& rhs) const {
3038 (void)rhs;
3039 auto& lhs = *this;
3040 (void)lhs;
3041 if (!(lhs.b_ref() == rhs.b_ref())) {
3042 return lhs.b_ref() < rhs.b_ref();
3043 }
3044 if (!(lhs.c_ref() == rhs.c_ref())) {
3045 return lhs.c_ref() < rhs.c_ref();
3046 }
3047 if (!(lhs.i_a_ref() == rhs.i_a_ref())) {
3048 return lhs.i_a_ref() < rhs.i_a_ref();
3049 }
3050 return false;
3051 }
3052
get_b() const3053 const ::test_cpp2::cpp_reflection::dep_B_struct& dep_A_struct::get_b() const& {
3054 return __fbthrift_field_b;
3055 }
3056
get_b()3057 ::test_cpp2::cpp_reflection::dep_B_struct dep_A_struct::get_b() && {
3058 return std::move(__fbthrift_field_b);
3059 }
3060
get_c() const3061 const ::test_cpp2::cpp_reflection::dep_C_struct& dep_A_struct::get_c() const& {
3062 return __fbthrift_field_c;
3063 }
3064
get_c()3065 ::test_cpp2::cpp_reflection::dep_C_struct dep_A_struct::get_c() && {
3066 return std::move(__fbthrift_field_c);
3067 }
3068
3069
swap(dep_A_struct & a,dep_A_struct & b)3070 void swap(dep_A_struct& a, dep_A_struct& b) {
3071 using ::std::swap;
3072 swap(a.b_ref().value(), b.b_ref().value());
3073 swap(a.c_ref().value(), b.c_ref().value());
3074 swap(a.i_a_ref().value(), b.i_a_ref().value());
3075 swap(a.__isset, b.__isset);
3076 }
3077
3078 template void dep_A_struct::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
3079 template uint32_t dep_A_struct::write<>(apache::thrift::BinaryProtocolWriter*) const;
3080 template uint32_t dep_A_struct::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
3081 template uint32_t dep_A_struct::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
3082 template void dep_A_struct::readNoXfer<>(apache::thrift::CompactProtocolReader*);
3083 template uint32_t dep_A_struct::write<>(apache::thrift::CompactProtocolWriter*) const;
3084 template uint32_t dep_A_struct::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
3085 template uint32_t dep_A_struct::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
3086
3087 static_assert(
3088 ::apache::thrift::detail::st::gen_check_json<
3089 dep_A_struct,
3090 ::apache::thrift::type_class::structure,
3091 ::test_cpp2::cpp_reflection::dep_B_struct>,
3092 "inconsistent use of json option");
3093 static_assert(
3094 ::apache::thrift::detail::st::gen_check_json<
3095 dep_A_struct,
3096 ::apache::thrift::type_class::structure,
3097 ::test_cpp2::cpp_reflection::dep_C_struct>,
3098 "inconsistent use of json option");
3099
3100 static_assert(
3101 ::apache::thrift::detail::st::gen_check_nimble<
3102 dep_A_struct,
3103 ::apache::thrift::type_class::structure,
3104 ::test_cpp2::cpp_reflection::dep_B_struct>,
3105 "inconsistent use of nimble option");
3106 static_assert(
3107 ::apache::thrift::detail::st::gen_check_nimble<
3108 dep_A_struct,
3109 ::apache::thrift::type_class::structure,
3110 ::test_cpp2::cpp_reflection::dep_C_struct>,
3111 "inconsistent use of nimble option");
3112
3113 }} // test_cpp2::cpp_reflection
3114
3115 namespace apache {
3116 namespace thrift {
3117 namespace detail {
3118
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)3119 void TccStructTraits<::test_cpp2::cpp_reflection::dep_B_struct>::translateFieldName(
3120 folly::StringPiece _fname,
3121 int16_t& fid,
3122 apache::thrift::protocol::TType& _ftype) noexcept {
3123 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::dep_B_struct>;
3124 static const st::translate_field_name_table table{
3125 data::fields_size,
3126 data::fields_names.data(),
3127 data::fields_ids.data(),
3128 data::fields_types.data()};
3129 st::translate_field_name(_fname, fid, _ftype, table);
3130 }
3131
3132 } // namespace detail
3133 } // namespace thrift
3134 } // namespace apache
3135
3136 namespace test_cpp2 { namespace cpp_reflection {
3137
3138
dep_B_struct(apache::thrift::FragileConstructor,::test_cpp2::cpp_reflection::dep_B_struct b__arg,::test_cpp2::cpp_reflection::dep_C_struct c__arg,::std::int32_t i_a__arg)3139 dep_B_struct::dep_B_struct(apache::thrift::FragileConstructor, ::test_cpp2::cpp_reflection::dep_B_struct b__arg, ::test_cpp2::cpp_reflection::dep_C_struct c__arg, ::std::int32_t i_a__arg) :
3140 __fbthrift_field_b(std::move(b__arg)),
3141 __fbthrift_field_c(std::move(c__arg)),
3142 __fbthrift_field_i_a(std::move(i_a__arg)) {
3143 __isset.set(folly::index_constant<0>(), true);
3144 __isset.set(folly::index_constant<1>(), true);
3145 __isset.set(folly::index_constant<2>(), true);
3146 }
3147
3148
__fbthrift_clear()3149 void dep_B_struct::__fbthrift_clear() {
3150 // clear all fields
3151 apache::thrift::clear(this->__fbthrift_field_b);
3152 apache::thrift::clear(this->__fbthrift_field_c);
3153 this->__fbthrift_field_i_a = ::std::int32_t();
3154 __isset = {};
3155 }
3156
operator ==(const dep_B_struct & rhs) const3157 bool dep_B_struct::operator==(const dep_B_struct& rhs) const {
3158 (void)rhs;
3159 auto& lhs = *this;
3160 (void)lhs;
3161 if (!(lhs.b_ref() == rhs.b_ref())) {
3162 return false;
3163 }
3164 if (!(lhs.c_ref() == rhs.c_ref())) {
3165 return false;
3166 }
3167 if (!(lhs.i_a_ref() == rhs.i_a_ref())) {
3168 return false;
3169 }
3170 return true;
3171 }
3172
operator <(const dep_B_struct & rhs) const3173 bool dep_B_struct::operator<(const dep_B_struct& rhs) const {
3174 (void)rhs;
3175 auto& lhs = *this;
3176 (void)lhs;
3177 if (!(lhs.b_ref() == rhs.b_ref())) {
3178 return lhs.b_ref() < rhs.b_ref();
3179 }
3180 if (!(lhs.c_ref() == rhs.c_ref())) {
3181 return lhs.c_ref() < rhs.c_ref();
3182 }
3183 if (!(lhs.i_a_ref() == rhs.i_a_ref())) {
3184 return lhs.i_a_ref() < rhs.i_a_ref();
3185 }
3186 return false;
3187 }
3188
get_b() const3189 const ::test_cpp2::cpp_reflection::dep_B_struct& dep_B_struct::get_b() const& {
3190 return __fbthrift_field_b;
3191 }
3192
get_b()3193 ::test_cpp2::cpp_reflection::dep_B_struct dep_B_struct::get_b() && {
3194 return std::move(__fbthrift_field_b);
3195 }
3196
get_c() const3197 const ::test_cpp2::cpp_reflection::dep_C_struct& dep_B_struct::get_c() const& {
3198 return __fbthrift_field_c;
3199 }
3200
get_c()3201 ::test_cpp2::cpp_reflection::dep_C_struct dep_B_struct::get_c() && {
3202 return std::move(__fbthrift_field_c);
3203 }
3204
3205
swap(dep_B_struct & a,dep_B_struct & b)3206 void swap(dep_B_struct& a, dep_B_struct& b) {
3207 using ::std::swap;
3208 swap(a.b_ref().value(), b.b_ref().value());
3209 swap(a.c_ref().value(), b.c_ref().value());
3210 swap(a.i_a_ref().value(), b.i_a_ref().value());
3211 swap(a.__isset, b.__isset);
3212 }
3213
3214 template void dep_B_struct::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
3215 template uint32_t dep_B_struct::write<>(apache::thrift::BinaryProtocolWriter*) const;
3216 template uint32_t dep_B_struct::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
3217 template uint32_t dep_B_struct::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
3218 template void dep_B_struct::readNoXfer<>(apache::thrift::CompactProtocolReader*);
3219 template uint32_t dep_B_struct::write<>(apache::thrift::CompactProtocolWriter*) const;
3220 template uint32_t dep_B_struct::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
3221 template uint32_t dep_B_struct::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
3222
3223 static_assert(
3224 ::apache::thrift::detail::st::gen_check_json<
3225 dep_B_struct,
3226 ::apache::thrift::type_class::structure,
3227 ::test_cpp2::cpp_reflection::dep_B_struct>,
3228 "inconsistent use of json option");
3229 static_assert(
3230 ::apache::thrift::detail::st::gen_check_json<
3231 dep_B_struct,
3232 ::apache::thrift::type_class::structure,
3233 ::test_cpp2::cpp_reflection::dep_C_struct>,
3234 "inconsistent use of json option");
3235
3236 static_assert(
3237 ::apache::thrift::detail::st::gen_check_nimble<
3238 dep_B_struct,
3239 ::apache::thrift::type_class::structure,
3240 ::test_cpp2::cpp_reflection::dep_B_struct>,
3241 "inconsistent use of nimble option");
3242 static_assert(
3243 ::apache::thrift::detail::st::gen_check_nimble<
3244 dep_B_struct,
3245 ::apache::thrift::type_class::structure,
3246 ::test_cpp2::cpp_reflection::dep_C_struct>,
3247 "inconsistent use of nimble option");
3248
3249 }} // test_cpp2::cpp_reflection
3250
3251 namespace apache {
3252 namespace thrift {
3253 namespace detail {
3254
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)3255 void TccStructTraits<::test_cpp2::cpp_reflection::annotated>::translateFieldName(
3256 folly::StringPiece _fname,
3257 int16_t& fid,
3258 apache::thrift::protocol::TType& _ftype) noexcept {
3259 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::annotated>;
3260 static const st::translate_field_name_table table{
3261 data::fields_size,
3262 data::fields_names.data(),
3263 data::fields_ids.data(),
3264 data::fields_types.data()};
3265 st::translate_field_name(_fname, fid, _ftype, table);
3266 }
3267
3268 } // namespace detail
3269 } // namespace thrift
3270 } // namespace apache
3271
3272 namespace test_cpp2 { namespace cpp_reflection {
3273
3274
annotated(apache::thrift::FragileConstructor,::std::int32_t a__arg)3275 annotated::annotated(apache::thrift::FragileConstructor, ::std::int32_t a__arg) :
3276 __fbthrift_field_a(std::move(a__arg)) {
3277 __isset.set(folly::index_constant<0>(), true);
3278 }
3279
3280
__fbthrift_clear()3281 void annotated::__fbthrift_clear() {
3282 // clear all fields
3283 this->__fbthrift_field_a = ::std::int32_t();
3284 __isset = {};
3285 }
3286
operator ==(const annotated & rhs) const3287 bool annotated::operator==(const annotated& rhs) const {
3288 (void)rhs;
3289 auto& lhs = *this;
3290 (void)lhs;
3291 if (!(lhs.a_ref() == rhs.a_ref())) {
3292 return false;
3293 }
3294 return true;
3295 }
3296
operator <(const annotated & rhs) const3297 bool annotated::operator<(const annotated& rhs) const {
3298 (void)rhs;
3299 auto& lhs = *this;
3300 (void)lhs;
3301 if (!(lhs.a_ref() == rhs.a_ref())) {
3302 return lhs.a_ref() < rhs.a_ref();
3303 }
3304 return false;
3305 }
3306
3307
swap(annotated & a,annotated & b)3308 void swap(annotated& a, annotated& b) {
3309 using ::std::swap;
3310 swap(a.a_ref().value(), b.a_ref().value());
3311 swap(a.__isset, b.__isset);
3312 }
3313
3314 template void annotated::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
3315 template uint32_t annotated::write<>(apache::thrift::BinaryProtocolWriter*) const;
3316 template uint32_t annotated::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
3317 template uint32_t annotated::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
3318 template void annotated::readNoXfer<>(apache::thrift::CompactProtocolReader*);
3319 template uint32_t annotated::write<>(apache::thrift::CompactProtocolWriter*) const;
3320 template uint32_t annotated::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
3321 template uint32_t annotated::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
3322
3323
3324
3325 }} // test_cpp2::cpp_reflection
3326
3327 namespace apache {
3328 namespace thrift {
3329 namespace detail {
3330
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)3331 void TccStructTraits<::test_cpp2::cpp_reflection::union_with_special_names>::translateFieldName(
3332 folly::StringPiece _fname,
3333 int16_t& fid,
3334 apache::thrift::protocol::TType& _ftype) noexcept {
3335 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::union_with_special_names>;
3336 static const st::translate_field_name_table table{
3337 data::fields_size,
3338 data::fields_names.data(),
3339 data::fields_ids.data(),
3340 data::fields_types.data()};
3341 st::translate_field_name(_fname, fid, _ftype, table);
3342 }
3343
3344 } // namespace detail
3345 } // namespace thrift
3346 } // namespace apache
3347
3348 namespace apache { namespace thrift {
3349
3350 constexpr std::size_t const TEnumTraits<::test_cpp2::cpp_reflection::union_with_special_names::Type>::size;
3351 folly::Range<::test_cpp2::cpp_reflection::union_with_special_names::Type const*> const TEnumTraits<::test_cpp2::cpp_reflection::union_with_special_names::Type>::values = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::union_with_special_names::Type>::values);
3352 folly::Range<folly::StringPiece const*> const TEnumTraits<::test_cpp2::cpp_reflection::union_with_special_names::Type>::names = folly::range(TEnumDataStorage<::test_cpp2::cpp_reflection::union_with_special_names::Type>::names);
3353
findName(type value)3354 char const* TEnumTraits<::test_cpp2::cpp_reflection::union_with_special_names::Type>::findName(type value) {
3355 using factory = detail::TEnumMapFactory<::test_cpp2::cpp_reflection::union_with_special_names::Type>;
3356 static folly::Indestructible<factory::ValuesToNamesMapType> const map{
3357 factory::makeValuesToNamesMap()};
3358 auto found = map->find(value);
3359 return found == map->end() ? nullptr : found->second;
3360 }
3361
findValue(char const * name,type * out)3362 bool TEnumTraits<::test_cpp2::cpp_reflection::union_with_special_names::Type>::findValue(char const* name, type* out) {
3363 using factory = detail::TEnumMapFactory<::test_cpp2::cpp_reflection::union_with_special_names::Type>;
3364 static folly::Indestructible<factory::NamesToValuesMapType> const map{
3365 factory::makeNamesToValuesMap()};
3366 auto found = map->find(name);
3367 return found == map->end() ? false : (*out = found->second, true);
3368 }
3369 }} // apache::thrift
3370 namespace test_cpp2 { namespace cpp_reflection {
3371
__fbthrift_clear()3372 void union_with_special_names::__fbthrift_clear() {
3373 // clear all fields
3374 if (type_ == Type::__EMPTY__) { return; }
3375 switch(type_) {
3376 case Type::get:
3377 destruct(value_.get);
3378 break;
3379 case Type::getter:
3380 destruct(value_.getter);
3381 break;
3382 case Type::lists:
3383 destruct(value_.lists);
3384 break;
3385 case Type::maps:
3386 destruct(value_.maps);
3387 break;
3388 case Type::name:
3389 destruct(value_.name);
3390 break;
3391 case Type::name_to_value:
3392 destruct(value_.name_to_value);
3393 break;
3394 case Type::names:
3395 destruct(value_.names);
3396 break;
3397 case Type::prefix_tree:
3398 destruct(value_.prefix_tree);
3399 break;
3400 case Type::sets:
3401 destruct(value_.sets);
3402 break;
3403 case Type::setter:
3404 destruct(value_.setter);
3405 break;
3406 case Type::str:
3407 destruct(value_.str);
3408 break;
3409 case Type::strings:
3410 destruct(value_.strings);
3411 break;
3412 case Type::type:
3413 destruct(value_.type);
3414 break;
3415 case Type::value:
3416 destruct(value_.value);
3417 break;
3418 case Type::value_to_name:
3419 destruct(value_.value_to_name);
3420 break;
3421 case Type::values:
3422 destruct(value_.values);
3423 break;
3424 case Type::id:
3425 destruct(value_.id);
3426 break;
3427 case Type::ids:
3428 destruct(value_.ids);
3429 break;
3430 case Type::descriptor:
3431 destruct(value_.descriptor);
3432 break;
3433 case Type::descriptors:
3434 destruct(value_.descriptors);
3435 break;
3436 case Type::key:
3437 destruct(value_.key);
3438 break;
3439 case Type::keys:
3440 destruct(value_.keys);
3441 break;
3442 case Type::annotation:
3443 destruct(value_.annotation);
3444 break;
3445 case Type::annotations:
3446 destruct(value_.annotations);
3447 break;
3448 case Type::member:
3449 destruct(value_.member);
3450 break;
3451 case Type::members:
3452 destruct(value_.members);
3453 break;
3454 case Type::field:
3455 destruct(value_.field);
3456 break;
3457 case Type::fields:
3458 destruct(value_.fields);
3459 break;
3460 default:
3461 assert(false);
3462 break;
3463 }
3464 type_ = Type::__EMPTY__;
3465 }
3466
operator ==(const union_with_special_names & rhs) const3467 bool union_with_special_names::operator==(const union_with_special_names& rhs) const {
3468 if (type_ != rhs.type_) { return false; }
3469 switch(type_) {
3470 case Type::get:
3471 return value_.get == rhs.value_.get;
3472 case Type::getter:
3473 return value_.getter == rhs.value_.getter;
3474 case Type::lists:
3475 return value_.lists == rhs.value_.lists;
3476 case Type::maps:
3477 return value_.maps == rhs.value_.maps;
3478 case Type::name:
3479 return value_.name == rhs.value_.name;
3480 case Type::name_to_value:
3481 return value_.name_to_value == rhs.value_.name_to_value;
3482 case Type::names:
3483 return value_.names == rhs.value_.names;
3484 case Type::prefix_tree:
3485 return value_.prefix_tree == rhs.value_.prefix_tree;
3486 case Type::sets:
3487 return value_.sets == rhs.value_.sets;
3488 case Type::setter:
3489 return value_.setter == rhs.value_.setter;
3490 case Type::str:
3491 return value_.str == rhs.value_.str;
3492 case Type::strings:
3493 return value_.strings == rhs.value_.strings;
3494 case Type::type:
3495 return value_.type == rhs.value_.type;
3496 case Type::value:
3497 return value_.value == rhs.value_.value;
3498 case Type::value_to_name:
3499 return value_.value_to_name == rhs.value_.value_to_name;
3500 case Type::values:
3501 return value_.values == rhs.value_.values;
3502 case Type::id:
3503 return value_.id == rhs.value_.id;
3504 case Type::ids:
3505 return value_.ids == rhs.value_.ids;
3506 case Type::descriptor:
3507 return value_.descriptor == rhs.value_.descriptor;
3508 case Type::descriptors:
3509 return value_.descriptors == rhs.value_.descriptors;
3510 case Type::key:
3511 return value_.key == rhs.value_.key;
3512 case Type::keys:
3513 return value_.keys == rhs.value_.keys;
3514 case Type::annotation:
3515 return value_.annotation == rhs.value_.annotation;
3516 case Type::annotations:
3517 return value_.annotations == rhs.value_.annotations;
3518 case Type::member:
3519 return value_.member == rhs.value_.member;
3520 case Type::members:
3521 return value_.members == rhs.value_.members;
3522 case Type::field:
3523 return value_.field == rhs.value_.field;
3524 case Type::fields:
3525 return value_.fields == rhs.value_.fields;
3526 default:
3527 return true;
3528 }
3529 }
3530
operator <(const union_with_special_names & rhs) const3531 bool union_with_special_names::operator<(const union_with_special_names& rhs) const {
3532 (void)rhs;
3533 auto& lhs = *this;
3534 (void)lhs;
3535 if (lhs.type_ != rhs.type_) {
3536 return lhs.type_ < rhs.type_;
3537 }
3538 switch (lhs.type_) {
3539 case Type::get:
3540 return lhs.value_.get < rhs.value_.get;
3541 case Type::getter:
3542 return lhs.value_.getter < rhs.value_.getter;
3543 case Type::lists:
3544 return lhs.value_.lists < rhs.value_.lists;
3545 case Type::maps:
3546 return lhs.value_.maps < rhs.value_.maps;
3547 case Type::name:
3548 return lhs.value_.name < rhs.value_.name;
3549 case Type::name_to_value:
3550 return lhs.value_.name_to_value < rhs.value_.name_to_value;
3551 case Type::names:
3552 return lhs.value_.names < rhs.value_.names;
3553 case Type::prefix_tree:
3554 return lhs.value_.prefix_tree < rhs.value_.prefix_tree;
3555 case Type::sets:
3556 return lhs.value_.sets < rhs.value_.sets;
3557 case Type::setter:
3558 return lhs.value_.setter < rhs.value_.setter;
3559 case Type::str:
3560 return lhs.value_.str < rhs.value_.str;
3561 case Type::strings:
3562 return lhs.value_.strings < rhs.value_.strings;
3563 case Type::type:
3564 return lhs.value_.type < rhs.value_.type;
3565 case Type::value:
3566 return lhs.value_.value < rhs.value_.value;
3567 case Type::value_to_name:
3568 return lhs.value_.value_to_name < rhs.value_.value_to_name;
3569 case Type::values:
3570 return lhs.value_.values < rhs.value_.values;
3571 case Type::id:
3572 return lhs.value_.id < rhs.value_.id;
3573 case Type::ids:
3574 return lhs.value_.ids < rhs.value_.ids;
3575 case Type::descriptor:
3576 return lhs.value_.descriptor < rhs.value_.descriptor;
3577 case Type::descriptors:
3578 return lhs.value_.descriptors < rhs.value_.descriptors;
3579 case Type::key:
3580 return lhs.value_.key < rhs.value_.key;
3581 case Type::keys:
3582 return lhs.value_.keys < rhs.value_.keys;
3583 case Type::annotation:
3584 return lhs.value_.annotation < rhs.value_.annotation;
3585 case Type::annotations:
3586 return lhs.value_.annotations < rhs.value_.annotations;
3587 case Type::member:
3588 return lhs.value_.member < rhs.value_.member;
3589 case Type::members:
3590 return lhs.value_.members < rhs.value_.members;
3591 case Type::field:
3592 return lhs.value_.field < rhs.value_.field;
3593 case Type::fields:
3594 return lhs.value_.fields < rhs.value_.fields;
3595 default:
3596 return false;
3597 }
3598 }
3599
swap(union_with_special_names & a,union_with_special_names & b)3600 void swap(union_with_special_names& a, union_with_special_names& b) {
3601 union_with_special_names temp(std::move(a));
3602 a = std::move(b);
3603 b = std::move(temp);
3604 }
3605
3606 template void union_with_special_names::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
3607 template uint32_t union_with_special_names::write<>(apache::thrift::BinaryProtocolWriter*) const;
3608 template uint32_t union_with_special_names::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
3609 template uint32_t union_with_special_names::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
3610 template void union_with_special_names::readNoXfer<>(apache::thrift::CompactProtocolReader*);
3611 template uint32_t union_with_special_names::write<>(apache::thrift::CompactProtocolWriter*) const;
3612 template uint32_t union_with_special_names::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
3613 template uint32_t union_with_special_names::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
3614
3615
3616
3617 }} // test_cpp2::cpp_reflection
3618
3619 namespace apache {
3620 namespace thrift {
3621 namespace detail {
3622
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)3623 void TccStructTraits<::test_cpp2::cpp_reflection::struct_with_special_names>::translateFieldName(
3624 folly::StringPiece _fname,
3625 int16_t& fid,
3626 apache::thrift::protocol::TType& _ftype) noexcept {
3627 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::struct_with_special_names>;
3628 static const st::translate_field_name_table table{
3629 data::fields_size,
3630 data::fields_names.data(),
3631 data::fields_ids.data(),
3632 data::fields_types.data()};
3633 st::translate_field_name(_fname, fid, _ftype, table);
3634 }
3635
3636 } // namespace detail
3637 } // namespace thrift
3638 } // namespace apache
3639
3640 namespace test_cpp2 { namespace cpp_reflection {
3641
3642
struct_with_special_names(apache::thrift::FragileConstructor,::std::int32_t get__arg,::std::int32_t getter__arg,::std::int32_t lists__arg,::std::int32_t maps__arg,::std::int32_t name__arg,::std::int32_t name_to_value__arg,::std::int32_t names__arg,::std::int32_t prefix_tree__arg,::std::int32_t sets__arg,::std::int32_t setter__arg,::std::int32_t str__arg,::std::int32_t strings__arg,::std::int32_t type__arg,::std::int32_t value__arg,::std::int32_t value_to_name__arg,::std::int32_t values__arg,::std::int32_t id__arg,::std::int32_t ids__arg,::std::int32_t descriptor__arg,::std::int32_t descriptors__arg,::std::int32_t key__arg,::std::int32_t keys__arg,::std::int32_t annotation__arg,::std::int32_t annotations__arg,::std::int32_t member__arg,::std::int32_t members__arg,::std::int32_t field__arg,::std::int32_t fields__arg)3643 struct_with_special_names::struct_with_special_names(apache::thrift::FragileConstructor, ::std::int32_t get__arg, ::std::int32_t getter__arg, ::std::int32_t lists__arg, ::std::int32_t maps__arg, ::std::int32_t name__arg, ::std::int32_t name_to_value__arg, ::std::int32_t names__arg, ::std::int32_t prefix_tree__arg, ::std::int32_t sets__arg, ::std::int32_t setter__arg, ::std::int32_t str__arg, ::std::int32_t strings__arg, ::std::int32_t type__arg, ::std::int32_t value__arg, ::std::int32_t value_to_name__arg, ::std::int32_t values__arg, ::std::int32_t id__arg, ::std::int32_t ids__arg, ::std::int32_t descriptor__arg, ::std::int32_t descriptors__arg, ::std::int32_t key__arg, ::std::int32_t keys__arg, ::std::int32_t annotation__arg, ::std::int32_t annotations__arg, ::std::int32_t member__arg, ::std::int32_t members__arg, ::std::int32_t field__arg, ::std::int32_t fields__arg) :
3644 __fbthrift_field_get(std::move(get__arg)),
3645 __fbthrift_field_getter(std::move(getter__arg)),
3646 __fbthrift_field_lists(std::move(lists__arg)),
3647 __fbthrift_field_maps(std::move(maps__arg)),
3648 __fbthrift_field_name(std::move(name__arg)),
3649 __fbthrift_field_name_to_value(std::move(name_to_value__arg)),
3650 __fbthrift_field_names(std::move(names__arg)),
3651 __fbthrift_field_prefix_tree(std::move(prefix_tree__arg)),
3652 __fbthrift_field_sets(std::move(sets__arg)),
3653 __fbthrift_field_setter(std::move(setter__arg)),
3654 __fbthrift_field_str(std::move(str__arg)),
3655 __fbthrift_field_strings(std::move(strings__arg)),
3656 __fbthrift_field_type(std::move(type__arg)),
3657 __fbthrift_field_value(std::move(value__arg)),
3658 __fbthrift_field_value_to_name(std::move(value_to_name__arg)),
3659 __fbthrift_field_values(std::move(values__arg)),
3660 __fbthrift_field_id(std::move(id__arg)),
3661 __fbthrift_field_ids(std::move(ids__arg)),
3662 __fbthrift_field_descriptor(std::move(descriptor__arg)),
3663 __fbthrift_field_descriptors(std::move(descriptors__arg)),
3664 __fbthrift_field_key(std::move(key__arg)),
3665 __fbthrift_field_keys(std::move(keys__arg)),
3666 __fbthrift_field_annotation(std::move(annotation__arg)),
3667 __fbthrift_field_annotations(std::move(annotations__arg)),
3668 __fbthrift_field_member(std::move(member__arg)),
3669 __fbthrift_field_members(std::move(members__arg)),
3670 __fbthrift_field_field(std::move(field__arg)),
3671 __fbthrift_field_fields(std::move(fields__arg)) {
3672 __isset.set(folly::index_constant<0>(), true);
3673 __isset.set(folly::index_constant<1>(), true);
3674 __isset.set(folly::index_constant<2>(), true);
3675 __isset.set(folly::index_constant<3>(), true);
3676 __isset.set(folly::index_constant<4>(), true);
3677 __isset.set(folly::index_constant<5>(), true);
3678 __isset.set(folly::index_constant<6>(), true);
3679 __isset.set(folly::index_constant<7>(), true);
3680 __isset.set(folly::index_constant<8>(), true);
3681 __isset.set(folly::index_constant<9>(), true);
3682 __isset.set(folly::index_constant<10>(), true);
3683 __isset.set(folly::index_constant<11>(), true);
3684 __isset.set(folly::index_constant<12>(), true);
3685 __isset.set(folly::index_constant<13>(), true);
3686 __isset.set(folly::index_constant<14>(), true);
3687 __isset.set(folly::index_constant<15>(), true);
3688 __isset.set(folly::index_constant<16>(), true);
3689 __isset.set(folly::index_constant<17>(), true);
3690 __isset.set(folly::index_constant<18>(), true);
3691 __isset.set(folly::index_constant<19>(), true);
3692 __isset.set(folly::index_constant<20>(), true);
3693 __isset.set(folly::index_constant<21>(), true);
3694 __isset.set(folly::index_constant<22>(), true);
3695 __isset.set(folly::index_constant<23>(), true);
3696 __isset.set(folly::index_constant<24>(), true);
3697 __isset.set(folly::index_constant<25>(), true);
3698 __isset.set(folly::index_constant<26>(), true);
3699 __isset.set(folly::index_constant<27>(), true);
3700 }
3701
3702
__fbthrift_clear()3703 void struct_with_special_names::__fbthrift_clear() {
3704 // clear all fields
3705 this->__fbthrift_field_get = ::std::int32_t();
3706 this->__fbthrift_field_getter = ::std::int32_t();
3707 this->__fbthrift_field_lists = ::std::int32_t();
3708 this->__fbthrift_field_maps = ::std::int32_t();
3709 this->__fbthrift_field_name = ::std::int32_t();
3710 this->__fbthrift_field_name_to_value = ::std::int32_t();
3711 this->__fbthrift_field_names = ::std::int32_t();
3712 this->__fbthrift_field_prefix_tree = ::std::int32_t();
3713 this->__fbthrift_field_sets = ::std::int32_t();
3714 this->__fbthrift_field_setter = ::std::int32_t();
3715 this->__fbthrift_field_str = ::std::int32_t();
3716 this->__fbthrift_field_strings = ::std::int32_t();
3717 this->__fbthrift_field_type = ::std::int32_t();
3718 this->__fbthrift_field_value = ::std::int32_t();
3719 this->__fbthrift_field_value_to_name = ::std::int32_t();
3720 this->__fbthrift_field_values = ::std::int32_t();
3721 this->__fbthrift_field_id = ::std::int32_t();
3722 this->__fbthrift_field_ids = ::std::int32_t();
3723 this->__fbthrift_field_descriptor = ::std::int32_t();
3724 this->__fbthrift_field_descriptors = ::std::int32_t();
3725 this->__fbthrift_field_key = ::std::int32_t();
3726 this->__fbthrift_field_keys = ::std::int32_t();
3727 this->__fbthrift_field_annotation = ::std::int32_t();
3728 this->__fbthrift_field_annotations = ::std::int32_t();
3729 this->__fbthrift_field_member = ::std::int32_t();
3730 this->__fbthrift_field_members = ::std::int32_t();
3731 this->__fbthrift_field_field = ::std::int32_t();
3732 this->__fbthrift_field_fields = ::std::int32_t();
3733 __isset = {};
3734 }
3735
operator ==(const struct_with_special_names & rhs) const3736 bool struct_with_special_names::operator==(const struct_with_special_names& rhs) const {
3737 (void)rhs;
3738 auto& lhs = *this;
3739 (void)lhs;
3740 if (!(lhs.get_ref() == rhs.get_ref())) {
3741 return false;
3742 }
3743 if (!(lhs.getter_ref() == rhs.getter_ref())) {
3744 return false;
3745 }
3746 if (!(lhs.lists_ref() == rhs.lists_ref())) {
3747 return false;
3748 }
3749 if (!(lhs.maps_ref() == rhs.maps_ref())) {
3750 return false;
3751 }
3752 if (!(lhs.name_ref() == rhs.name_ref())) {
3753 return false;
3754 }
3755 if (!(lhs.name_to_value_ref() == rhs.name_to_value_ref())) {
3756 return false;
3757 }
3758 if (!(lhs.names_ref() == rhs.names_ref())) {
3759 return false;
3760 }
3761 if (!(lhs.prefix_tree_ref() == rhs.prefix_tree_ref())) {
3762 return false;
3763 }
3764 if (!(lhs.sets_ref() == rhs.sets_ref())) {
3765 return false;
3766 }
3767 if (!(lhs.setter_ref() == rhs.setter_ref())) {
3768 return false;
3769 }
3770 if (!(lhs.str_ref() == rhs.str_ref())) {
3771 return false;
3772 }
3773 if (!(lhs.strings_ref() == rhs.strings_ref())) {
3774 return false;
3775 }
3776 if (!(lhs.type_ref() == rhs.type_ref())) {
3777 return false;
3778 }
3779 if (!(lhs.value_ref() == rhs.value_ref())) {
3780 return false;
3781 }
3782 if (!(lhs.value_to_name_ref() == rhs.value_to_name_ref())) {
3783 return false;
3784 }
3785 if (!(lhs.values_ref() == rhs.values_ref())) {
3786 return false;
3787 }
3788 if (!(lhs.id_ref() == rhs.id_ref())) {
3789 return false;
3790 }
3791 if (!(lhs.ids_ref() == rhs.ids_ref())) {
3792 return false;
3793 }
3794 if (!(lhs.descriptor_ref() == rhs.descriptor_ref())) {
3795 return false;
3796 }
3797 if (!(lhs.descriptors_ref() == rhs.descriptors_ref())) {
3798 return false;
3799 }
3800 if (!(lhs.key_ref() == rhs.key_ref())) {
3801 return false;
3802 }
3803 if (!(lhs.keys_ref() == rhs.keys_ref())) {
3804 return false;
3805 }
3806 if (!(lhs.annotation_ref() == rhs.annotation_ref())) {
3807 return false;
3808 }
3809 if (!(lhs.annotations_ref() == rhs.annotations_ref())) {
3810 return false;
3811 }
3812 if (!(lhs.member_ref() == rhs.member_ref())) {
3813 return false;
3814 }
3815 if (!(lhs.members_ref() == rhs.members_ref())) {
3816 return false;
3817 }
3818 if (!(lhs.field_ref() == rhs.field_ref())) {
3819 return false;
3820 }
3821 if (!(lhs.fields_ref() == rhs.fields_ref())) {
3822 return false;
3823 }
3824 return true;
3825 }
3826
operator <(const struct_with_special_names & rhs) const3827 bool struct_with_special_names::operator<(const struct_with_special_names& rhs) const {
3828 (void)rhs;
3829 auto& lhs = *this;
3830 (void)lhs;
3831 if (!(lhs.get_ref() == rhs.get_ref())) {
3832 return lhs.get_ref() < rhs.get_ref();
3833 }
3834 if (!(lhs.getter_ref() == rhs.getter_ref())) {
3835 return lhs.getter_ref() < rhs.getter_ref();
3836 }
3837 if (!(lhs.lists_ref() == rhs.lists_ref())) {
3838 return lhs.lists_ref() < rhs.lists_ref();
3839 }
3840 if (!(lhs.maps_ref() == rhs.maps_ref())) {
3841 return lhs.maps_ref() < rhs.maps_ref();
3842 }
3843 if (!(lhs.name_ref() == rhs.name_ref())) {
3844 return lhs.name_ref() < rhs.name_ref();
3845 }
3846 if (!(lhs.name_to_value_ref() == rhs.name_to_value_ref())) {
3847 return lhs.name_to_value_ref() < rhs.name_to_value_ref();
3848 }
3849 if (!(lhs.names_ref() == rhs.names_ref())) {
3850 return lhs.names_ref() < rhs.names_ref();
3851 }
3852 if (!(lhs.prefix_tree_ref() == rhs.prefix_tree_ref())) {
3853 return lhs.prefix_tree_ref() < rhs.prefix_tree_ref();
3854 }
3855 if (!(lhs.sets_ref() == rhs.sets_ref())) {
3856 return lhs.sets_ref() < rhs.sets_ref();
3857 }
3858 if (!(lhs.setter_ref() == rhs.setter_ref())) {
3859 return lhs.setter_ref() < rhs.setter_ref();
3860 }
3861 if (!(lhs.str_ref() == rhs.str_ref())) {
3862 return lhs.str_ref() < rhs.str_ref();
3863 }
3864 if (!(lhs.strings_ref() == rhs.strings_ref())) {
3865 return lhs.strings_ref() < rhs.strings_ref();
3866 }
3867 if (!(lhs.type_ref() == rhs.type_ref())) {
3868 return lhs.type_ref() < rhs.type_ref();
3869 }
3870 if (!(lhs.value_ref() == rhs.value_ref())) {
3871 return lhs.value_ref() < rhs.value_ref();
3872 }
3873 if (!(lhs.value_to_name_ref() == rhs.value_to_name_ref())) {
3874 return lhs.value_to_name_ref() < rhs.value_to_name_ref();
3875 }
3876 if (!(lhs.values_ref() == rhs.values_ref())) {
3877 return lhs.values_ref() < rhs.values_ref();
3878 }
3879 if (!(lhs.id_ref() == rhs.id_ref())) {
3880 return lhs.id_ref() < rhs.id_ref();
3881 }
3882 if (!(lhs.ids_ref() == rhs.ids_ref())) {
3883 return lhs.ids_ref() < rhs.ids_ref();
3884 }
3885 if (!(lhs.descriptor_ref() == rhs.descriptor_ref())) {
3886 return lhs.descriptor_ref() < rhs.descriptor_ref();
3887 }
3888 if (!(lhs.descriptors_ref() == rhs.descriptors_ref())) {
3889 return lhs.descriptors_ref() < rhs.descriptors_ref();
3890 }
3891 if (!(lhs.key_ref() == rhs.key_ref())) {
3892 return lhs.key_ref() < rhs.key_ref();
3893 }
3894 if (!(lhs.keys_ref() == rhs.keys_ref())) {
3895 return lhs.keys_ref() < rhs.keys_ref();
3896 }
3897 if (!(lhs.annotation_ref() == rhs.annotation_ref())) {
3898 return lhs.annotation_ref() < rhs.annotation_ref();
3899 }
3900 if (!(lhs.annotations_ref() == rhs.annotations_ref())) {
3901 return lhs.annotations_ref() < rhs.annotations_ref();
3902 }
3903 if (!(lhs.member_ref() == rhs.member_ref())) {
3904 return lhs.member_ref() < rhs.member_ref();
3905 }
3906 if (!(lhs.members_ref() == rhs.members_ref())) {
3907 return lhs.members_ref() < rhs.members_ref();
3908 }
3909 if (!(lhs.field_ref() == rhs.field_ref())) {
3910 return lhs.field_ref() < rhs.field_ref();
3911 }
3912 if (!(lhs.fields_ref() == rhs.fields_ref())) {
3913 return lhs.fields_ref() < rhs.fields_ref();
3914 }
3915 return false;
3916 }
3917
3918
swap(struct_with_special_names & a,struct_with_special_names & b)3919 void swap(struct_with_special_names& a, struct_with_special_names& b) {
3920 using ::std::swap;
3921 swap(a.get_ref().value(), b.get_ref().value());
3922 swap(a.getter_ref().value(), b.getter_ref().value());
3923 swap(a.lists_ref().value(), b.lists_ref().value());
3924 swap(a.maps_ref().value(), b.maps_ref().value());
3925 swap(a.name_ref().value(), b.name_ref().value());
3926 swap(a.name_to_value_ref().value(), b.name_to_value_ref().value());
3927 swap(a.names_ref().value(), b.names_ref().value());
3928 swap(a.prefix_tree_ref().value(), b.prefix_tree_ref().value());
3929 swap(a.sets_ref().value(), b.sets_ref().value());
3930 swap(a.setter_ref().value(), b.setter_ref().value());
3931 swap(a.str_ref().value(), b.str_ref().value());
3932 swap(a.strings_ref().value(), b.strings_ref().value());
3933 swap(a.type_ref().value(), b.type_ref().value());
3934 swap(a.value_ref().value(), b.value_ref().value());
3935 swap(a.value_to_name_ref().value(), b.value_to_name_ref().value());
3936 swap(a.values_ref().value(), b.values_ref().value());
3937 swap(a.id_ref().value(), b.id_ref().value());
3938 swap(a.ids_ref().value(), b.ids_ref().value());
3939 swap(a.descriptor_ref().value(), b.descriptor_ref().value());
3940 swap(a.descriptors_ref().value(), b.descriptors_ref().value());
3941 swap(a.key_ref().value(), b.key_ref().value());
3942 swap(a.keys_ref().value(), b.keys_ref().value());
3943 swap(a.annotation_ref().value(), b.annotation_ref().value());
3944 swap(a.annotations_ref().value(), b.annotations_ref().value());
3945 swap(a.member_ref().value(), b.member_ref().value());
3946 swap(a.members_ref().value(), b.members_ref().value());
3947 swap(a.field_ref().value(), b.field_ref().value());
3948 swap(a.fields_ref().value(), b.fields_ref().value());
3949 swap(a.__isset, b.__isset);
3950 }
3951
3952 template void struct_with_special_names::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
3953 template uint32_t struct_with_special_names::write<>(apache::thrift::BinaryProtocolWriter*) const;
3954 template uint32_t struct_with_special_names::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
3955 template uint32_t struct_with_special_names::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
3956 template void struct_with_special_names::readNoXfer<>(apache::thrift::CompactProtocolReader*);
3957 template uint32_t struct_with_special_names::write<>(apache::thrift::CompactProtocolWriter*) const;
3958 template uint32_t struct_with_special_names::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
3959 template uint32_t struct_with_special_names::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
3960
3961
3962
3963 }} // test_cpp2::cpp_reflection
3964
3965 namespace apache {
3966 namespace thrift {
3967 namespace detail {
3968
translateFieldName(folly::StringPiece _fname,int16_t & fid,apache::thrift::protocol::TType & _ftype)3969 void TccStructTraits<::test_cpp2::cpp_reflection::struct_with_indirections>::translateFieldName(
3970 folly::StringPiece _fname,
3971 int16_t& fid,
3972 apache::thrift::protocol::TType& _ftype) noexcept {
3973 using data = apache::thrift::TStructDataStorage<::test_cpp2::cpp_reflection::struct_with_indirections>;
3974 static const st::translate_field_name_table table{
3975 data::fields_size,
3976 data::fields_names.data(),
3977 data::fields_ids.data(),
3978 data::fields_types.data()};
3979 st::translate_field_name(_fname, fid, _ftype, table);
3980 }
3981
3982 } // namespace detail
3983 } // namespace thrift
3984 } // namespace apache
3985
3986 namespace test_cpp2 { namespace cpp_reflection {
3987
3988 struct_with_indirections::struct_with_indirections(const struct_with_indirections&) = default;
3989 struct_with_indirections& struct_with_indirections::operator=(const struct_with_indirections&) = default;
struct_with_indirections()3990 struct_with_indirections::struct_with_indirections() :
3991 __fbthrift_field_real(),
3992 __fbthrift_field_fake(),
3993 __fbthrift_field_number(),
3994 __fbthrift_field_result() {
3995 }
3996
3997
~struct_with_indirections()3998 struct_with_indirections::~struct_with_indirections() {}
3999
struct_with_indirections(struct_with_indirections && other)4000 struct_with_indirections::struct_with_indirections(struct_with_indirections&& other) noexcept :
4001 __fbthrift_field_real(std::move(other.__fbthrift_field_real)),
4002 __fbthrift_field_fake(std::move(other.__fbthrift_field_fake)),
4003 __fbthrift_field_number(std::move(other.__fbthrift_field_number)),
4004 __fbthrift_field_result(std::move(other.__fbthrift_field_result)),
4005 __fbthrift_field_phrase(std::move(other.__fbthrift_field_phrase)),
4006 __isset(other.__isset) {
4007 }
4008
operator =(FOLLY_MAYBE_UNUSED struct_with_indirections && other)4009 struct_with_indirections& struct_with_indirections::operator=(FOLLY_MAYBE_UNUSED struct_with_indirections&& other) noexcept {
4010 this->__fbthrift_field_real = std::move(other.__fbthrift_field_real);
4011 this->__fbthrift_field_fake = std::move(other.__fbthrift_field_fake);
4012 this->__fbthrift_field_number = std::move(other.__fbthrift_field_number);
4013 this->__fbthrift_field_result = std::move(other.__fbthrift_field_result);
4014 this->__fbthrift_field_phrase = std::move(other.__fbthrift_field_phrase);
4015 __isset = other.__isset;
4016 return *this;
4017 }
4018
4019
struct_with_indirections(apache::thrift::FragileConstructor,::std::int32_t real__arg,::test_cpp2::cpp_reflection::FakeI32 fake__arg,::test_cpp2::cpp_reflection::HasANumber number__arg,::test_cpp2::cpp_reflection::HasAResult result__arg,::test_cpp2::cpp_reflection::HasAPhrase phrase__arg)4020 struct_with_indirections::struct_with_indirections(apache::thrift::FragileConstructor, ::std::int32_t real__arg, ::test_cpp2::cpp_reflection::FakeI32 fake__arg, ::test_cpp2::cpp_reflection::HasANumber number__arg, ::test_cpp2::cpp_reflection::HasAResult result__arg, ::test_cpp2::cpp_reflection::HasAPhrase phrase__arg) :
4021 __fbthrift_field_real(std::move(real__arg)),
4022 __fbthrift_field_fake(std::move(fake__arg)),
4023 __fbthrift_field_number(std::move(number__arg)),
4024 __fbthrift_field_result(std::move(result__arg)),
4025 __fbthrift_field_phrase(std::move(phrase__arg)) {
4026 __isset.set(folly::index_constant<0>(), true);
4027 __isset.set(folly::index_constant<1>(), true);
4028 __isset.set(folly::index_constant<2>(), true);
4029 __isset.set(folly::index_constant<3>(), true);
4030 __isset.set(folly::index_constant<4>(), true);
4031 }
4032
4033
__fbthrift_clear()4034 void struct_with_indirections::__fbthrift_clear() {
4035 // clear all fields
4036 this->__fbthrift_field_real = ::std::int32_t();
4037 this->__fbthrift_field_fake = ::test_cpp2::cpp_reflection::FakeI32();
4038 ::apache::thrift::apply_indirection(this->__fbthrift_field_number) = 0;
4039 ::apache::thrift::apply_indirection(this->__fbthrift_field_result) = 0;
4040 ::apache::thrift::apply_indirection(this->__fbthrift_field_phrase) = apache::thrift::StringTraits<::folly::remove_cvref_t<::folly::invoke_result_t<::apache::thrift::detail::apply_indirection_fn, CppHasAPhrase const&>>>::fromStringLiteral("");
4041 __isset = {};
4042 }
4043
operator ==(const struct_with_indirections & rhs) const4044 bool struct_with_indirections::operator==(const struct_with_indirections& rhs) const {
4045 (void)rhs;
4046 auto& lhs = *this;
4047 (void)lhs;
4048 if (!(lhs.real_ref() == rhs.real_ref())) {
4049 return false;
4050 }
4051 if (!(lhs.fake_ref() == rhs.fake_ref())) {
4052 return false;
4053 }
4054 if (!(lhs.number_ref() == rhs.number_ref())) {
4055 return false;
4056 }
4057 if (!(lhs.result_ref() == rhs.result_ref())) {
4058 return false;
4059 }
4060 if (!(lhs.phrase_ref() == rhs.phrase_ref())) {
4061 return false;
4062 }
4063 return true;
4064 }
4065
operator <(const struct_with_indirections & rhs) const4066 bool struct_with_indirections::operator<(const struct_with_indirections& rhs) const {
4067 (void)rhs;
4068 auto& lhs = *this;
4069 (void)lhs;
4070 if (!(lhs.real_ref() == rhs.real_ref())) {
4071 return lhs.real_ref() < rhs.real_ref();
4072 }
4073 if (!(lhs.fake_ref() == rhs.fake_ref())) {
4074 return lhs.fake_ref() < rhs.fake_ref();
4075 }
4076 if (!(lhs.number_ref() == rhs.number_ref())) {
4077 return lhs.number_ref() < rhs.number_ref();
4078 }
4079 if (!(lhs.result_ref() == rhs.result_ref())) {
4080 return lhs.result_ref() < rhs.result_ref();
4081 }
4082 if (!(lhs.phrase_ref() == rhs.phrase_ref())) {
4083 return lhs.phrase_ref() < rhs.phrase_ref();
4084 }
4085 return false;
4086 }
4087
4088
swap(struct_with_indirections & a,struct_with_indirections & b)4089 void swap(struct_with_indirections& a, struct_with_indirections& b) {
4090 using ::std::swap;
4091 swap(a.real_ref().value(), b.real_ref().value());
4092 swap(a.fake_ref().value(), b.fake_ref().value());
4093 swap(a.number_ref().value(), b.number_ref().value());
4094 swap(a.result_ref().value(), b.result_ref().value());
4095 swap(a.phrase_ref().value(), b.phrase_ref().value());
4096 swap(a.__isset, b.__isset);
4097 }
4098
4099 template void struct_with_indirections::readNoXfer<>(apache::thrift::BinaryProtocolReader*);
4100 template uint32_t struct_with_indirections::write<>(apache::thrift::BinaryProtocolWriter*) const;
4101 template uint32_t struct_with_indirections::serializedSize<>(apache::thrift::BinaryProtocolWriter const*) const;
4102 template uint32_t struct_with_indirections::serializedSizeZC<>(apache::thrift::BinaryProtocolWriter const*) const;
4103 template void struct_with_indirections::readNoXfer<>(apache::thrift::CompactProtocolReader*);
4104 template uint32_t struct_with_indirections::write<>(apache::thrift::CompactProtocolWriter*) const;
4105 template uint32_t struct_with_indirections::serializedSize<>(apache::thrift::CompactProtocolWriter const*) const;
4106 template uint32_t struct_with_indirections::serializedSizeZC<>(apache::thrift::CompactProtocolWriter const*) const;
4107
4108
4109
4110 }} // test_cpp2::cpp_reflection
4111
4112 namespace test_cpp2 { namespace cpp_reflection { namespace {
validateAdapters()4113 FOLLY_MAYBE_UNUSED FOLLY_ERASE void validateAdapters() {
4114 }
4115 }}} // test_cpp2::cpp_reflection
4116