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

#include <algorithm>
#include <ostream>

#include <thrift/TToString.h>




PropValueUnion::~PropValueUnion() throw() {
}


void PropValueUnion::__set_intValue(const int32_t val) {
  this->intValue = val;
__isset.intValue = true;
}

void PropValueUnion::__set_longValue(const int64_t val) {
  this->longValue = val;
__isset.longValue = true;
}

void PropValueUnion::__set_stringValue(const std::string& val) {
  this->stringValue = val;
__isset.stringValue = true;
}

void PropValueUnion::__set_doubleValue(const double val) {
  this->doubleValue = val;
__isset.doubleValue = true;
}

void PropValueUnion::__set_flag(const bool val) {
  this->flag = val;
__isset.flag = true;
}

void PropValueUnion::__set_lString(const std::vector<std::string> & val) {
  this->lString = val;
}

void PropValueUnion::__set_unionMStringString(const std::map<std::string, std::string> & val) {
  this->unionMStringString = val;
}

uint32_t PropValueUnion::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->intValue);
          this->__isset.intValue = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->longValue);
          this->__isset.longValue = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->stringValue);
          this->__isset.stringValue = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
          xfer += iprot->readDouble(this->doubleValue);
          this->__isset.doubleValue = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->flag);
          this->__isset.flag = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->lString.clear();
            uint32_t _size0;
            ::apache::thrift::protocol::TType _etype3;
            xfer += iprot->readListBegin(_etype3, _size0);
            this->lString.resize(_size0);
            uint32_t _i4;
            for (_i4 = 0; _i4 < _size0; ++_i4)
            {
              xfer += iprot->readString(this->lString[_i4]);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.lString = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_MAP) {
          {
            this->unionMStringString.clear();
            uint32_t _size5;
            ::apache::thrift::protocol::TType _ktype6;
            ::apache::thrift::protocol::TType _vtype7;
            xfer += iprot->readMapBegin(_ktype6, _vtype7, _size5);
            uint32_t _i9;
            for (_i9 = 0; _i9 < _size5; ++_i9)
            {
              std::string _key10;
              xfer += iprot->readString(_key10);
              std::string& _val11 = this->unionMStringString[_key10];
              xfer += iprot->readString(_val11);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.unionMStringString = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

  if (this->__isset.intValue) {
    xfer += oprot->writeFieldBegin("intValue", ::apache::thrift::protocol::T_I32, 1);
    xfer += oprot->writeI32(this->intValue);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.longValue) {
    xfer += oprot->writeFieldBegin("longValue", ::apache::thrift::protocol::T_I64, 2);
    xfer += oprot->writeI64(this->longValue);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.stringValue) {
    xfer += oprot->writeFieldBegin("stringValue", ::apache::thrift::protocol::T_STRING, 3);
    xfer += oprot->writeString(this->stringValue);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.doubleValue) {
    xfer += oprot->writeFieldBegin("doubleValue", ::apache::thrift::protocol::T_DOUBLE, 4);
    xfer += oprot->writeDouble(this->doubleValue);
    xfer += oprot->writeFieldEnd();
  }
  if (this->__isset.flag) {
    xfer += oprot->writeFieldBegin("flag", ::apache::thrift::protocol::T_BOOL, 5);
    xfer += oprot->writeBool(this->flag);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldBegin("lString", ::apache::thrift::protocol::T_LIST, 6);
  {
    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->lString.size()));
    std::vector<std::string> ::const_iterator _iter12;
    for (_iter12 = this->lString.begin(); _iter12 != this->lString.end(); ++_iter12)
    {
      xfer += oprot->writeString((*_iter12));
    }
    xfer += oprot->writeListEnd();
  }
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("unionMStringString", ::apache::thrift::protocol::T_MAP, 7);
  {
    xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->unionMStringString.size()));
    std::map<std::string, std::string> ::const_iterator _iter13;
    for (_iter13 = this->unionMStringString.begin(); _iter13 != this->unionMStringString.end(); ++_iter13)
    {
      xfer += oprot->writeString(_iter13->first);
      xfer += oprot->writeString(_iter13->second);
    }
    xfer += oprot->writeMapEnd();
  }
  xfer += oprot->writeFieldEnd();

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

