2 * Copyright (c) Meta Platforms, Inc. and affiliates.
4 * This source code is licensed under the MIT license found in the LICENSE
5 * file in the root directory of this source tree.
10 * THIS FILE IS AUTOGENERATED. DO NOT MODIFY IT; ALL CHANGES WILL BE LOST IN
20 template <class Writer
>
21 void TestRequest::serialize(Writer
&& writer
) const {
22 writer
.writeStructBegin();
23 writer
.writeField(1 /* field id */, key_ref());
24 writer
.writeField(2 /* field id */, dummy2_ref());
25 writer
.writeField(3 /* field id */, testBool_ref());
26 writer
.writeField(4 /* field id */, testChar_ref());
27 writer
.writeField(5 /* field id */, testInt8_ref());
28 writer
.writeField(6 /* field id */, testInt16_ref());
29 writer
.writeField(7 /* field id */, testInt32_ref());
30 writer
.writeField(8 /* field id */, testInt64_ref());
31 writer
.writeField(9 /* field id */, testUInt8_ref());
32 writer
.writeField(10 /* field id */, testUInt16_ref());
33 writer
.writeField(11 /* field id */, testUInt32_ref());
34 writer
.writeField(12 /* field id */, testUInt64_ref());
35 writer
.writeField(13 /* field id */, testFloat_ref());
36 writer
.writeField(14 /* field id */, testDouble_ref());
37 writer
.writeField(15 /* field id */, testShortString_ref());
38 writer
.writeField(16 /* field id */, testLongString_ref());
39 writer
.writeField(17 /* field id */, testIobuf_ref());
40 writer
.writeField(19 /* field id */, testList_ref());
41 writer
.writeField(20 /* field id */, testOptionalString_ref());
42 writer
.writeField(21 /* field id */, testOptionalIobuf_ref());
43 writer
.writeField(22 /* field id */, dummy22_ref());
44 writer
.writeField(23 /* field id */, dummy23_ref());
45 writer
.writeField(24 /* field id */, testNestedVec_ref());
46 writer
.writeField(25 /* field id */, testUMap_ref());
47 writer
.writeField(26 /* field id */, testMap_ref());
48 writer
.writeField(27 /* field id */, testComplexMap_ref());
49 writer
.writeField(28 /* field id */, testUSet_ref());
50 writer
.writeField(29 /* field id */, testSet_ref());
51 writer
.writeField(30 /* field id */, testOptionalBool_ref());
52 writer
.writeField(31 /* field id */, dummy31_ref());
53 writer
.writeField(32 /* field id */, testIOBufList_ref());
54 writer
.writeField(33 /* field id */, testF14FastMap_ref());
55 writer
.writeField(34 /* field id */, testF14NodeMap_ref());
56 writer
.writeField(35 /* field id */, testF14ValueMap_ref());
57 writer
.writeField(36 /* field id */, testF14VectorMap_ref());
58 writer
.writeField(37 /* field id */, testF14FastSet_ref());
59 writer
.writeField(38 /* field id */, testF14NodeSet_ref());
60 writer
.writeField(39 /* field id */, testF14ValueSet_ref());
61 writer
.writeField(40 /* field id */, testF14VectorSet_ref());
62 writer
.writeField(41 /* field id */, testOptionalKeywordString_ref());
63 writer
.writeField(42 /* field id */, testOptionalKeywordIobuf_ref());
64 writer
.writeField(43 /* field id */, testOptionalKeywordBool_ref());
65 writer
.writeFieldStop();
66 writer
.writeStructEnd();
70 void TestRequest::visitFields(V
&& v
) {
71 if (!v
.visitField(1, "key", *this->key_ref())) {
74 if (!v
.visitField(2, "dummy2", *this->dummy2_ref())) {
77 if (!v
.visitField(3, "testBool", *this->testBool_ref())) {
80 if (!v
.visitField(4, "testChar", *this->testChar_ref())) {
83 if (!v
.visitField(5, "testInt8", *this->testInt8_ref())) {
86 if (!v
.visitField(6, "testInt16", *this->testInt16_ref())) {
89 if (!v
.visitField(7, "testInt32", *this->testInt32_ref())) {
92 if (!v
.visitField(8, "testInt64", *this->testInt64_ref())) {
95 if (!v
.visitField(9, "testUInt8", *this->testUInt8_ref())) {
98 if (!v
.visitField(10, "testUInt16", *this->testUInt16_ref())) {
101 if (!v
.visitField(11, "testUInt32", *this->testUInt32_ref())) {
104 if (!v
.visitField(12, "testUInt64", *this->testUInt64_ref())) {
107 if (!v
.visitField(13, "testFloat", *this->testFloat_ref())) {
110 if (!v
.visitField(14, "testDouble", *this->testDouble_ref())) {
113 if (!v
.visitField(15, "testShortString", *this->testShortString_ref())) {
116 if (!v
.visitField(16, "testLongString", *this->testLongString_ref())) {
119 if (!v
.visitField(17, "testIobuf", *this->testIobuf_ref())) {
122 if (!v
.visitField(19, "testList", *this->testList_ref())) {
125 if (!v
.visitField(20, "testOptionalString", this->testOptionalString_ref())) {
128 if (!v
.visitField(21, "testOptionalIobuf", this->testOptionalIobuf_ref())) {
131 if (!v
.visitField(22, "dummy22", *this->dummy22_ref())) {
134 if (!v
.visitField(23, "dummy23", *this->dummy23_ref())) {
137 if (!v
.visitField(24, "testNestedVec", *this->testNestedVec_ref())) {
140 if (!v
.visitField(25, "testUMap", *this->testUMap_ref())) {
143 if (!v
.visitField(26, "testMap", *this->testMap_ref())) {
146 if (!v
.visitField(27, "testComplexMap", *this->testComplexMap_ref())) {
149 if (!v
.visitField(28, "testUSet", *this->testUSet_ref())) {
152 if (!v
.visitField(29, "testSet", *this->testSet_ref())) {
155 if (!v
.visitField(30, "testOptionalBool", this->testOptionalBool_ref())) {
158 if (!v
.visitField(31, "dummy31", *this->dummy31_ref())) {
161 if (!v
.visitField(32, "testIOBufList", *this->testIOBufList_ref())) {
164 if (!v
.visitField(33, "testF14FastMap", *this->testF14FastMap_ref())) {
167 if (!v
.visitField(34, "testF14NodeMap", *this->testF14NodeMap_ref())) {
170 if (!v
.visitField(35, "testF14ValueMap", *this->testF14ValueMap_ref())) {
173 if (!v
.visitField(36, "testF14VectorMap", *this->testF14VectorMap_ref())) {
176 if (!v
.visitField(37, "testF14FastSet", *this->testF14FastSet_ref())) {
179 if (!v
.visitField(38, "testF14NodeSet", *this->testF14NodeSet_ref())) {
182 if (!v
.visitField(39, "testF14ValueSet", *this->testF14ValueSet_ref())) {
185 if (!v
.visitField(40, "testF14VectorSet", *this->testF14VectorSet_ref())) {
188 if (!v
.visitField(41, "testOptionalKeywordString", this->testOptionalKeywordString_ref())) {
191 if (!v
.visitField(42, "testOptionalKeywordIobuf", this->testOptionalKeywordIobuf_ref())) {
194 if (!v
.visitField(43, "testOptionalKeywordBool", this->testOptionalKeywordBool_ref())) {
200 void TestRequest::visitFields(V
&& v
) const {
201 if (!v
.visitField(1, "key", *this->key_ref())) {
204 if (!v
.visitField(2, "dummy2", *this->dummy2_ref())) {
207 if (!v
.visitField(3, "testBool", *this->testBool_ref())) {
210 if (!v
.visitField(4, "testChar", *this->testChar_ref())) {
213 if (!v
.visitField(5, "testInt8", *this->testInt8_ref())) {
216 if (!v
.visitField(6, "testInt16", *this->testInt16_ref())) {
219 if (!v
.visitField(7, "testInt32", *this->testInt32_ref())) {
222 if (!v
.visitField(8, "testInt64", *this->testInt64_ref())) {
225 if (!v
.visitField(9, "testUInt8", *this->testUInt8_ref())) {
228 if (!v
.visitField(10, "testUInt16", *this->testUInt16_ref())) {
231 if (!v
.visitField(11, "testUInt32", *this->testUInt32_ref())) {
234 if (!v
.visitField(12, "testUInt64", *this->testUInt64_ref())) {
237 if (!v
.visitField(13, "testFloat", *this->testFloat_ref())) {
240 if (!v
.visitField(14, "testDouble", *this->testDouble_ref())) {
243 if (!v
.visitField(15, "testShortString", *this->testShortString_ref())) {
246 if (!v
.visitField(16, "testLongString", *this->testLongString_ref())) {
249 if (!v
.visitField(17, "testIobuf", *this->testIobuf_ref())) {
252 if (!v
.visitField(19, "testList", *this->testList_ref())) {
255 if (!v
.visitField(20, "testOptionalString", this->testOptionalString_ref())) {
258 if (!v
.visitField(21, "testOptionalIobuf", this->testOptionalIobuf_ref())) {
261 if (!v
.visitField(22, "dummy22", *this->dummy22_ref())) {
264 if (!v
.visitField(23, "dummy23", *this->dummy23_ref())) {
267 if (!v
.visitField(24, "testNestedVec", *this->testNestedVec_ref())) {
270 if (!v
.visitField(25, "testUMap", *this->testUMap_ref())) {
273 if (!v
.visitField(26, "testMap", *this->testMap_ref())) {
276 if (!v
.visitField(27, "testComplexMap", *this->testComplexMap_ref())) {
279 if (!v
.visitField(28, "testUSet", *this->testUSet_ref())) {
282 if (!v
.visitField(29, "testSet", *this->testSet_ref())) {
285 if (!v
.visitField(30, "testOptionalBool", this->testOptionalBool_ref())) {
288 if (!v
.visitField(31, "dummy31", *this->dummy31_ref())) {
291 if (!v
.visitField(32, "testIOBufList", *this->testIOBufList_ref())) {
294 if (!v
.visitField(33, "testF14FastMap", *this->testF14FastMap_ref())) {
297 if (!v
.visitField(34, "testF14NodeMap", *this->testF14NodeMap_ref())) {
300 if (!v
.visitField(35, "testF14ValueMap", *this->testF14ValueMap_ref())) {
303 if (!v
.visitField(36, "testF14VectorMap", *this->testF14VectorMap_ref())) {
306 if (!v
.visitField(37, "testF14FastSet", *this->testF14FastSet_ref())) {
309 if (!v
.visitField(38, "testF14NodeSet", *this->testF14NodeSet_ref())) {
312 if (!v
.visitField(39, "testF14ValueSet", *this->testF14ValueSet_ref())) {
315 if (!v
.visitField(40, "testF14VectorSet", *this->testF14VectorSet_ref())) {
318 if (!v
.visitField(41, "testOptionalKeywordString", this->testOptionalKeywordString_ref())) {
321 if (!v
.visitField(42, "testOptionalKeywordIobuf", this->testOptionalKeywordIobuf_ref())) {
324 if (!v
.visitField(43, "testOptionalKeywordBool", this->testOptionalKeywordBool_ref())) {
329 template <class Writer
>
330 void TestReply::serialize(Writer
&& writer
) const {
331 writer
.writeStructBegin();
332 writer
.writeField(1 /* field id */, result_ref());
333 writer
.writeField(2 /* field id */, valInt32_ref());
334 writer
.writeField(3 /* field id */, valInt64_ref());
335 writer
.writeFieldStop();
336 writer
.writeStructEnd();
340 void TestReply::visitFields(V
&& v
) {
341 if (!v
.visitField(1, "result", *this->result_ref())) {
344 if (!v
.visitField(2, "valInt32", *this->valInt32_ref())) {
347 if (!v
.visitField(3, "valInt64", *this->valInt64_ref())) {
353 void TestReply::visitFields(V
&& v
) const {
354 if (!v
.visitField(1, "result", *this->result_ref())) {
357 if (!v
.visitField(2, "valInt32", *this->valInt32_ref())) {
360 if (!v
.visitField(3, "valInt64", *this->valInt64_ref())) {
365 template <class Writer
>
366 void TestRequestStringKey::serialize(Writer
&& writer
) const {
367 writer
.writeStructBegin();
368 writer
.writeField(1 /* field id */, key_ref());
369 writer
.writeFieldStop();
370 writer
.writeStructEnd();
374 void TestRequestStringKey::visitFields(V
&& v
) {
375 if (!v
.visitField(1, "key", *this->key_ref())) {
381 void TestRequestStringKey::visitFields(V
&& v
) const {
382 if (!v
.visitField(1, "key", *this->key_ref())) {
387 template <class Writer
>
388 void TestReplyStringKey::serialize(Writer
&& writer
) const {
389 writer
.writeStructBegin();
390 writer
.writeField(1 /* field id */, result_ref());
391 writer
.writeFieldStop();
392 writer
.writeStructEnd();
396 void TestReplyStringKey::visitFields(V
&& v
) {
397 if (!v
.visitField(1, "result", *this->result_ref())) {
403 void TestReplyStringKey::visitFields(V
&& v
) const {
404 if (!v
.visitField(1, "result", *this->result_ref())) {
409 template <class Writer
>
410 void TestOptionalBool::serialize(Writer
&& writer
) const {
411 writer
.writeStructBegin();
412 writer
.writeField(1 /* field id */, optionalBool_ref());
413 writer
.writeFieldStop();
414 writer
.writeStructEnd();
418 void TestOptionalBool::visitFields(V
&& v
) {
419 if (!v
.visitField(1, "optionalBool", this->optionalBool_ref())) {
425 void TestOptionalBool::visitFields(V
&& v
) const {
426 if (!v
.visitField(1, "optionalBool", this->optionalBool_ref())) {
431 template <class Writer
>
432 void TestUnion::serialize(Writer
&& writer
) const {
433 writer
.writeStructBegin();
436 writer
.writeFieldAlways(1 /* field id */, *a_ref());
440 writer
.writeFieldAlways(2 /* field id */, *b_ref());
444 writer
.writeFieldAlways(3 /* field id */, *c_ref());
450 writer
.writeFieldStop();
451 writer
.writeStructEnd();
455 void TestUnion::visitFields(V
&& v
) {
458 v
.visitField(1, "a", *a_ref());
461 v
.visitField(2, "b", *b_ref());
464 v
.visitField(3, "c", *c_ref());
472 void TestUnion::visitFields(V
&& v
) const {
475 v
.visitField(1, "a", *a_ref());
478 v
.visitField(2, "b", *b_ref());
481 v
.visitField(3, "c", *c_ref());
489 void TestUnion::foreachMember(V
&& v
) {
490 if (!v
.template visitUnionMember
<uint64_t>("a", [this]() -> uint64_t& {return this->a_ref().emplace();})) {
493 if (!v
.template visitUnionMember
<uint32_t>("b", [this]() -> uint32_t& {return this->b_ref().emplace();})) {
496 if (!v
.template visitUnionMember
<uint16_t>("c", [this]() -> uint16_t& {return this->c_ref().emplace();})) {
501 template <class Writer
>
502 void TestF14Containers::serialize(Writer
&& writer
) const {
503 writer
.writeStructBegin();
504 writer
.writeField(1 /* field id */, fastMap_ref());
505 writer
.writeField(2 /* field id */, nodeMap_ref());
506 writer
.writeField(3 /* field id */, valueMap_ref());
507 writer
.writeField(4 /* field id */, vectorMap_ref());
508 writer
.writeField(5 /* field id */, fastSet_ref());
509 writer
.writeField(6 /* field id */, nodeSet_ref());
510 writer
.writeField(7 /* field id */, valueSet_ref());
511 writer
.writeField(8 /* field id */, vectorSet_ref());
512 writer
.writeFieldStop();
513 writer
.writeStructEnd();
517 void TestF14Containers::visitFields(V
&& v
) {
518 if (!v
.visitField(1, "fastMap", *this->fastMap_ref())) {
521 if (!v
.visitField(2, "nodeMap", *this->nodeMap_ref())) {
524 if (!v
.visitField(3, "valueMap", *this->valueMap_ref())) {
527 if (!v
.visitField(4, "vectorMap", *this->vectorMap_ref())) {
530 if (!v
.visitField(5, "fastSet", *this->fastSet_ref())) {
533 if (!v
.visitField(6, "nodeSet", *this->nodeSet_ref())) {
536 if (!v
.visitField(7, "valueSet", *this->valueSet_ref())) {
539 if (!v
.visitField(8, "vectorSet", *this->vectorSet_ref())) {
545 void TestF14Containers::visitFields(V
&& v
) const {
546 if (!v
.visitField(1, "fastMap", *this->fastMap_ref())) {
549 if (!v
.visitField(2, "nodeMap", *this->nodeMap_ref())) {
552 if (!v
.visitField(3, "valueMap", *this->valueMap_ref())) {
555 if (!v
.visitField(4, "vectorMap", *this->vectorMap_ref())) {
558 if (!v
.visitField(5, "fastSet", *this->fastSet_ref())) {
561 if (!v
.visitField(6, "nodeSet", *this->nodeSet_ref())) {
564 if (!v
.visitField(7, "valueSet", *this->valueSet_ref())) {
567 if (!v
.visitField(8, "vectorSet", *this->vectorSet_ref())) {
572 template <class Writer
>
573 void TestStdContainers::serialize(Writer
&& writer
) const {
574 writer
.writeStructBegin();
575 writer
.writeField(1 /* field id */, fastMap_ref());
576 writer
.writeField(2 /* field id */, nodeMap_ref());
577 writer
.writeField(3 /* field id */, valueMap_ref());
578 writer
.writeField(4 /* field id */, vectorMap_ref());
579 writer
.writeField(5 /* field id */, fastSet_ref());
580 writer
.writeField(6 /* field id */, nodeSet_ref());
581 writer
.writeField(7 /* field id */, valueSet_ref());
582 writer
.writeField(8 /* field id */, vectorSet_ref());
583 writer
.writeFieldStop();
584 writer
.writeStructEnd();
588 void TestStdContainers::visitFields(V
&& v
) {
589 if (!v
.visitField(1, "fastMap", *this->fastMap_ref())) {
592 if (!v
.visitField(2, "nodeMap", *this->nodeMap_ref())) {
595 if (!v
.visitField(3, "valueMap", *this->valueMap_ref())) {
598 if (!v
.visitField(4, "vectorMap", *this->vectorMap_ref())) {
601 if (!v
.visitField(5, "fastSet", *this->fastSet_ref())) {
604 if (!v
.visitField(6, "nodeSet", *this->nodeSet_ref())) {
607 if (!v
.visitField(7, "valueSet", *this->valueSet_ref())) {
610 if (!v
.visitField(8, "vectorSet", *this->vectorSet_ref())) {
616 void TestStdContainers::visitFields(V
&& v
) const {
617 if (!v
.visitField(1, "fastMap", *this->fastMap_ref())) {
620 if (!v
.visitField(2, "nodeMap", *this->nodeMap_ref())) {
623 if (!v
.visitField(3, "valueMap", *this->valueMap_ref())) {
626 if (!v
.visitField(4, "vectorMap", *this->vectorMap_ref())) {
629 if (!v
.visitField(5, "fastSet", *this->fastSet_ref())) {
632 if (!v
.visitField(6, "nodeSet", *this->nodeSet_ref())) {
635 if (!v
.visitField(7, "valueSet", *this->valueSet_ref())) {
638 if (!v
.visitField(8, "vectorSet", *this->vectorSet_ref())) {
643 template <class Writer
>
644 void StructWithEnumUInt32::serialize(Writer
&& writer
) const {
645 writer
.writeStructBegin();
646 writer
.writeField(1 /* field id */, testEnum_ref());
647 writer
.writeFieldStop();
648 writer
.writeStructEnd();
652 void StructWithEnumUInt32::visitFields(V
&& v
) {
653 if (!v
.visitField(1, "testEnum", *this->testEnum_ref())) {
659 void StructWithEnumUInt32::visitFields(V
&& v
) const {
660 if (!v
.visitField(1, "testEnum", *this->testEnum_ref())) {
665 template <class Writer
>
666 void StructWithEnumUInt16::serialize(Writer
&& writer
) const {
667 writer
.writeStructBegin();
668 writer
.writeField(1 /* field id */, testEnum_ref());
669 writer
.writeFieldStop();
670 writer
.writeStructEnd();
674 void StructWithEnumUInt16::visitFields(V
&& v
) {
675 if (!v
.visitField(1, "testEnum", *this->testEnum_ref())) {
681 void StructWithEnumUInt16::visitFields(V
&& v
) const {
682 if (!v
.visitField(1, "testEnum", *this->testEnum_ref())) {
687 template <class Writer
>
688 void StructWithEnumUInt8::serialize(Writer
&& writer
) const {
689 writer
.writeStructBegin();
690 writer
.writeField(1 /* field id */, testEnum_ref());
691 writer
.writeFieldStop();
692 writer
.writeStructEnd();
696 void StructWithEnumUInt8::visitFields(V
&& v
) {
697 if (!v
.visitField(1, "testEnum", *this->testEnum_ref())) {
703 void StructWithEnumUInt8::visitFields(V
&& v
) const {
704 if (!v
.visitField(1, "testEnum", *this->testEnum_ref())) {
709 template <class Writer
>
710 void StructWithEnumInt32::serialize(Writer
&& writer
) const {
711 writer
.writeStructBegin();
712 writer
.writeField(1 /* field id */, testEnum_ref());
713 writer
.writeFieldStop();
714 writer
.writeStructEnd();
718 void StructWithEnumInt32::visitFields(V
&& v
) {
719 if (!v
.visitField(1, "testEnum", *this->testEnum_ref())) {
725 void StructWithEnumInt32::visitFields(V
&& v
) const {
726 if (!v
.visitField(1, "testEnum", *this->testEnum_ref())) {
731 template <class Writer
>
732 void StructWithEnumInt16::serialize(Writer
&& writer
) const {
733 writer
.writeStructBegin();
734 writer
.writeField(1 /* field id */, testEnum_ref());
735 writer
.writeFieldStop();
736 writer
.writeStructEnd();
740 void StructWithEnumInt16::visitFields(V
&& v
) {
741 if (!v
.visitField(1, "testEnum", *this->testEnum_ref())) {
747 void StructWithEnumInt16::visitFields(V
&& v
) const {
748 if (!v
.visitField(1, "testEnum", *this->testEnum_ref())) {
753 template <class Writer
>
754 void StructWithEnumInt8::serialize(Writer
&& writer
) const {
755 writer
.writeStructBegin();
756 writer
.writeField(1 /* field id */, testEnum_ref());
757 writer
.writeFieldStop();
758 writer
.writeStructEnd();
762 void StructWithEnumInt8::visitFields(V
&& v
) {
763 if (!v
.visitField(1, "testEnum", *this->testEnum_ref())) {
769 void StructWithEnumInt8::visitFields(V
&& v
) const {
770 if (!v
.visitField(1, "testEnum", *this->testEnum_ref())) {
775 template <class Writer
>
776 void StructWithOptionalEnumUInt32::serialize(Writer
&& writer
) const {
777 writer
.writeStructBegin();
778 writer
.writeField(1 /* field id */, testEnum_ref());
779 writer
.writeField(2 /* field id */, testEmptyEnum_ref());
780 writer
.writeFieldStop();
781 writer
.writeStructEnd();
785 void StructWithOptionalEnumUInt32::visitFields(V
&& v
) {
786 if (!v
.visitField(1, "testEnum", this->testEnum_ref())) {
789 if (!v
.visitField(2, "testEmptyEnum", this->testEmptyEnum_ref())) {
795 void StructWithOptionalEnumUInt32::visitFields(V
&& v
) const {
796 if (!v
.visitField(1, "testEnum", this->testEnum_ref())) {
799 if (!v
.visitField(2, "testEmptyEnum", this->testEmptyEnum_ref())) {
804 template <class Writer
>
805 void StructWithOptionalEnumUInt16::serialize(Writer
&& writer
) const {
806 writer
.writeStructBegin();
807 writer
.writeField(1 /* field id */, testEnum_ref());
808 writer
.writeField(2 /* field id */, testEmptyEnum_ref());
809 writer
.writeFieldStop();
810 writer
.writeStructEnd();
814 void StructWithOptionalEnumUInt16::visitFields(V
&& v
) {
815 if (!v
.visitField(1, "testEnum", this->testEnum_ref())) {
818 if (!v
.visitField(2, "testEmptyEnum", this->testEmptyEnum_ref())) {
824 void StructWithOptionalEnumUInt16::visitFields(V
&& v
) const {
825 if (!v
.visitField(1, "testEnum", this->testEnum_ref())) {
828 if (!v
.visitField(2, "testEmptyEnum", this->testEmptyEnum_ref())) {
833 template <class Writer
>
834 void StructWithOptionalEnumUInt8::serialize(Writer
&& writer
) const {
835 writer
.writeStructBegin();
836 writer
.writeField(1 /* field id */, testEnum_ref());
837 writer
.writeField(2 /* field id */, testEmptyEnum_ref());
838 writer
.writeFieldStop();
839 writer
.writeStructEnd();
843 void StructWithOptionalEnumUInt8::visitFields(V
&& v
) {
844 if (!v
.visitField(1, "testEnum", this->testEnum_ref())) {
847 if (!v
.visitField(2, "testEmptyEnum", this->testEmptyEnum_ref())) {
853 void StructWithOptionalEnumUInt8::visitFields(V
&& v
) const {
854 if (!v
.visitField(1, "testEnum", this->testEnum_ref())) {
857 if (!v
.visitField(2, "testEmptyEnum", this->testEmptyEnum_ref())) {
862 template <class Writer
>
863 void StructWithOptionalEnumInt32::serialize(Writer
&& writer
) const {
864 writer
.writeStructBegin();
865 writer
.writeField(1 /* field id */, testEnum_ref());
866 writer
.writeField(2 /* field id */, testEmptyEnum_ref());
867 writer
.writeFieldStop();
868 writer
.writeStructEnd();
872 void StructWithOptionalEnumInt32::visitFields(V
&& v
) {
873 if (!v
.visitField(1, "testEnum", this->testEnum_ref())) {
876 if (!v
.visitField(2, "testEmptyEnum", this->testEmptyEnum_ref())) {
882 void StructWithOptionalEnumInt32::visitFields(V
&& v
) const {
883 if (!v
.visitField(1, "testEnum", this->testEnum_ref())) {
886 if (!v
.visitField(2, "testEmptyEnum", this->testEmptyEnum_ref())) {
891 template <class Writer
>
892 void StructWithOptionalEnumInt16::serialize(Writer
&& writer
) const {
893 writer
.writeStructBegin();
894 writer
.writeField(1 /* field id */, testEnum_ref());
895 writer
.writeField(2 /* field id */, testEmptyEnum_ref());
896 writer
.writeFieldStop();
897 writer
.writeStructEnd();
901 void StructWithOptionalEnumInt16::visitFields(V
&& v
) {
902 if (!v
.visitField(1, "testEnum", this->testEnum_ref())) {
905 if (!v
.visitField(2, "testEmptyEnum", this->testEmptyEnum_ref())) {
911 void StructWithOptionalEnumInt16::visitFields(V
&& v
) const {
912 if (!v
.visitField(1, "testEnum", this->testEnum_ref())) {
915 if (!v
.visitField(2, "testEmptyEnum", this->testEmptyEnum_ref())) {
920 template <class Writer
>
921 void StructWithOptionalEnumInt8::serialize(Writer
&& writer
) const {
922 writer
.writeStructBegin();
923 writer
.writeField(1 /* field id */, testEnum_ref());
924 writer
.writeField(2 /* field id */, testEmptyEnum_ref());
925 writer
.writeFieldStop();
926 writer
.writeStructEnd();
930 void StructWithOptionalEnumInt8::visitFields(V
&& v
) {
931 if (!v
.visitField(1, "testEnum", this->testEnum_ref())) {
934 if (!v
.visitField(2, "testEmptyEnum", this->testEmptyEnum_ref())) {
940 void StructWithOptionalEnumInt8::visitFields(V
&& v
) const {
941 if (!v
.visitField(1, "testEnum", this->testEnum_ref())) {
944 if (!v
.visitField(2, "testEmptyEnum", this->testEmptyEnum_ref())) {
948 } // namespace thrift
950 } // namespace carbon
955 class Cpp2Ops
<carbon::test::TestRequest
> {
957 typedef carbon::test::TestRequest Type
;
958 static constexpr protocol::TType
thriftType() {
959 return protocol::T_STRUCT
;
961 template <class Protocol
>
962 static uint32_t write(Protocol
* prot
, const Type
* value
) {
963 return value
->write(prot
);
965 template <class Protocol
>
966 static void read(Protocol
* prot
, Type
* value
) {
969 template <class Protocol
>
970 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
971 return value
->serializedSize(prot
);
973 template <class Protocol
>
974 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
975 return value
->serializedSizeZC(prot
);
980 class Cpp2Ops
<carbon::test::TestReply
> {
982 typedef carbon::test::TestReply Type
;
983 static constexpr protocol::TType
thriftType() {
984 return protocol::T_STRUCT
;
986 template <class Protocol
>
987 static uint32_t write(Protocol
* prot
, const Type
* value
) {
988 return value
->write(prot
);
990 template <class Protocol
>
991 static void read(Protocol
* prot
, Type
* value
) {
994 template <class Protocol
>
995 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
996 return value
->serializedSize(prot
);
998 template <class Protocol
>
999 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1000 return value
->serializedSizeZC(prot
);
1005 class Cpp2Ops
<carbon::test::TestRequestStringKey
> {
1007 typedef carbon::test::TestRequestStringKey Type
;
1008 static constexpr protocol::TType
thriftType() {
1009 return protocol::T_STRUCT
;
1011 template <class Protocol
>
1012 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1013 return value
->write(prot
);
1015 template <class Protocol
>
1016 static void read(Protocol
* prot
, Type
* value
) {
1019 template <class Protocol
>
1020 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1021 return value
->serializedSize(prot
);
1023 template <class Protocol
>
1024 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1025 return value
->serializedSizeZC(prot
);
1030 class Cpp2Ops
<carbon::test::TestReplyStringKey
> {
1032 typedef carbon::test::TestReplyStringKey Type
;
1033 static constexpr protocol::TType
thriftType() {
1034 return protocol::T_STRUCT
;
1036 template <class Protocol
>
1037 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1038 return value
->write(prot
);
1040 template <class Protocol
>
1041 static void read(Protocol
* prot
, Type
* value
) {
1044 template <class Protocol
>
1045 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1046 return value
->serializedSize(prot
);
1048 template <class Protocol
>
1049 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1050 return value
->serializedSizeZC(prot
);
1055 class Cpp2Ops
<carbon::test::TestOptionalBool
> {
1057 typedef carbon::test::TestOptionalBool Type
;
1058 static constexpr protocol::TType
thriftType() {
1059 return protocol::T_STRUCT
;
1061 template <class Protocol
>
1062 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1063 return value
->write(prot
);
1065 template <class Protocol
>
1066 static void read(Protocol
* prot
, Type
* value
) {
1069 template <class Protocol
>
1070 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1071 return value
->serializedSize(prot
);
1073 template <class Protocol
>
1074 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1075 return value
->serializedSizeZC(prot
);
1080 class Cpp2Ops
<carbon::test::TestUnion
> {
1082 typedef carbon::test::TestUnion Type
;
1083 static constexpr protocol::TType
thriftType() {
1084 return protocol::T_STRUCT
;
1086 template <class Protocol
>
1087 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1088 return value
->write(prot
);
1090 template <class Protocol
>
1091 static void read(Protocol
* prot
, Type
* value
) {
1094 template <class Protocol
>
1095 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1096 return value
->serializedSize(prot
);
1098 template <class Protocol
>
1099 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1100 return value
->serializedSizeZC(prot
);
1105 class Cpp2Ops
<carbon::test::TestF14Containers
> {
1107 typedef carbon::test::TestF14Containers Type
;
1108 static constexpr protocol::TType
thriftType() {
1109 return protocol::T_STRUCT
;
1111 template <class Protocol
>
1112 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1113 return value
->write(prot
);
1115 template <class Protocol
>
1116 static void read(Protocol
* prot
, Type
* value
) {
1119 template <class Protocol
>
1120 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1121 return value
->serializedSize(prot
);
1123 template <class Protocol
>
1124 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1125 return value
->serializedSizeZC(prot
);
1130 class Cpp2Ops
<carbon::test::TestStdContainers
> {
1132 typedef carbon::test::TestStdContainers Type
;
1133 static constexpr protocol::TType
thriftType() {
1134 return protocol::T_STRUCT
;
1136 template <class Protocol
>
1137 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1138 return value
->write(prot
);
1140 template <class Protocol
>
1141 static void read(Protocol
* prot
, Type
* value
) {
1144 template <class Protocol
>
1145 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1146 return value
->serializedSize(prot
);
1148 template <class Protocol
>
1149 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1150 return value
->serializedSizeZC(prot
);
1155 class Cpp2Ops
<carbon::test::StructWithEnumUInt32
> {
1157 typedef carbon::test::StructWithEnumUInt32 Type
;
1158 static constexpr protocol::TType
thriftType() {
1159 return protocol::T_STRUCT
;
1161 template <class Protocol
>
1162 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1163 return value
->write(prot
);
1165 template <class Protocol
>
1166 static void read(Protocol
* prot
, Type
* value
) {
1169 template <class Protocol
>
1170 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1171 return value
->serializedSize(prot
);
1173 template <class Protocol
>
1174 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1175 return value
->serializedSizeZC(prot
);
1180 class Cpp2Ops
<carbon::test::StructWithEnumUInt16
> {
1182 typedef carbon::test::StructWithEnumUInt16 Type
;
1183 static constexpr protocol::TType
thriftType() {
1184 return protocol::T_STRUCT
;
1186 template <class Protocol
>
1187 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1188 return value
->write(prot
);
1190 template <class Protocol
>
1191 static void read(Protocol
* prot
, Type
* value
) {
1194 template <class Protocol
>
1195 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1196 return value
->serializedSize(prot
);
1198 template <class Protocol
>
1199 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1200 return value
->serializedSizeZC(prot
);
1205 class Cpp2Ops
<carbon::test::StructWithEnumUInt8
> {
1207 typedef carbon::test::StructWithEnumUInt8 Type
;
1208 static constexpr protocol::TType
thriftType() {
1209 return protocol::T_STRUCT
;
1211 template <class Protocol
>
1212 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1213 return value
->write(prot
);
1215 template <class Protocol
>
1216 static void read(Protocol
* prot
, Type
* value
) {
1219 template <class Protocol
>
1220 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1221 return value
->serializedSize(prot
);
1223 template <class Protocol
>
1224 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1225 return value
->serializedSizeZC(prot
);
1230 class Cpp2Ops
<carbon::test::StructWithEnumInt32
> {
1232 typedef carbon::test::StructWithEnumInt32 Type
;
1233 static constexpr protocol::TType
thriftType() {
1234 return protocol::T_STRUCT
;
1236 template <class Protocol
>
1237 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1238 return value
->write(prot
);
1240 template <class Protocol
>
1241 static void read(Protocol
* prot
, Type
* value
) {
1244 template <class Protocol
>
1245 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1246 return value
->serializedSize(prot
);
1248 template <class Protocol
>
1249 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1250 return value
->serializedSizeZC(prot
);
1255 class Cpp2Ops
<carbon::test::StructWithEnumInt16
> {
1257 typedef carbon::test::StructWithEnumInt16 Type
;
1258 static constexpr protocol::TType
thriftType() {
1259 return protocol::T_STRUCT
;
1261 template <class Protocol
>
1262 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1263 return value
->write(prot
);
1265 template <class Protocol
>
1266 static void read(Protocol
* prot
, Type
* value
) {
1269 template <class Protocol
>
1270 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1271 return value
->serializedSize(prot
);
1273 template <class Protocol
>
1274 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1275 return value
->serializedSizeZC(prot
);
1280 class Cpp2Ops
<carbon::test::StructWithEnumInt8
> {
1282 typedef carbon::test::StructWithEnumInt8 Type
;
1283 static constexpr protocol::TType
thriftType() {
1284 return protocol::T_STRUCT
;
1286 template <class Protocol
>
1287 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1288 return value
->write(prot
);
1290 template <class Protocol
>
1291 static void read(Protocol
* prot
, Type
* value
) {
1294 template <class Protocol
>
1295 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1296 return value
->serializedSize(prot
);
1298 template <class Protocol
>
1299 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1300 return value
->serializedSizeZC(prot
);
1305 class Cpp2Ops
<carbon::test::StructWithOptionalEnumUInt32
> {
1307 typedef carbon::test::StructWithOptionalEnumUInt32 Type
;
1308 static constexpr protocol::TType
thriftType() {
1309 return protocol::T_STRUCT
;
1311 template <class Protocol
>
1312 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1313 return value
->write(prot
);
1315 template <class Protocol
>
1316 static void read(Protocol
* prot
, Type
* value
) {
1319 template <class Protocol
>
1320 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1321 return value
->serializedSize(prot
);
1323 template <class Protocol
>
1324 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1325 return value
->serializedSizeZC(prot
);
1330 class Cpp2Ops
<carbon::test::StructWithOptionalEnumUInt16
> {
1332 typedef carbon::test::StructWithOptionalEnumUInt16 Type
;
1333 static constexpr protocol::TType
thriftType() {
1334 return protocol::T_STRUCT
;
1336 template <class Protocol
>
1337 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1338 return value
->write(prot
);
1340 template <class Protocol
>
1341 static void read(Protocol
* prot
, Type
* value
) {
1344 template <class Protocol
>
1345 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1346 return value
->serializedSize(prot
);
1348 template <class Protocol
>
1349 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1350 return value
->serializedSizeZC(prot
);
1355 class Cpp2Ops
<carbon::test::StructWithOptionalEnumUInt8
> {
1357 typedef carbon::test::StructWithOptionalEnumUInt8 Type
;
1358 static constexpr protocol::TType
thriftType() {
1359 return protocol::T_STRUCT
;
1361 template <class Protocol
>
1362 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1363 return value
->write(prot
);
1365 template <class Protocol
>
1366 static void read(Protocol
* prot
, Type
* value
) {
1369 template <class Protocol
>
1370 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1371 return value
->serializedSize(prot
);
1373 template <class Protocol
>
1374 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1375 return value
->serializedSizeZC(prot
);
1380 class Cpp2Ops
<carbon::test::StructWithOptionalEnumInt32
> {
1382 typedef carbon::test::StructWithOptionalEnumInt32 Type
;
1383 static constexpr protocol::TType
thriftType() {
1384 return protocol::T_STRUCT
;
1386 template <class Protocol
>
1387 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1388 return value
->write(prot
);
1390 template <class Protocol
>
1391 static void read(Protocol
* prot
, Type
* value
) {
1394 template <class Protocol
>
1395 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1396 return value
->serializedSize(prot
);
1398 template <class Protocol
>
1399 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1400 return value
->serializedSizeZC(prot
);
1405 class Cpp2Ops
<carbon::test::StructWithOptionalEnumInt16
> {
1407 typedef carbon::test::StructWithOptionalEnumInt16 Type
;
1408 static constexpr protocol::TType
thriftType() {
1409 return protocol::T_STRUCT
;
1411 template <class Protocol
>
1412 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1413 return value
->write(prot
);
1415 template <class Protocol
>
1416 static void read(Protocol
* prot
, Type
* value
) {
1419 template <class Protocol
>
1420 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1421 return value
->serializedSize(prot
);
1423 template <class Protocol
>
1424 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1425 return value
->serializedSizeZC(prot
);
1430 class Cpp2Ops
<carbon::test::StructWithOptionalEnumInt8
> {
1432 typedef carbon::test::StructWithOptionalEnumInt8 Type
;
1433 static constexpr protocol::TType
thriftType() {
1434 return protocol::T_STRUCT
;
1436 template <class Protocol
>
1437 static uint32_t write(Protocol
* prot
, const Type
* value
) {
1438 return value
->write(prot
);
1440 template <class Protocol
>
1441 static void read(Protocol
* prot
, Type
* value
) {
1444 template <class Protocol
>
1445 static uint32_t serializedSize(Protocol
* prot
, const Type
* value
) {
1446 return value
->serializedSize(prot
);
1448 template <class Protocol
>
1449 static uint32_t serializedSizeZC(Protocol
* prot
, const Type
* value
) {
1450 return value
->serializedSizeZC(prot
);
1453 } // namespace thrift
1454 } // namespace apache