/**
 * Autogenerated by Thrift Compiler (0.14.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
#include "zipkincore_types.h"

#include <algorithm>
#include <ostream>

#include <thrift/TToString.h>

namespace twitter { namespace zipkin { namespace thrift {

int _kAnnotationTypeValues[] = {
  AnnotationType::BOOL,
  AnnotationType::BYTES,
  AnnotationType::I16,
  AnnotationType::I32,
  AnnotationType::I64,
  AnnotationType::DOUBLE,
  AnnotationType::STRING
};
const char* _kAnnotationTypeNames[] = {
  "BOOL",
  "BYTES",
  "I16",
  "I32",
  "I64",
  "DOUBLE",
  "STRING"
};
const std::map<int, const char*> _AnnotationType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(7, _kAnnotationTypeValues, _kAnnotationTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr));

std::ostream& operator<<(std::ostream& out, const AnnotationType::type& val) {
  std::map<int, const char*>::const_iterator it = _AnnotationType_VALUES_TO_NAMES.find(val);
  if (it != _AnnotationType_VALUES_TO_NAMES.end()) {
    out << it->second;
  } else {
    out << static_cast<int>(val);
  }
  return out;
}

std::string to_string(const AnnotationType::type& val) {
  std::map<int, const char*>::const_iterator it = _AnnotationType_VALUES_TO_NAMES.find(val);
  if (it != _AnnotationType_VALUES_TO_NAMES.end()) {
    return std::string(it->second);
  } else {
    return std::to_string(static_cast<int>(val));
  }
}


Endpoint::~Endpoint() noexcept {
}


void Endpoint::__set_ipv4(const int32_t val) {
  this->ipv4 = val;
}

void Endpoint::__set_port(const int16_t val) {
  this->port = val;
}

void Endpoint::__set_service_name(const std::string& val) {
  this->service_name = val;
}

void Endpoint::__set_ipv6(const std::string& val) {
  this->ipv6 = val;
__isset.ipv6 = true;
}
std::ostream& operator<<(std::ostream& out, const Endpoint& obj)
{
  obj.printTo(out);
  return out;
}


uint32_t Endpoint::read(::apache::thrift::protocol::TProtocol* iprot) {

  ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->ipv4);
          this->__isset.ipv4 = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I16) {
          xfer += iprot->readI16(this->port);
          this->__isset.port = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->service_name);
          this->__isset.service_name = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->ipv6);
          this->__isset.ipv6 = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t Endpoint::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("Endpoint");

  xfer += oprot->writeFieldBegin("ipv4", ::apache::thrift::protocol::T_I32, 1);
  xfer += oprot->writeI32(this->ipv4);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("port", ::apache::thrift::protocol::T_I16, 2);
  xfer += oprot->writeI16(this->port);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("service_name", ::apache::thrift::protocol::T_STRING, 3);
  xfer += oprot->writeString(this->service_name);
  xfer += oprot->writeFieldEnd();

  if (this->__isset.ipv6) {
    xfer += oprot->writeFieldBegin("ipv6", ::apache::thrift::protocol::T_STRING, 4);
    xfer += oprot->writeBinary(this->ipv6);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

void swap(Endpoint &a, Endpoint &b) {
  using ::std::swap;
  swap(a.ipv4, b.ipv4);
  swap(a.port, b.port);
  swap(a.service_name, b.service_name);
  swap(a.ipv6, b.ipv6);
  swap(a.__isset, b.__isset);
}

Endpoint::Endpoint(const Endpoint& other0) {
  ipv4 = other0.ipv4;
  port = other0.port;
  service_name = other0.service_name;
  ipv6 = other0.ipv6;
  __isset = other0.__isset;
}
Endpoint& Endpoint::operator=(const Endpoint& other1) {
  ipv4 = other1.ipv4;
  port = other1.port;
  service_name = other1.service_name;
  ipv6 = other1.ipv6;
  __isset = other1.__isset;
  return *this;
}
void Endpoint::printTo(std::ostream& out) const {
  using ::apache::thrift::to_string;
  out << "Endpoint(";
  out << "ipv4=" << to_string(ipv4);
  out << ", " << "port=" << to_string(port);
  out << ", " << "service_name=" << to_string(service_name);
  out << ", " << "ipv6="; (__isset.ipv6 ? (out << to_string(ipv6)) : (out << "<null>"));
  out << ")";
}


Annotation::~Annotation() noexcept {
}


void Annotation::__set_timestamp(const int64_t val) {
  this->timestamp = val;
}

void Annotation::__set_value(const std::string& val) {
  this->value = val;
}

void Annotation::__set_host(const Endpoint& val) {
  this->host = val;
__isset.host = true;
}
std::ostream& operator<<(std::ostream& out, const Annotation& obj)
{
  obj.printTo(out);
  return out;
}


uint32_t Annotation::read(::apache::thrift::protocol::TProtocol* iprot) {

  ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->timestamp);
          this->__isset.timestamp = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->value);
          this->__isset.value = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->host.read(iprot);
          this->__isset.host = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t Annotation::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("Annotation");

  xfer += oprot->writeFieldBegin("timestamp", ::apache::thrift::protocol::T_I64, 1);
  xfer += oprot->writeI64(this->timestamp);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 2);
  xfer += oprot->writeString(this->value);
  xfer += oprot->writeFieldEnd();

  if (this->__isset.host) {
    xfer += oprot->writeFieldBegin("host", ::apache::thrift::protocol::T_STRUCT, 3);
    xfer += this->host.write(oprot);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

void swap(Annotation &a, Annotation &b) {
  using ::std::swap;
  swap(a.timestamp, b.timestamp);
  swap(a.value, b.value);
  swap(a.host, b.host);
  swap(a.__isset, b.__isset);
}

Annotation::Annotation(const Annotation& other2) {
  timestamp = other2.timestamp;
  value = other2.value;
  host = other2.host;
  __isset = other2.__isset;
}
Annotation& Annotation::operator=(const Annotation& other3) {
  timestamp = other3.timestamp;
  value = other3.value;
  host = other3.host;
  __isset = other3.__isset;
  return *this;
}
void Annotation::printTo(std::ostream& out) const {
  using ::apache::thrift::to_string;
  out << "Annotation(";
  out << "timestamp=" << to_string(timestamp);
  out << ", " << "value=" << to_string(value);
  out << ", " << "host="; (__isset.host ? (out << to_string(host)) : (out << "<null>"));
  out << ")";
}


BinaryAnnotation::~BinaryAnnotation() noexcept {
}


void BinaryAnnotation::__set_key(const std::string& val) {
  this->key = val;
}

void BinaryAnnotation::__set_value(const std::string& val) {
  this->value = val;
}

void BinaryAnnotation::__set_annotation_type(const AnnotationType::type val) {
  this->annotation_type = val;
}

void BinaryAnnotation::__set_host(const Endpoint& val) {
  this->host = val;
__isset.host = true;
}
std::ostream& operator<<(std::ostream& out, const BinaryAnnotation& obj)
{
  obj.printTo(out);
  return out;
}


uint32_t BinaryAnnotation::read(::apache::thrift::protocol::TProtocol* iprot) {

  ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->key);
          this->__isset.key = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->value);
          this->__isset.value = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          int32_t ecast4;
          xfer += iprot->readI32(ecast4);
          this->annotation_type = (AnnotationType::type)ecast4;
          this->__isset.annotation_type = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->host.read(iprot);
          this->__isset.host = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t BinaryAnnotation::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("BinaryAnnotation");

  xfer += oprot->writeFieldBegin("key", ::apache::thrift::protocol::T_STRING, 1);
  xfer += oprot->writeString(this->key);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 2);
  xfer += oprot->writeBinary(this->value);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("annotation_type", ::apache::thrift::protocol::T_I32, 3);
  xfer += oprot->writeI32((int32_t)this->annotation_type);
  xfer += oprot->writeFieldEnd();

  if (this->__isset.host) {
    xfer += oprot->writeFieldBegin("host", ::apache::thrift::protocol::T_STRUCT, 4);
    xfer += this->host.write(oprot);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

void swap(BinaryAnnotation &a, BinaryAnnotation &b) {
  using ::std::swap;
  swap(a.key, b.key);
  swap(a.value, b.value);
  swap(a.annotation_type, b.annotation_type);
  swap(a.host, b.host);
  swap(a.__isset, b.__isset);
}

BinaryAnnotation::BinaryAnnotation(const BinaryAnnotation& other5) {
  key = other5.key;
  value = other5.value;
  annotation_type = other5.annotation_type;
  host = other5.host;
  __isset = other5.__isset;
}
BinaryAnnotation& BinaryAnnotation::operator=(const BinaryAnnotation& other6) {
  key = other6.key;
  value = other6.value;
  annotation_type = other6.annotation_type;
  host = other6.host;
  __isset = other6.__isset;
  return *this;
}
void BinaryAnnotation::printTo(std::ostream& out) const {
  using ::apache::thrift::to_string;
  out << "BinaryAnnotation(";
  out << "key=" << to_string(key);
  out << ", " << "value=" << to_string(value);
  out << ", " << "annotation_type=" << to_string(annotation_type);
  out << ", " << "host="; (__isset.host ? (out << to_string(host)) : (out << "<null>"));
  out << ")";
}


Span::~Span() noexcept {
}


void Span::__set_trace_id(const int64_t val) {
  this->trace_id = val;
}

void Span::__set_name(const std::string& val) {
  this->name = val;
}

void Span::__set_id(const int64_t val) {
  this->id = val;
}

void Span::__set_parent_id(const int64_t val) {
  this->parent_id = val;
__isset.parent_id = true;
}

void Span::__set_annotations(const std::vector<Annotation> & val) {
  this->annotations = val;
}

void Span::__set_binary_annotations(const std::vector<BinaryAnnotation> & val) {
  this->binary_annotations = val;
}

void Span::__set_debug(const bool val) {
  this->debug = val;
__isset.debug = true;
}

void Span::__set_timestamp(const int64_t val) {
  this->timestamp = val;
__isset.timestamp = true;
}

void Span::__set_duration(const int64_t val) {
  this->duration = val;
__isset.duration = true;
}

void Span::__set_trace_id_high(const int64_t val) {
  this->trace_id_high = val;
__isset.trace_id_high = true;
}
std::ostream& operator<<(std::ostream& out, const Span& obj)
{
  obj.printTo(out);
  return out;
}


uint32_t Span::read(::apache::thrift::protocol::TProtocol* iprot) {

  ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->trace_id);
          this->__isset.trace_id = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->name);
          this->__isset.name = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->id);
          this->__isset.id = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->parent_id);
          this->__isset.parent_id = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->annotations.clear();
            uint32_t _size7;
            ::apache::thrift::protocol::TType _etype10;
            xfer += iprot->readListBegin(_etype10, _size7);
            this->annotations.resize(_size7);
            uint32_t _i11;
            for (_i11 = 0; _i11 < _size7; ++_i11)
            {
              xfer += this->annotations[_i11].read(iprot);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.annotations = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 8:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->binary_annotations.clear();
            uint32_t _size12;
            ::apache::thrift::protocol::TType _etype15;
            xfer += iprot->readListBegin(_etype15, _size12);
            this->binary_annotations.resize(_size12);
            uint32_t _i16;
            for (_i16 = 0; _i16 < _size12; ++_i16)
            {
              xfer += this->binary_annotations[_i16].read(iprot);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.binary_annotations = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 9:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->debug);
          this->__isset.debug = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 10:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->timestamp);
          this->__isset.timestamp = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->duration);
          this->__isset.duration = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 12:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->trace_id_high);
          this->__isset.trace_id_high = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t Span::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("Span");

  xfer += oprot->writeFieldBegin("trace_id", ::apache::thrift::protocol::T_I64, 1);
  xfer += oprot->writeI64(this->trace_id);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("name", ::apache::thrift::protocol::T_STRING, 3);
  xfer += oprot->writeString(this->name);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I64, 4);
  xfer += oprot->writeI64(this->id);
  xfer += oprot->writeFieldEnd();

  if (this->__isset.parent_id) {
    xfer += oprot->writeFieldBegin("parent_id", ::apache::thrift::protocol::T_I64, 5);
    xfer += oprot->writeI64(this->parent_id);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldBegin("annotations", ::apache::thrift::protocol::T_LIST, 6);
  {
    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->annotations.size()));
    std::vector<Annotation> ::const_iterator _iter17;
    for (_iter17 = this->annotations.begin(); _iter17 != this->annotations.end(); ++_iter17)
    {
      xfer += (*_iter17).write(oprot);
    }
    xfer += oprot->writeListEnd();
  }
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("binary_annotations", ::apache::thrift::protocol::T_LIST, 8);
  {
    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->binary_annotations.size()));
    std::vector<BinaryAnnotation> ::const_iterator _iter18;
    for (_iter18 = this->binary_annotations.begin(); _iter18 != this->binary_annotations.end(); ++_iter18)
    {
      xfer += (*_iter18).write(oprot);
    }
    xfer += oprot->writeListEnd();
  }
  xfer += oprot->writeFieldEnd();

  if (this->__isset.debug) {
    xfer += oprot->writeFieldBegin("debug", ::apache::thrift::protocol::T_BOOL, 9);
    xfer += oprot->writeBool(this->debug);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.timestamp) {
    xfer += oprot->writeFieldBegin("timestamp", ::apache::thrift::protocol::T_I64, 10);
    xfer += oprot->writeI64(this->timestamp);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.duration) {
    xfer += oprot->writeFieldBegin("duration", ::apache::thrift::protocol::T_I64, 11);
    xfer += oprot->writeI64(this->duration);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.trace_id_high) {
    xfer += oprot->writeFieldBegin("trace_id_high", ::apache::thrift::protocol::T_I64, 12);
    xfer += oprot->writeI64(this->trace_id_high);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

void swap(Span &a, Span &b) {
  using ::std::swap;
  swap(a.trace_id, b.trace_id);
  swap(a.name, b.name);
  swap(a.id, b.id);
  swap(a.parent_id, b.parent_id);
  swap(a.annotations, b.annotations);
  swap(a.binary_annotations, b.binary_annotations);
  swap(a.debug, b.debug);
  swap(a.timestamp, b.timestamp);
  swap(a.duration, b.duration);
  swap(a.trace_id_high, b.trace_id_high);
  swap(a.__isset, b.__isset);
}

Span::Span(const Span& other19) {
  trace_id = other19.trace_id;
  name = other19.name;
  id = other19.id;
  parent_id = other19.parent_id;
  annotations = other19.annotations;
  binary_annotations = other19.binary_annotations;
  debug = other19.debug;
  timestamp = other19.timestamp;
  duration = other19.duration;
  trace_id_high = other19.trace_id_high;
  __isset = other19.__isset;
}
Span& Span::operator=(const Span& other20) {
  trace_id = other20.trace_id;
  name = other20.name;
  id = other20.id;
  parent_id = other20.parent_id;
  annotations = other20.annotations;
  binary_annotations = other20.binary_annotations;
  debug = other20.debug;
  timestamp = other20.timestamp;
  duration = other20.duration;
  trace_id_high = other20.trace_id_high;
  __isset = other20.__isset;
  return *this;
}
void Span::printTo(std::ostream& out) const {
  using ::apache::thrift::to_string;
  out << "Span(";
  out << "trace_id=" << to_string(trace_id);
  out << ", " << "name=" << to_string(name);
  out << ", " << "id=" << to_string(id);
  out << ", " << "parent_id="; (__isset.parent_id ? (out << to_string(parent_id)) : (out << "<null>"));
  out << ", " << "annotations=" << to_string(annotations);
  out << ", " << "binary_annotations=" << to_string(binary_annotations);
  out << ", " << "debug="; (__isset.debug ? (out << to_string(debug)) : (out << "<null>"));
  out << ", " << "timestamp="; (__isset.timestamp ? (out << to_string(timestamp)) : (out << "<null>"));
  out << ", " << "duration="; (__isset.duration ? (out << to_string(duration)) : (out << "<null>"));
  out << ", " << "trace_id_high="; (__isset.trace_id_high ? (out << to_string(trace_id_high)) : (out << "<null>"));
  out << ")";
}


Response::~Response() noexcept {
}


void Response::__set_ok(const bool val) {
  this->ok = val;
}
std::ostream& operator<<(std::ostream& out, const Response& obj)
{
  obj.printTo(out);
  return out;
}


uint32_t Response::read(::apache::thrift::protocol::TProtocol* iprot) {

  ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;

  bool isset_ok = false;

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->ok);
          isset_ok = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  if (!isset_ok)
    throw TProtocolException(TProtocolException::INVALID_DATA);
  return xfer;
}

uint32_t Response::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("Response");

  xfer += oprot->writeFieldBegin("ok", ::apache::thrift::protocol::T_BOOL, 1);
  xfer += oprot->writeBool(this->ok);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

void swap(Response &a, Response &b) {
  using ::std::swap;
  swap(a.ok, b.ok);
}

Response::Response(const Response& other21) {
  ok = other21.ok;
}
Response& Response::operator=(const Response& other22) {
  ok = other22.ok;
  return *this;
}
void Response::printTo(std::ostream& out) const {
  using ::apache::thrift::to_string;
  out << "Response(";
  out << "ok=" << to_string(ok);
  out << ")";
}

}}} // namespace