void swap(PropValueUnion &a, PropValueUnion &b) {
  using ::std::swap;
  swap(a.intValue, b.intValue);
  swap(a.longValue, b.longValue);
  swap(a.stringValue, b.stringValue);
  swap(a.doubleValue, b.doubleValue);
  swap(a.flag, b.flag);
  swap(a.lString, b.lString);
  swap(a.unionMStringString, b.unionMStringString);
  swap(a.__isset, b.__isset);
}

PropValueUnion::PropValueUnion(const PropValueUnion& other14) {
  intValue = other14.intValue;
  longValue = other14.longValue;
  stringValue = other14.stringValue;
  doubleValue = other14.doubleValue;
  flag = other14.flag;
  lString = other14.lString;
  unionMStringString = other14.unionMStringString;
  __isset = other14.__isset;
}
PropValueUnion& PropValueUnion::operator=(const PropValueUnion& other15) {
  intValue = other15.intValue;
  longValue = other15.longValue;
  stringValue = other15.stringValue;
  doubleValue = other15.doubleValue;
  flag = other15.flag;
  lString = other15.lString;
  unionMStringString = other15.unionMStringString;
  __isset = other15.__isset;
  return *this;
}
void PropValueUnion::printTo(std::ostream& out) const {
  using ::apache::thrift::to_string;
  out << "PropValueUnion(";
  out << "intValue="; (__isset.intValue ? (out << to_string(intValue)) : (out << "<null>"));
  out << ", " << "longValue="; (__isset.longValue ? (out << to_string(longValue)) : (out << "<null>"));
  out << ", " << "stringValue="; (__isset.stringValue ? (out << to_string(stringValue)) : (out << "<null>"));
  out << ", " << "doubleValue="; (__isset.doubleValue ? (out << to_string(doubleValue)) : (out << "<null>"));
  out << ", " << "flag="; (__isset.flag ? (out << to_string(flag)) : (out << "<null>"));
  out << ", " << "lString=" << to_string(lString);
  out << ", " << "unionMStringString=" << to_string(unionMStringString);
  out << ")";
}


IntString::~IntString() throw() {
}


void IntString::__set_myint(const int32_t val) {
  this->myint = val;
}

void IntString::__set_myString(const std::string& val) {
  this->myString = val;
}

void IntString::__set_underscore_int(const int32_t val) {
  this->underscore_int = val;
}

uint32_t IntString::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->myint);
          this->__isset.myint = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->myString);
          this->__isset.myString = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->underscore_int);
          this->__isset.underscore_int = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

void swap(IntString &a, IntString &b) {
  using ::std::swap;
  swap(a.myint, b.myint);
  swap(a.myString, b.myString);
  swap(a.underscore_int, b.underscore_int);
  swap(a.__isset, b.__isset);
}

IntString::IntString(const IntString& other16) {
  myint = other16.myint;
  myString = other16.myString;
  underscore_int = other16.underscore_int;
  __isset = other16.__isset;
}
IntString& IntString::operator=(const IntString& other17) {
  myint = other17.myint;
  myString = other17.myString;
  underscore_int = other17.underscore_int;
  __isset = other17.__isset;
  return *this;
}
void IntString::printTo(std::ostream& out) const {
  using ::apache::thrift::to_string;
  out << "IntString(";
  out << "myint=" << to_string(myint);
  out << ", " << "myString=" << to_string(myString);
  out << ", " << "underscore_int=" << to_string(underscore_int);
  out << ")";
}


Complex::~Complex() throw() {
}


void Complex::__set_aint(const int32_t val) {
  this->aint = val;
}

void Complex::__set_aString(const std::string& val) {
  this->aString = val;
}

void Complex::__set_lint(const std::vector<int32_t> & val) {
  this->lint = val;
}

