]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/exporters/jaeger/thrift-gen/jaeger_types.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / exporters / jaeger / thrift-gen / jaeger_types.cpp
1 /**
2 * Autogenerated by Thrift Compiler (0.14.0)
3 *
4 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5 * @generated
6 */
7 #include "jaeger_types.h"
8
9 #include <algorithm>
10 #include <ostream>
11
12 #include <thrift/TToString.h>
13
14 namespace jaegertracing { namespace thrift {
15
16 int _kTagTypeValues[] = {
17 TagType::STRING,
18 TagType::DOUBLE,
19 TagType::BOOL,
20 TagType::LONG,
21 TagType::BINARY
22 };
23 const char* _kTagTypeNames[] = {
24 "STRING",
25 "DOUBLE",
26 "BOOL",
27 "LONG",
28 "BINARY"
29 };
30 const std::map<int, const char*> _TagType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(5, _kTagTypeValues, _kTagTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr));
31
32 std::ostream& operator<<(std::ostream& out, const TagType::type& val) {
33 std::map<int, const char*>::const_iterator it = _TagType_VALUES_TO_NAMES.find(val);
34 if (it != _TagType_VALUES_TO_NAMES.end()) {
35 out << it->second;
36 } else {
37 out << static_cast<int>(val);
38 }
39 return out;
40 }
41
42 std::string to_string(const TagType::type& val) {
43 std::map<int, const char*>::const_iterator it = _TagType_VALUES_TO_NAMES.find(val);
44 if (it != _TagType_VALUES_TO_NAMES.end()) {
45 return std::string(it->second);
46 } else {
47 return std::to_string(static_cast<int>(val));
48 }
49 }
50
51 int _kSpanRefTypeValues[] = {
52 SpanRefType::CHILD_OF,
53 SpanRefType::FOLLOWS_FROM
54 };
55 const char* _kSpanRefTypeNames[] = {
56 "CHILD_OF",
57 "FOLLOWS_FROM"
58 };
59 const std::map<int, const char*> _SpanRefType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(2, _kSpanRefTypeValues, _kSpanRefTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr));
60
61 std::ostream& operator<<(std::ostream& out, const SpanRefType::type& val) {
62 std::map<int, const char*>::const_iterator it = _SpanRefType_VALUES_TO_NAMES.find(val);
63 if (it != _SpanRefType_VALUES_TO_NAMES.end()) {
64 out << it->second;
65 } else {
66 out << static_cast<int>(val);
67 }
68 return out;
69 }
70
71 std::string to_string(const SpanRefType::type& val) {
72 std::map<int, const char*>::const_iterator it = _SpanRefType_VALUES_TO_NAMES.find(val);
73 if (it != _SpanRefType_VALUES_TO_NAMES.end()) {
74 return std::string(it->second);
75 } else {
76 return std::to_string(static_cast<int>(val));
77 }
78 }
79
80
81 Tag::~Tag() noexcept {
82 }
83
84
85 void Tag::__set_key(const std::string& val) {
86 this->key = val;
87 }
88
89 void Tag::__set_vType(const TagType::type val) {
90 this->vType = val;
91 }
92
93 void Tag::__set_vStr(const std::string& val) {
94 this->vStr = val;
95 __isset.vStr = true;
96 }
97
98 void Tag::__set_vDouble(const double val) {
99 this->vDouble = val;
100 __isset.vDouble = true;
101 }
102
103 void Tag::__set_vBool(const bool val) {
104 this->vBool = val;
105 __isset.vBool = true;
106 }
107
108 void Tag::__set_vLong(const int64_t val) {
109 this->vLong = val;
110 __isset.vLong = true;
111 }
112
113 void Tag::__set_vBinary(const std::string& val) {
114 this->vBinary = val;
115 __isset.vBinary = true;
116 }
117 std::ostream& operator<<(std::ostream& out, const Tag& obj)
118 {
119 obj.printTo(out);
120 return out;
121 }
122
123
124 uint32_t Tag::read(::apache::thrift::protocol::TProtocol* iprot) {
125
126 ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
127 uint32_t xfer = 0;
128 std::string fname;
129 ::apache::thrift::protocol::TType ftype;
130 int16_t fid;
131
132 xfer += iprot->readStructBegin(fname);
133
134 using ::apache::thrift::protocol::TProtocolException;
135
136 bool isset_key = false;
137 bool isset_vType = false;
138
139 while (true)
140 {
141 xfer += iprot->readFieldBegin(fname, ftype, fid);
142 if (ftype == ::apache::thrift::protocol::T_STOP) {
143 break;
144 }
145 switch (fid)
146 {
147 case 1:
148 if (ftype == ::apache::thrift::protocol::T_STRING) {
149 xfer += iprot->readString(this->key);
150 isset_key = true;
151 } else {
152 xfer += iprot->skip(ftype);
153 }
154 break;
155 case 2:
156 if (ftype == ::apache::thrift::protocol::T_I32) {
157 int32_t ecast0;
158 xfer += iprot->readI32(ecast0);
159 this->vType = (TagType::type)ecast0;
160 isset_vType = true;
161 } else {
162 xfer += iprot->skip(ftype);
163 }
164 break;
165 case 3:
166 if (ftype == ::apache::thrift::protocol::T_STRING) {
167 xfer += iprot->readString(this->vStr);
168 this->__isset.vStr = true;
169 } else {
170 xfer += iprot->skip(ftype);
171 }
172 break;
173 case 4:
174 if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
175 xfer += iprot->readDouble(this->vDouble);
176 this->__isset.vDouble = true;
177 } else {
178 xfer += iprot->skip(ftype);
179 }
180 break;
181 case 5:
182 if (ftype == ::apache::thrift::protocol::T_BOOL) {
183 xfer += iprot->readBool(this->vBool);
184 this->__isset.vBool = true;
185 } else {
186 xfer += iprot->skip(ftype);
187 }
188 break;
189 case 6:
190 if (ftype == ::apache::thrift::protocol::T_I64) {
191 xfer += iprot->readI64(this->vLong);
192 this->__isset.vLong = true;
193 } else {
194 xfer += iprot->skip(ftype);
195 }
196 break;
197 case 7:
198 if (ftype == ::apache::thrift::protocol::T_STRING) {
199 xfer += iprot->readBinary(this->vBinary);
200 this->__isset.vBinary = true;
201 } else {
202 xfer += iprot->skip(ftype);
203 }
204 break;
205 default:
206 xfer += iprot->skip(ftype);
207 break;
208 }
209 xfer += iprot->readFieldEnd();
210 }
211
212 xfer += iprot->readStructEnd();
213
214 if (!isset_key)
215 throw TProtocolException(TProtocolException::INVALID_DATA);
216 if (!isset_vType)
217 throw TProtocolException(TProtocolException::INVALID_DATA);
218 return xfer;
219 }
220
221 uint32_t Tag::write(::apache::thrift::protocol::TProtocol* oprot) const {
222 uint32_t xfer = 0;
223 ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
224 xfer += oprot->writeStructBegin("Tag");
225
226 xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
227 xfer += oprot->writeString(this->key);
228 xfer += oprot->writeFieldEnd();
229
230 xfer += oprot->writeFieldBegin("vType", ::apache::thrift::protocol::T_I32, 2);
231 xfer += oprot->writeI32((int32_t)this->vType);
232 xfer += oprot->writeFieldEnd();
233
234 if (this->__isset.vStr) {
235 xfer += oprot->writeFieldBegin("vStr", ::apache::thrift::protocol::T_STRING, 3);
236 xfer += oprot->writeString(this->vStr);
237 xfer += oprot->writeFieldEnd();
238 }
239 if (this->__isset.vDouble) {
240 xfer += oprot->writeFieldBegin("vDouble", ::apache::thrift::protocol::T_DOUBLE, 4);
241 xfer += oprot->writeDouble(this->vDouble);
242 xfer += oprot->writeFieldEnd();
243 }
244 if (this->__isset.vBool) {
245 xfer += oprot->writeFieldBegin("vBool", ::apache::thrift::protocol::T_BOOL, 5);
246 xfer += oprot->writeBool(this->vBool);
247 xfer += oprot->writeFieldEnd();
248 }
249 if (this->__isset.vLong) {
250 xfer += oprot->writeFieldBegin("vLong", ::apache::thrift::protocol::T_I64, 6);
251 xfer += oprot->writeI64(this->vLong);
252 xfer += oprot->writeFieldEnd();
253 }
254 if (this->__isset.vBinary) {
255 xfer += oprot->writeFieldBegin("vBinary", ::apache::thrift::protocol::T_STRING, 7);
256 xfer += oprot->writeBinary(this->vBinary);
257 xfer += oprot->writeFieldEnd();
258 }
259 xfer += oprot->writeFieldStop();
260 xfer += oprot->writeStructEnd();
261 return xfer;
262 }
263
264 void swap(Tag &a, Tag &b) {
265 using ::std::swap;
266 swap(a.key, b.key);
267 swap(a.vType, b.vType);
268 swap(a.vStr, b.vStr);
269 swap(a.vDouble, b.vDouble);
270 swap(a.vBool, b.vBool);
271 swap(a.vLong, b.vLong);
272 swap(a.vBinary, b.vBinary);
273 swap(a.__isset, b.__isset);
274 }
275
276 Tag::Tag(const Tag& other1) {
277 key = other1.key;
278 vType = other1.vType;
279 vStr = other1.vStr;
280 vDouble = other1.vDouble;
281 vBool = other1.vBool;
282 vLong = other1.vLong;
283 vBinary = other1.vBinary;
284 __isset = other1.__isset;
285 }
286 Tag& Tag::operator=(const Tag& other2) {
287 key = other2.key;
288 vType = other2.vType;
289 vStr = other2.vStr;
290 vDouble = other2.vDouble;
291 vBool = other2.vBool;
292 vLong = other2.vLong;
293 vBinary = other2.vBinary;
294 __isset = other2.__isset;
295 return *this;
296 }
297 void Tag::printTo(std::ostream& out) const {
298 using ::apache::thrift::to_string;
299 out << "Tag(";
300 out << "key=" << to_string(key);
301 out << ", " << "vType=" << to_string(vType);
302 out << ", " << "vStr="; (__isset.vStr ? (out << to_string(vStr)) : (out << "<null>"));
303 out << ", " << "vDouble="; (__isset.vDouble ? (out << to_string(vDouble)) : (out << "<null>"));
304 out << ", " << "vBool="; (__isset.vBool ? (out << to_string(vBool)) : (out << "<null>"));
305 out << ", " << "vLong="; (__isset.vLong ? (out << to_string(vLong)) : (out << "<null>"));
306 out << ", " << "vBinary="; (__isset.vBinary ? (out << to_string(vBinary)) : (out << "<null>"));
307 out << ")";
308 }
309
310
311 Log::~Log() noexcept {
312 }
313
314
315 void Log::__set_timestamp(const int64_t val) {
316 this->timestamp = val;
317 }
318
319 void Log::__set_fields(const std::vector<Tag> & val) {
320 this->fields = val;
321 }
322 std::ostream& operator<<(std::ostream& out, const Log& obj)
323 {
324 obj.printTo(out);
325 return out;
326 }
327
328
329 uint32_t Log::read(::apache::thrift::protocol::TProtocol* iprot) {
330
331 ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
332 uint32_t xfer = 0;
333 std::string fname;
334 ::apache::thrift::protocol::TType ftype;
335 int16_t fid;
336
337 xfer += iprot->readStructBegin(fname);
338
339 using ::apache::thrift::protocol::TProtocolException;
340
341 bool isset_timestamp = false;
342 bool isset_fields = false;
343
344 while (true)
345 {
346 xfer += iprot->readFieldBegin(fname, ftype, fid);
347 if (ftype == ::apache::thrift::protocol::T_STOP) {
348 break;
349 }
350 switch (fid)
351 {
352 case 1:
353 if (ftype == ::apache::thrift::protocol::T_I64) {
354 xfer += iprot->readI64(this->timestamp);
355 isset_timestamp = true;
356 } else {
357 xfer += iprot->skip(ftype);
358 }
359 break;
360 case 2:
361 if (ftype == ::apache::thrift::protocol::T_LIST) {
362 {
363 this->fields.clear();
364 uint32_t _size3;
365 ::apache::thrift::protocol::TType _etype6;
366 xfer += iprot->readListBegin(_etype6, _size3);
367 this->fields.resize(_size3);
368 uint32_t _i7;
369 for (_i7 = 0; _i7 < _size3; ++_i7)
370 {
371 xfer += this->fields[_i7].read(iprot);
372 }
373 xfer += iprot->readListEnd();
374 }
375 isset_fields = true;
376 } else {
377 xfer += iprot->skip(ftype);
378 }
379 break;
380 default:
381 xfer += iprot->skip(ftype);
382 break;
383 }
384 xfer += iprot->readFieldEnd();
385 }
386
387 xfer += iprot->readStructEnd();
388
389 if (!isset_timestamp)
390 throw TProtocolException(TProtocolException::INVALID_DATA);
391 if (!isset_fields)
392 throw TProtocolException(TProtocolException::INVALID_DATA);
393 return xfer;
394 }
395
396 uint32_t Log::write(::apache::thrift::protocol::TProtocol* oprot) const {
397 uint32_t xfer = 0;
398 ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
399 xfer += oprot->writeStructBegin("Log");
400
401 xfer += oprot->writeFieldBegin("timestamp", ::apache::thrift::protocol::T_I64, 1);
402 xfer += oprot->writeI64(this->timestamp);
403 xfer += oprot->writeFieldEnd();
404
405 xfer += oprot->writeFieldBegin("fields", ::apache::thrift::protocol::T_LIST, 2);
406 {
407 xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->fields.size()));
408 std::vector<Tag> ::const_iterator _iter8;
409 for (_iter8 = this->fields.begin(); _iter8 != this->fields.end(); ++_iter8)
410 {
411 xfer += (*_iter8).write(oprot);
412 }
413 xfer += oprot->writeListEnd();
414 }
415 xfer += oprot->writeFieldEnd();
416
417 xfer += oprot->writeFieldStop();
418 xfer += oprot->writeStructEnd();
419 return xfer;
420 }
421
422 void swap(Log &a, Log &b) {
423 using ::std::swap;
424 swap(a.timestamp, b.timestamp);
425 swap(a.fields, b.fields);
426 }
427
428 Log::Log(const Log& other9) {
429 timestamp = other9.timestamp;
430 fields = other9.fields;
431 }
432 Log& Log::operator=(const Log& other10) {
433 timestamp = other10.timestamp;
434 fields = other10.fields;
435 return *this;
436 }
437 void Log::printTo(std::ostream& out) const {
438 using ::apache::thrift::to_string;
439 out << "Log(";
440 out << "timestamp=" << to_string(timestamp);
441 out << ", " << "fields=" << to_string(fields);
442 out << ")";
443 }
444
445
446 SpanRef::~SpanRef() noexcept {
447 }
448
449
450 void SpanRef::__set_refType(const SpanRefType::type val) {
451 this->refType = val;
452 }
453
454 void SpanRef::__set_traceIdLow(const int64_t val) {
455 this->traceIdLow = val;
456 }
457
458 void SpanRef::__set_traceIdHigh(const int64_t val) {
459 this->traceIdHigh = val;
460 }
461
462 void SpanRef::__set_spanId(const int64_t val) {
463 this->spanId = val;
464 }
465 std::ostream& operator<<(std::ostream& out, const SpanRef& obj)
466 {
467 obj.printTo(out);
468 return out;
469 }
470
471
472 uint32_t SpanRef::read(::apache::thrift::protocol::TProtocol* iprot) {
473
474 ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
475 uint32_t xfer = 0;
476 std::string fname;
477 ::apache::thrift::protocol::TType ftype;
478 int16_t fid;
479
480 xfer += iprot->readStructBegin(fname);
481
482 using ::apache::thrift::protocol::TProtocolException;
483
484 bool isset_refType = false;
485 bool isset_traceIdLow = false;
486 bool isset_traceIdHigh = false;
487 bool isset_spanId = false;
488
489 while (true)
490 {
491 xfer += iprot->readFieldBegin(fname, ftype, fid);
492 if (ftype == ::apache::thrift::protocol::T_STOP) {
493 break;
494 }
495 switch (fid)
496 {
497 case 1:
498 if (ftype == ::apache::thrift::protocol::T_I32) {
499 int32_t ecast11;
500 xfer += iprot->readI32(ecast11);
501 this->refType = (SpanRefType::type)ecast11;
502 isset_refType = true;
503 } else {
504 xfer += iprot->skip(ftype);
505 }
506 break;
507 case 2:
508 if (ftype == ::apache::thrift::protocol::T_I64) {
509 xfer += iprot->readI64(this->traceIdLow);
510 isset_traceIdLow = true;
511 } else {
512 xfer += iprot->skip(ftype);
513 }
514 break;
515 case 3:
516 if (ftype == ::apache::thrift::protocol::T_I64) {
517 xfer += iprot->readI64(this->traceIdHigh);
518 isset_traceIdHigh = true;
519 } else {
520 xfer += iprot->skip(ftype);
521 }
522 break;
523 case 4:
524 if (ftype == ::apache::thrift::protocol::T_I64) {
525 xfer += iprot->readI64(this->spanId);
526 isset_spanId = true;
527 } else {
528 xfer += iprot->skip(ftype);
529 }
530 break;
531 default:
532 xfer += iprot->skip(ftype);
533 break;
534 }
535 xfer += iprot->readFieldEnd();
536 }
537
538 xfer += iprot->readStructEnd();
539
540 if (!isset_refType)
541 throw TProtocolException(TProtocolException::INVALID_DATA);
542 if (!isset_traceIdLow)
543 throw TProtocolException(TProtocolException::INVALID_DATA);
544 if (!isset_traceIdHigh)
545 throw TProtocolException(TProtocolException::INVALID_DATA);
546 if (!isset_spanId)
547 throw TProtocolException(TProtocolException::INVALID_DATA);
548 return xfer;
549 }
550
551 uint32_t SpanRef::write(::apache::thrift::protocol::TProtocol* oprot) const {
552 uint32_t xfer = 0;
553 ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
554 xfer += oprot->writeStructBegin("SpanRef");
555
556 xfer += oprot->writeFieldBegin("refType", ::apache::thrift::protocol::T_I32, 1);
557 xfer += oprot->writeI32((int32_t)this->refType);
558 xfer += oprot->writeFieldEnd();
559
560 xfer += oprot->writeFieldBegin("traceIdLow", ::apache::thrift::protocol::T_I64, 2);
561 xfer += oprot->writeI64(this->traceIdLow);
562 xfer += oprot->writeFieldEnd();
563
564 xfer += oprot->writeFieldBegin("traceIdHigh", ::apache::thrift::protocol::T_I64, 3);
565 xfer += oprot->writeI64(this->traceIdHigh);
566 xfer += oprot->writeFieldEnd();
567
568 xfer += oprot->writeFieldBegin("spanId", ::apache::thrift::protocol::T_I64, 4);
569 xfer += oprot->writeI64(this->spanId);
570 xfer += oprot->writeFieldEnd();
571
572 xfer += oprot->writeFieldStop();
573 xfer += oprot->writeStructEnd();
574 return xfer;
575 }
576
577 void swap(SpanRef &a, SpanRef &b) {
578 using ::std::swap;
579 swap(a.refType, b.refType);
580 swap(a.traceIdLow, b.traceIdLow);
581 swap(a.traceIdHigh, b.traceIdHigh);
582 swap(a.spanId, b.spanId);
583 }
584
585 SpanRef::SpanRef(const SpanRef& other12) {
586 refType = other12.refType;
587 traceIdLow = other12.traceIdLow;
588 traceIdHigh = other12.traceIdHigh;
589 spanId = other12.spanId;
590 }
591 SpanRef& SpanRef::operator=(const SpanRef& other13) {
592 refType = other13.refType;
593 traceIdLow = other13.traceIdLow;
594 traceIdHigh = other13.traceIdHigh;
595 spanId = other13.spanId;
596 return *this;
597 }
598 void SpanRef::printTo(std::ostream& out) const {
599 using ::apache::thrift::to_string;
600 out << "SpanRef(";
601 out << "refType=" << to_string(refType);
602 out << ", " << "traceIdLow=" << to_string(traceIdLow);
603 out << ", " << "traceIdHigh=" << to_string(traceIdHigh);
604 out << ", " << "spanId=" << to_string(spanId);
605 out << ")";
606 }
607
608
609 Span::~Span() noexcept {
610 }
611
612
613 void Span::__set_traceIdLow(const int64_t val) {
614 this->traceIdLow = val;
615 }
616
617 void Span::__set_traceIdHigh(const int64_t val) {
618 this->traceIdHigh = val;
619 }
620
621 void Span::__set_spanId(const int64_t val) {
622 this->spanId = val;
623 }
624
625 void Span::__set_parentSpanId(const int64_t val) {
626 this->parentSpanId = val;
627 }
628
629 void Span::__set_operationName(const std::string& val) {
630 this->operationName = val;
631 }
632
633 void Span::__set_references(const std::vector<SpanRef> & val) {
634 this->references = val;
635 __isset.references = true;
636 }
637
638 void Span::__set_flags(const int32_t val) {
639 this->flags = val;
640 }
641
642 void Span::__set_startTime(const int64_t val) {
643 this->startTime = val;
644 }
645
646 void Span::__set_duration(const int64_t val) {
647 this->duration = val;
648 }
649
650 void Span::__set_tags(const std::vector<Tag> & val) {
651 this->tags = val;
652 __isset.tags = true;
653 }
654
655 void Span::__set_logs(const std::vector<Log> & val) {
656 this->logs = val;
657 __isset.logs = true;
658 }
659 std::ostream& operator<<(std::ostream& out, const Span& obj)
660 {
661 obj.printTo(out);
662 return out;
663 }
664
665
666 uint32_t Span::read(::apache::thrift::protocol::TProtocol* iprot) {
667
668 ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
669 uint32_t xfer = 0;
670 std::string fname;
671 ::apache::thrift::protocol::TType ftype;
672 int16_t fid;
673
674 xfer += iprot->readStructBegin(fname);
675
676 using ::apache::thrift::protocol::TProtocolException;
677
678 bool isset_traceIdLow = false;
679 bool isset_traceIdHigh = false;
680 bool isset_spanId = false;
681 bool isset_parentSpanId = false;
682 bool isset_operationName = false;
683 bool isset_flags = false;
684 bool isset_startTime = false;
685 bool isset_duration = false;
686
687 while (true)
688 {
689 xfer += iprot->readFieldBegin(fname, ftype, fid);
690 if (ftype == ::apache::thrift::protocol::T_STOP) {
691 break;
692 }
693 switch (fid)
694 {
695 case 1:
696 if (ftype == ::apache::thrift::protocol::T_I64) {
697 xfer += iprot->readI64(this->traceIdLow);
698 isset_traceIdLow = true;
699 } else {
700 xfer += iprot->skip(ftype);
701 }
702 break;
703 case 2:
704 if (ftype == ::apache::thrift::protocol::T_I64) {
705 xfer += iprot->readI64(this->traceIdHigh);
706 isset_traceIdHigh = true;
707 } else {
708 xfer += iprot->skip(ftype);
709 }
710 break;
711 case 3:
712 if (ftype == ::apache::thrift::protocol::T_I64) {
713 xfer += iprot->readI64(this->spanId);
714 isset_spanId = true;
715 } else {
716 xfer += iprot->skip(ftype);
717 }
718 break;
719 case 4:
720 if (ftype == ::apache::thrift::protocol::T_I64) {
721 xfer += iprot->readI64(this->parentSpanId);
722 isset_parentSpanId = true;
723 } else {
724 xfer += iprot->skip(ftype);
725 }
726 break;
727 case 5:
728 if (ftype == ::apache::thrift::protocol::T_STRING) {
729 xfer += iprot->readString(this->operationName);
730 isset_operationName = true;
731 } else {
732 xfer += iprot->skip(ftype);
733 }
734 break;
735 case 6:
736 if (ftype == ::apache::thrift::protocol::T_LIST) {
737 {
738 this->references.clear();
739 uint32_t _size14;
740 ::apache::thrift::protocol::TType _etype17;
741 xfer += iprot->readListBegin(_etype17, _size14);
742 this->references.resize(_size14);
743 uint32_t _i18;
744 for (_i18 = 0; _i18 < _size14; ++_i18)
745 {
746 xfer += this->references[_i18].read(iprot);
747 }
748 xfer += iprot->readListEnd();
749 }
750 this->__isset.references = true;
751 } else {
752 xfer += iprot->skip(ftype);
753 }
754 break;
755 case 7:
756 if (ftype == ::apache::thrift::protocol::T_I32) {
757 xfer += iprot->readI32(this->flags);
758 isset_flags = true;
759 } else {
760 xfer += iprot->skip(ftype);
761 }
762 break;
763 case 8:
764 if (ftype == ::apache::thrift::protocol::T_I64) {
765 xfer += iprot->readI64(this->startTime);
766 isset_startTime = true;
767 } else {
768 xfer += iprot->skip(ftype);
769 }
770 break;
771 case 9:
772 if (ftype == ::apache::thrift::protocol::T_I64) {
773 xfer += iprot->readI64(this->duration);
774 isset_duration = true;
775 } else {
776 xfer += iprot->skip(ftype);
777 }
778 break;
779 case 10:
780 if (ftype == ::apache::thrift::protocol::T_LIST) {
781 {
782 this->tags.clear();
783 uint32_t _size19;
784 ::apache::thrift::protocol::TType _etype22;
785 xfer += iprot->readListBegin(_etype22, _size19);
786 this->tags.resize(_size19);
787 uint32_t _i23;
788 for (_i23 = 0; _i23 < _size19; ++_i23)
789 {
790 xfer += this->tags[_i23].read(iprot);
791 }
792 xfer += iprot->readListEnd();
793 }
794 this->__isset.tags = true;
795 } else {
796 xfer += iprot->skip(ftype);
797 }
798 break;
799 case 11:
800 if (ftype == ::apache::thrift::protocol::T_LIST) {
801 {
802 this->logs.clear();
803 uint32_t _size24;
804 ::apache::thrift::protocol::TType _etype27;
805 xfer += iprot->readListBegin(_etype27, _size24);
806 this->logs.resize(_size24);
807 uint32_t _i28;
808 for (_i28 = 0; _i28 < _size24; ++_i28)
809 {
810 xfer += this->logs[_i28].read(iprot);
811 }
812 xfer += iprot->readListEnd();
813 }
814 this->__isset.logs = true;
815 } else {
816 xfer += iprot->skip(ftype);
817 }
818 break;
819 default:
820 xfer += iprot->skip(ftype);
821 break;
822 }
823 xfer += iprot->readFieldEnd();
824 }
825
826 xfer += iprot->readStructEnd();
827
828 if (!isset_traceIdLow)
829 throw TProtocolException(TProtocolException::INVALID_DATA);
830 if (!isset_traceIdHigh)
831 throw TProtocolException(TProtocolException::INVALID_DATA);
832 if (!isset_spanId)
833 throw TProtocolException(TProtocolException::INVALID_DATA);
834 if (!isset_parentSpanId)
835 throw TProtocolException(TProtocolException::INVALID_DATA);
836 if (!isset_operationName)
837 throw TProtocolException(TProtocolException::INVALID_DATA);
838 if (!isset_flags)
839 throw TProtocolException(TProtocolException::INVALID_DATA);
840 if (!isset_startTime)
841 throw TProtocolException(TProtocolException::INVALID_DATA);
842 if (!isset_duration)
843 throw TProtocolException(TProtocolException::INVALID_DATA);
844 return xfer;
845 }
846
847 uint32_t Span::write(::apache::thrift::protocol::TProtocol* oprot) const {
848 uint32_t xfer = 0;
849 ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
850 xfer += oprot->writeStructBegin("Span");
851
852 xfer += oprot->writeFieldBegin("traceIdLow", ::apache::thrift::protocol::T_I64, 1);
853 xfer += oprot->writeI64(this->traceIdLow);
854 xfer += oprot->writeFieldEnd();
855
856 xfer += oprot->writeFieldBegin("traceIdHigh", ::apache::thrift::protocol::T_I64, 2);
857 xfer += oprot->writeI64(this->traceIdHigh);
858 xfer += oprot->writeFieldEnd();
859
860 xfer += oprot->writeFieldBegin("spanId", ::apache::thrift::protocol::T_I64, 3);
861 xfer += oprot->writeI64(this->spanId);
862 xfer += oprot->writeFieldEnd();
863
864 xfer += oprot->writeFieldBegin("parentSpanId", ::apache::thrift::protocol::T_I64, 4);
865 xfer += oprot->writeI64(this->parentSpanId);
866 xfer += oprot->writeFieldEnd();
867
868 xfer += oprot->writeFieldBegin("operationName", ::apache::thrift::protocol::T_STRING, 5);
869 xfer += oprot->writeString(this->operationName);
870 xfer += oprot->writeFieldEnd();
871
872 if (this->__isset.references) {
873 xfer += oprot->writeFieldBegin("references", ::apache::thrift::protocol::T_LIST, 6);
874 {
875 xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->references.size()));
876 std::vector<SpanRef> ::const_iterator _iter29;
877 for (_iter29 = this->references.begin(); _iter29 != this->references.end(); ++_iter29)
878 {
879 xfer += (*_iter29).write(oprot);
880 }
881 xfer += oprot->writeListEnd();
882 }
883 xfer += oprot->writeFieldEnd();
884 }
885 xfer += oprot->writeFieldBegin("flags", ::apache::thrift::protocol::T_I32, 7);
886 xfer += oprot->writeI32(this->flags);
887 xfer += oprot->writeFieldEnd();
888
889 xfer += oprot->writeFieldBegin("startTime", ::apache::thrift::protocol::T_I64, 8);
890 xfer += oprot->writeI64(this->startTime);
891 xfer += oprot->writeFieldEnd();
892
893 xfer += oprot->writeFieldBegin("duration", ::apache::thrift::protocol::T_I64, 9);
894 xfer += oprot->writeI64(this->duration);
895 xfer += oprot->writeFieldEnd();
896
897 if (this->__isset.tags) {
898 xfer += oprot->writeFieldBegin("tags", ::apache::thrift::protocol::T_LIST, 10);
899 {
900 xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->tags.size()));
901 std::vector<Tag> ::const_iterator _iter30;
902 for (_iter30 = this->tags.begin(); _iter30 != this->tags.end(); ++_iter30)
903 {
904 xfer += (*_iter30).write(oprot);
905 }
906 xfer += oprot->writeListEnd();
907 }
908 xfer += oprot->writeFieldEnd();
909 }
910 if (this->__isset.logs) {
911 xfer += oprot->writeFieldBegin("logs", ::apache::thrift::protocol::T_LIST, 11);
912 {
913 xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->logs.size()));
914 std::vector<Log> ::const_iterator _iter31;
915 for (_iter31 = this->logs.begin(); _iter31 != this->logs.end(); ++_iter31)
916 {
917 xfer += (*_iter31).write(oprot);
918 }
919 xfer += oprot->writeListEnd();
920 }
921 xfer += oprot->writeFieldEnd();
922 }
923 xfer += oprot->writeFieldStop();
924 xfer += oprot->writeStructEnd();
925 return xfer;
926 }
927
928 void swap(Span &a, Span &b) {
929 using ::std::swap;
930 swap(a.traceIdLow, b.traceIdLow);
931 swap(a.traceIdHigh, b.traceIdHigh);
932 swap(a.spanId, b.spanId);
933 swap(a.parentSpanId, b.parentSpanId);
934 swap(a.operationName, b.operationName);
935 swap(a.references, b.references);
936 swap(a.flags, b.flags);
937 swap(a.startTime, b.startTime);
938 swap(a.duration, b.duration);
939 swap(a.tags, b.tags);
940 swap(a.logs, b.logs);
941 swap(a.__isset, b.__isset);
942 }
943
944 Span::Span(const Span& other32) {
945 traceIdLow = other32.traceIdLow;
946 traceIdHigh = other32.traceIdHigh;
947 spanId = other32.spanId;
948 parentSpanId = other32.parentSpanId;
949 operationName = other32.operationName;
950 references = other32.references;
951 flags = other32.flags;
952 startTime = other32.startTime;
953 duration = other32.duration;
954 tags = other32.tags;
955 logs = other32.logs;
956 __isset = other32.__isset;
957 }
958 Span& Span::operator=(const Span& other33) {
959 traceIdLow = other33.traceIdLow;
960 traceIdHigh = other33.traceIdHigh;
961 spanId = other33.spanId;
962 parentSpanId = other33.parentSpanId;
963 operationName = other33.operationName;
964 references = other33.references;
965 flags = other33.flags;
966 startTime = other33.startTime;
967 duration = other33.duration;
968 tags = other33.tags;
969 logs = other33.logs;
970 __isset = other33.__isset;
971 return *this;
972 }
973 void Span::printTo(std::ostream& out) const {
974 using ::apache::thrift::to_string;
975 out << "Span(";
976 out << "traceIdLow=" << to_string(traceIdLow);
977 out << ", " << "traceIdHigh=" << to_string(traceIdHigh);
978 out << ", " << "spanId=" << to_string(spanId);
979 out << ", " << "parentSpanId=" << to_string(parentSpanId);
980 out << ", " << "operationName=" << to_string(operationName);
981 out << ", " << "references="; (__isset.references ? (out << to_string(references)) : (out << "<null>"));
982 out << ", " << "flags=" << to_string(flags);
983 out << ", " << "startTime=" << to_string(startTime);
984 out << ", " << "duration=" << to_string(duration);
985 out << ", " << "tags="; (__isset.tags ? (out << to_string(tags)) : (out << "<null>"));
986 out << ", " << "logs="; (__isset.logs ? (out << to_string(logs)) : (out << "<null>"));
987 out << ")";
988 }
989
990
991 Process::~Process() noexcept {
992 }
993
994
995 void Process::__set_serviceName(const std::string& val) {
996 this->serviceName = val;
997 }
998
999 void Process::__set_tags(const std::vector<Tag> & val) {
1000 this->tags = val;
1001 __isset.tags = true;
1002 }
1003 std::ostream& operator<<(std::ostream& out, const Process& obj)
1004 {
1005 obj.printTo(out);
1006 return out;
1007 }
1008
1009
1010 uint32_t Process::read(::apache::thrift::protocol::TProtocol* iprot) {
1011
1012 ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
1013 uint32_t xfer = 0;
1014 std::string fname;
1015 ::apache::thrift::protocol::TType ftype;
1016 int16_t fid;
1017
1018 xfer += iprot->readStructBegin(fname);
1019
1020 using ::apache::thrift::protocol::TProtocolException;
1021
1022 bool isset_serviceName = false;
1023
1024 while (true)
1025 {
1026 xfer += iprot->readFieldBegin(fname, ftype, fid);
1027 if (ftype == ::apache::thrift::protocol::T_STOP) {
1028 break;
1029 }
1030 switch (fid)
1031 {
1032 case 1:
1033 if (ftype == ::apache::thrift::protocol::T_STRING) {
1034 xfer += iprot->readString(this->serviceName);
1035 isset_serviceName = true;
1036 } else {
1037 xfer += iprot->skip(ftype);
1038 }
1039 break;
1040 case 2:
1041 if (ftype == ::apache::thrift::protocol::T_LIST) {
1042 {
1043 this->tags.clear();
1044 uint32_t _size34;
1045 ::apache::thrift::protocol::TType _etype37;
1046 xfer += iprot->readListBegin(_etype37, _size34);
1047 this->tags.resize(_size34);
1048 uint32_t _i38;
1049 for (_i38 = 0; _i38 < _size34; ++_i38)
1050 {
1051 xfer += this->tags[_i38].read(iprot);
1052 }
1053 xfer += iprot->readListEnd();
1054 }
1055 this->__isset.tags = true;
1056 } else {
1057 xfer += iprot->skip(ftype);
1058 }
1059 break;
1060 default:
1061 xfer += iprot->skip(ftype);
1062 break;
1063 }
1064 xfer += iprot->readFieldEnd();
1065 }
1066
1067 xfer += iprot->readStructEnd();
1068
1069 if (!isset_serviceName)
1070 throw TProtocolException(TProtocolException::INVALID_DATA);
1071 return xfer;
1072 }
1073
1074 uint32_t Process::write(::apache::thrift::protocol::TProtocol* oprot) const {
1075 uint32_t xfer = 0;
1076 ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
1077 xfer += oprot->writeStructBegin("Process");
1078
1079 xfer += oprot->writeFieldBegin("serviceName", ::apache::thrift::protocol::T_STRING, 1);
1080 xfer += oprot->writeString(this->serviceName);
1081 xfer += oprot->writeFieldEnd();
1082
1083 if (this->__isset.tags) {
1084 xfer += oprot->writeFieldBegin("tags", ::apache::thrift::protocol::T_LIST, 2);
1085 {
1086 xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->tags.size()));
1087 std::vector<Tag> ::const_iterator _iter39;
1088 for (_iter39 = this->tags.begin(); _iter39 != this->tags.end(); ++_iter39)
1089 {
1090 xfer += (*_iter39).write(oprot);
1091 }
1092 xfer += oprot->writeListEnd();
1093 }
1094 xfer += oprot->writeFieldEnd();
1095 }
1096 xfer += oprot->writeFieldStop();
1097 xfer += oprot->writeStructEnd();
1098 return xfer;
1099 }
1100
1101 void swap(Process &a, Process &b) {
1102 using ::std::swap;
1103 swap(a.serviceName, b.serviceName);
1104 swap(a.tags, b.tags);
1105 swap(a.__isset, b.__isset);
1106 }
1107
1108 Process::Process(const Process& other40) {
1109 serviceName = other40.serviceName;
1110 tags = other40.tags;
1111 __isset = other40.__isset;
1112 }
1113 Process& Process::operator=(const Process& other41) {
1114 serviceName = other41.serviceName;
1115 tags = other41.tags;
1116 __isset = other41.__isset;
1117 return *this;
1118 }
1119 void Process::printTo(std::ostream& out) const {
1120 using ::apache::thrift::to_string;
1121 out << "Process(";
1122 out << "serviceName=" << to_string(serviceName);
1123 out << ", " << "tags="; (__isset.tags ? (out << to_string(tags)) : (out << "<null>"));
1124 out << ")";
1125 }
1126
1127
1128 Batch::~Batch() noexcept {
1129 }
1130
1131
1132 void Batch::__set_process(const Process& val) {
1133 this->process = val;
1134 }
1135
1136 void Batch::__set_spans(const std::vector<Span> & val) {
1137 this->spans = val;
1138 }
1139 std::ostream& operator<<(std::ostream& out, const Batch& obj)
1140 {
1141 obj.printTo(out);
1142 return out;
1143 }
1144
1145
1146 uint32_t Batch::read(::apache::thrift::protocol::TProtocol* iprot) {
1147
1148 ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
1149 uint32_t xfer = 0;
1150 std::string fname;
1151 ::apache::thrift::protocol::TType ftype;
1152 int16_t fid;
1153
1154 xfer += iprot->readStructBegin(fname);
1155
1156 using ::apache::thrift::protocol::TProtocolException;
1157
1158 bool isset_process = false;
1159 bool isset_spans = false;
1160
1161 while (true)
1162 {
1163 xfer += iprot->readFieldBegin(fname, ftype, fid);
1164 if (ftype == ::apache::thrift::protocol::T_STOP) {
1165 break;
1166 }
1167 switch (fid)
1168 {
1169 case 1:
1170 if (ftype == ::apache::thrift::protocol::T_STRUCT) {
1171 xfer += this->process.read(iprot);
1172 isset_process = true;
1173 } else {
1174 xfer += iprot->skip(ftype);
1175 }
1176 break;
1177 case 2:
1178 if (ftype == ::apache::thrift::protocol::T_LIST) {
1179 {
1180 this->spans.clear();
1181 uint32_t _size42;
1182 ::apache::thrift::protocol::TType _etype45;
1183 xfer += iprot->readListBegin(_etype45, _size42);
1184 this->spans.resize(_size42);
1185 uint32_t _i46;
1186 for (_i46 = 0; _i46 < _size42; ++_i46)
1187 {
1188 xfer += this->spans[_i46].read(iprot);
1189 }
1190 xfer += iprot->readListEnd();
1191 }
1192 isset_spans = true;
1193 } else {
1194 xfer += iprot->skip(ftype);
1195 }
1196 break;
1197 default:
1198 xfer += iprot->skip(ftype);
1199 break;
1200 }
1201 xfer += iprot->readFieldEnd();
1202 }
1203
1204 xfer += iprot->readStructEnd();
1205
1206 if (!isset_process)
1207 throw TProtocolException(TProtocolException::INVALID_DATA);
1208 if (!isset_spans)
1209 throw TProtocolException(TProtocolException::INVALID_DATA);
1210 return xfer;
1211 }
1212
1213 uint32_t Batch::write(::apache::thrift::protocol::TProtocol* oprot) const {
1214 uint32_t xfer = 0;
1215 ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
1216 xfer += oprot->writeStructBegin("Batch");
1217
1218 xfer += oprot->writeFieldBegin("process", ::apache::thrift::protocol::T_STRUCT, 1);
1219 xfer += this->process.write(oprot);
1220 xfer += oprot->writeFieldEnd();
1221
1222 xfer += oprot->writeFieldBegin("spans", ::apache::thrift::protocol::T_LIST, 2);
1223 {
1224 xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->spans.size()));
1225 std::vector<Span> ::const_iterator _iter47;
1226 for (_iter47 = this->spans.begin(); _iter47 != this->spans.end(); ++_iter47)
1227 {
1228 xfer += (*_iter47).write(oprot);
1229 }
1230 xfer += oprot->writeListEnd();
1231 }
1232 xfer += oprot->writeFieldEnd();
1233
1234 xfer += oprot->writeFieldStop();
1235 xfer += oprot->writeStructEnd();
1236 return xfer;
1237 }
1238
1239 void swap(Batch &a, Batch &b) {
1240 using ::std::swap;
1241 swap(a.process, b.process);
1242 swap(a.spans, b.spans);
1243 }
1244
1245 Batch::Batch(const Batch& other48) {
1246 process = other48.process;
1247 spans = other48.spans;
1248 }
1249 Batch& Batch::operator=(const Batch& other49) {
1250 process = other49.process;
1251 spans = other49.spans;
1252 return *this;
1253 }
1254 void Batch::printTo(std::ostream& out) const {
1255 using ::apache::thrift::to_string;
1256 out << "Batch(";
1257 out << "process=" << to_string(process);
1258 out << ", " << "spans=" << to_string(spans);
1259 out << ")";
1260 }
1261
1262
1263 BatchSubmitResponse::~BatchSubmitResponse() noexcept {
1264 }
1265
1266
1267 void BatchSubmitResponse::__set_ok(const bool val) {
1268 this->ok = val;
1269 }
1270 std::ostream& operator<<(std::ostream& out, const BatchSubmitResponse& obj)
1271 {
1272 obj.printTo(out);
1273 return out;
1274 }
1275
1276
1277 uint32_t BatchSubmitResponse::read(::apache::thrift::protocol::TProtocol* iprot) {
1278
1279 ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
1280 uint32_t xfer = 0;
1281 std::string fname;
1282 ::apache::thrift::protocol::TType ftype;
1283 int16_t fid;
1284
1285 xfer += iprot->readStructBegin(fname);
1286
1287 using ::apache::thrift::protocol::TProtocolException;
1288
1289 bool isset_ok = false;
1290
1291 while (true)
1292 {
1293 xfer += iprot->readFieldBegin(fname, ftype, fid);
1294 if (ftype == ::apache::thrift::protocol::T_STOP) {
1295 break;
1296 }
1297 switch (fid)
1298 {
1299 case 1:
1300 if (ftype == ::apache::thrift::protocol::T_BOOL) {
1301 xfer += iprot->readBool(this->ok);
1302 isset_ok = true;
1303 } else {
1304 xfer += iprot->skip(ftype);
1305 }
1306 break;
1307 default:
1308 xfer += iprot->skip(ftype);
1309 break;
1310 }
1311 xfer += iprot->readFieldEnd();
1312 }
1313
1314 xfer += iprot->readStructEnd();
1315
1316 if (!isset_ok)
1317 throw TProtocolException(TProtocolException::INVALID_DATA);
1318 return xfer;
1319 }
1320
1321 uint32_t BatchSubmitResponse::write(::apache::thrift::protocol::TProtocol* oprot) const {
1322 uint32_t xfer = 0;
1323 ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
1324 xfer += oprot->writeStructBegin("BatchSubmitResponse");
1325
1326 xfer += oprot->writeFieldBegin("ok", ::apache::thrift::protocol::T_BOOL, 1);
1327 xfer += oprot->writeBool(this->ok);
1328 xfer += oprot->writeFieldEnd();
1329
1330 xfer += oprot->writeFieldStop();
1331 xfer += oprot->writeStructEnd();
1332 return xfer;
1333 }
1334
1335 void swap(BatchSubmitResponse &a, BatchSubmitResponse &b) {
1336 using ::std::swap;
1337 swap(a.ok, b.ok);
1338 }
1339
1340 BatchSubmitResponse::BatchSubmitResponse(const BatchSubmitResponse& other50) {
1341 ok = other50.ok;
1342 }
1343 BatchSubmitResponse& BatchSubmitResponse::operator=(const BatchSubmitResponse& other51) {
1344 ok = other51.ok;
1345 return *this;
1346 }
1347 void BatchSubmitResponse::printTo(std::ostream& out) const {
1348 using ::apache::thrift::to_string;
1349 out << "BatchSubmitResponse(";
1350 out << "ok=" << to_string(ok);
1351 out << ")";
1352 }
1353
1354 }} // namespace