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

#include <algorithm>
#include <ostream>

#include <thrift/TToString.h>




Hello_struct::~Hello_struct() noexcept {
}


void Hello_struct::__set_num1(const int32_t val) {
  this->num1 = val;
}

void Hello_struct::__set_num2(const int64_t val) {
  this->num2 = val;
}

void Hello_struct::__set_string1(const std::string& val) {
  this->string1 = val;
}
std::ostream& operator<<(std::ostream& out, const Hello_struct& obj)
{
  obj.printTo(out);
  return out;
}


uint32_t Hello_struct::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->num1);
          this->__isset.num1 = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->num2);
          this->__isset.num2 = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->string1);
          this->__isset.string1 = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

void swap(Hello_struct &a, Hello_struct &b) {
  using ::std::swap;
  swap(a.num1, b.num1);
  swap(a.num2, b.num2);
  swap(a.string1, b.string1);
  swap(a.__isset, b.__isset);
}

Hello_struct::Hello_struct(const Hello_struct& other0) {
  num1 = other0.num1;
  num2 = other0.num2;
  string1 = other0.string1;
  __isset = other0.__isset;
}
Hello_struct& Hello_struct::operator=(const Hello_struct& other1) {
  num1 = other1.num1;
  num2 = other1.num2;
  string1 = other1.string1;
  __isset = other1.__isset;
  return *this;
}
void Hello_struct::printTo(std::ostream& out) const {
  using ::apache::thrift::to_string;
  out << "Hello_struct(";
  out << "num1=" << to_string(num1);
  out << ", " << "num2=" << to_string(num2);
  out << ", " << "string1=" << to_string(string1);
  out << ")";
}