void Complex::__set_lString(const std::vector<std::string> & val) {
  this->lString = val;
}

void Complex::__set_lintString(const std::vector<IntString> & val) {
  this->lintString = val;
}

void Complex::__set_mStringString(const std::map<std::string, std::string> & val) {
  this->mStringString = val;
}

void Complex::__set_attributes(const std::map<std::string, std::map<std::string, std::map<std::string, PropValueUnion> > > & val) {
  this->attributes = val;
}

void Complex::__set_unionField1(const PropValueUnion& val) {
  this->unionField1 = val;
}

void Complex::__set_unionField2(const PropValueUnion& val) {
  this->unionField2 = val;
}

void Complex::__set_unionField3(const PropValueUnion& val) {
  this->unionField3 = val;
}

uint32_t Complex::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->aint);
          this->__isset.aint = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->aString);
          this->__isset.aString = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->lint.clear();
            uint32_t _size18;
            ::apache::thrift::protocol::TType _etype21;
            xfer += iprot->readListBegin(_etype21, _size18);
            this->lint.resize(_size18);
            uint32_t _i22;
            for (_i22 = 0; _i22 < _size18; ++_i22)
            {
              xfer += iprot->readI32(this->lint[_i22]);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.lint = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->lString.clear();
            uint32_t _size23;
            ::apache::thrift::protocol::TType _etype26;
            xfer += iprot->readListBegin(_etype26, _size23);
            this->lString.resize(_size23);
            uint32_t _i27;
            for (_i27 = 0; _i27 < _size23; ++_i27)
            {
              xfer += iprot->readString(this->lString[_i27]);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.lString = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->lintString.clear();
            uint32_t _size28;
            ::apache::thrift::protocol::TType _etype31;
            xfer += iprot->readListBegin(_etype31, _size28);
            this->lintString.resize(_size28);
            uint32_t _i32;
            for (_i32 = 0; _i32 < _size28; ++_i32)
            {
              xfer += this->lintString[_i32].read(iprot);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.lintString = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_MAP) {
          {
            this->mStringString.clear();
            uint32_t _size33;
            ::apache::thrift::protocol::TType _ktype34;
            ::apache::thrift::protocol::TType _vtype35;
            xfer += iprot->readMapBegin(_ktype34, _vtype35, _size33);
            uint32_t _i37;
            for (_i37 = 0; _i37 < _size33; ++_i37)
            {
              std::string _key38;
              xfer += iprot->readString(_key38);
              std::string& _val39 = this->mStringString[_key38];
              xfer += iprot->readString(_val39);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.mStringString = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_MAP) {
          {
            this->attributes.clear();
            uint32_t _size40;
            ::apache::thrift::protocol::TType _ktype41;
            ::apache::thrift::protocol::TType _vtype42;
            xfer += iprot->readMapBegin(_ktype41, _vtype42, _size40);
            uint32_t _i44;
            for (_i44 = 0; _i44 < _size40; ++_i44)
            {
              std::string _key45;
              xfer += iprot->readString(_key45);
              std::map<std::string, std::map<std::string, PropValueUnion> > & _val46 = this->attributes[_key45];
              {
                _val46.clear();
                uint32_t _size47;
                ::apache::thrift::protocol::TType _ktype48;
                ::apache::thrift::protocol::TType _vtype49;
                xfer += iprot->readMapBegin(_ktype48, _vtype49, _size47);
                uint32_t _i51;
                for (_i51 = 0; _i51 < _size47; ++_i51)
                {
                  std::string _key52;
                  xfer += iprot->readString(_key52);
                  std::map<std::string, PropValueUnion> & _val53 = _val46[_key52];
                  {
                    _val53.clear();
                    uint32_t _size54;
                    ::apache::thrift::protocol::TType _ktype55;
                    ::apache::thrift::protocol::TType _vtype56;
                    xfer += iprot->readMapBegin(_ktype55, _vtype56, _size54);
                    uint32_t _i58;
                    for (_i58 = 0; _i58 < _size54; ++_i58)
                    {
                      std::string _key59;
                      xfer += iprot->readString(_key59);
                      PropValueUnion& _val60 = _val53[_key59];
                      xfer += _val60.read(iprot);
                    }
                    xfer += iprot->readMapEnd();
                  }
                }
                xfer += iprot->readMapEnd();
              }
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.attributes = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 8:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->unionField1.read(iprot);
          this->__isset.unionField1 = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 9:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->unionField2.read(iprot);
          this->__isset.unionField2 = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 10:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->unionField3.read(iprot);
          this->__isset.unionField3 = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

  xfer += oprot->writeFieldBegin("lint", ::apache::thrift::protocol::T_LIST, 3);
  {
    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I32, static_cast<uint32_t>(this->lint.size()));
    std::vector<int32_t> ::const_iterator _iter61;
    for (_iter61 = this->lint.begin(); _iter61 != this->lint.end(); ++_iter61)
    {
      xfer += oprot->writeI32((*_iter61));
    }
    xfer += oprot->writeListEnd();
  }
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("lString", ::apache::thrift::protocol::T_LIST, 4);
  {
    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->lString.size()));
    std::vector<std::string> ::const_iterator _iter62;
    for (_iter62 = this->lString.begin(); _iter62 != this->lString.end(); ++_iter62)
    {
      xfer += oprot->writeString((*_iter62));
    }
    xfer += oprot->writeListEnd();
  }
  xfer += oprot->writeFieldEnd();

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

  xfer += oprot->writeFieldBegin("mStringString", ::apache::thrift::protocol::T_MAP, 6);
  {
    xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->mStringString.size()));
    std::map<std::string, std::string> ::const_iterator _iter64;
    for (_iter64 = this->mStringString.begin(); _iter64 != this->mStringString.end(); ++_iter64)
    {
      xfer += oprot->writeString(_iter64->first);
      xfer += oprot->writeString(_iter64->second);
    }
    xfer += oprot->writeMapEnd();
  }
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("attributes", ::apache::thrift::protocol::T_MAP, 7);
  {
    xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_MAP, static_cast<uint32_t>(this->attributes.size()));
    std::map<std::string, std::map<std::string, std::map<std::string, PropValueUnion> > > ::const_iterator _iter65;
    for (_iter65 = this->attributes.begin(); _iter65 != this->attributes.end(); ++_iter65)
    {
      xfer += oprot->writeString(_iter65->first);
      {
        xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_MAP, static_cast<uint32_t>(_iter65->second.size()));
        std::map<std::string, std::map<std::string, PropValueUnion> > ::const_iterator _iter66;
        for (_iter66 = _iter65->second.begin(); _iter66 != _iter65->second.end(); ++_iter66)
        {
          xfer += oprot->writeString(_iter66->first);
          {
            xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(_iter66->second.size()));
            std::map<std::string, PropValueUnion> ::const_iterator _iter67;
            for (_iter67 = _iter66->second.begin(); _iter67 != _iter66->second.end(); ++_iter67)
            {
              xfer += oprot->writeString(_iter67->first);
              xfer += _iter67->second.write(oprot);
            }
            xfer += oprot->writeMapEnd();
          }
        }
        xfer += oprot->writeMapEnd();
      }
    }
    xfer += oprot->writeMapEnd();
  }
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("unionField1", ::apache::thrift::protocol::T_STRUCT, 8);
  xfer += this->unionField1.write(oprot);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("unionField2", ::apache::thrift::protocol::T_STRUCT, 9);
  xfer += this->unionField2.write(oprot);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("unionField3", ::apache::thrift::protocol::T_STRUCT, 10);
  xfer += this->unionField3.write(oprot);
  xfer += oprot->writeFieldEnd();

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

void swap(Complex &a, Complex &b) {
  using ::std::swap;
  swap(a.aint, b.aint);
  swap(a.aString, b.aString);
  swap(a.lint, b.lint);
  swap(a.lString, b.lString);
  swap(a.lintString, b.lintString);
  swap(a.mStringString, b.mStringString);
  swap(a.attributes, b.attributes);
  swap(a.unionField1, b.unionField1);
  swap(a.unionField2, b.unionField2);
  swap(a.unionField3, b.unionField3);
  swap(a.__isset, b.__isset);
}

Complex::Complex(const Complex& other68) {
  aint = other68.aint;
  aString = other68.aString;
  lint = other68.lint;
  lString = other68.lString;
  lintString = other68.lintString;
  mStringString = other68.mStringString;
  attributes = other68.attributes;
  unionField1 = other68.unionField1;
  unionField2 = other68.unionField2;
  unionField3 = other68.unionField3;
  __isset = other68.__isset;
}
Complex& Complex::operator=(const Complex& other69) {
  aint = other69.aint;
  aString = other69.aString;
  lint = other69.lint;
  lString = other69.lString;
  lintString = other69.lintString;
  mStringString = other69.mStringString;
  attributes = other69.attributes;
  unionField1 = other69.unionField1;
  unionField2 = other69.unionField2;
  unionField3 = other69.unionField3;
  __isset = other69.__isset;
  return *this;
}
void Complex::printTo(std::ostream& out) const {
  using ::apache::thrift::to_string;
  out << "Complex(";
  out << "aint=" << to_string(aint);
  out << ", " << "aString=" << to_string(aString);
  out << ", " << "lint=" << to_string(lint);
  out << ", " << "lString=" << to_string(lString);
  out << ", " << "lintString=" << to_string(lintString);
  out << ", " << "mStringString=" << to_string(mStringString);
  out << ", " << "attributes=" << to_string(attributes);
  out << ", " << "unionField1=" << to_string(unionField1);
  out << ", " << "unionField2=" << to_string(unionField2);
  out << ", " << "unionField3=" << to_string(unionField3);
  out << ")";
}


SetIntString::~SetIntString() throw() {
}


void SetIntString::__set_sIntString(const std::set<IntString> & val) {
  this->sIntString = val;
}

void SetIntString::__set_aString(const std::string& val) {
  this->aString = val;
}

uint32_t SetIntString::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_SET) {
          {
            this->sIntString.clear();
            uint32_t _size70;
            ::apache::thrift::protocol::TType _etype73;
            xfer += iprot->readSetBegin(_etype73, _size70);
            uint32_t _i74;
            for (_i74 = 0; _i74 < _size70; ++_i74)
            {
              IntString _elem75;
              xfer += _elem75.read(iprot);
              this->sIntString.insert(_elem75);
            }
            xfer += iprot->readSetEnd();
          }
          this->__isset.sIntString = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->aString);
          this->__isset.aString = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

  xfer += oprot->writeFieldBegin("sIntString", ::apache::thrift::protocol::T_SET, 1);
  {
    xfer += oprot->writeSetBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->sIntString.size()));
    std::set<IntString> ::const_iterator _iter76;
    for (_iter76 = this->sIntString.begin(); _iter76 != this->sIntString.end(); ++_iter76)
    {
      xfer += (*_iter76).write(oprot);
    }
    xfer += oprot->writeSetEnd();
  }
  xfer += oprot->writeFieldEnd();

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

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

void swap(SetIntString &a, SetIntString &b) {
  using ::std::swap;
  swap(a.sIntString, b.sIntString);
  swap(a.aString, b.aString);
  swap(a.__isset, b.__isset);
}

SetIntString::SetIntString(const SetIntString& other77) {
  sIntString = other77.sIntString;
  aString = other77.aString;
  __isset = other77.__isset;
}
SetIntString& SetIntString::operator=(const SetIntString& other78) {
  sIntString = other78.sIntString;
  aString = other78.aString;
  __isset = other78.__isset;
  return *this;
}
void SetIntString::printTo(std::ostream& out) const {
  using ::apache::thrift::to_string;
  out << "SetIntString(";
  out << "sIntString=" << to_string(sIntString);
  out << ", " << "aString=" << to_string(aString);
  out << ")";
}


