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

#include "thrift/async/TAsyncChannel.h"

namespace apache { namespace thrift { namespace test {


template <class Protocol_>
uint32_t ParentService_incrementGeneration_args::read(Protocol_* 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;
    }
    xfer += iprot->skip(ftype);
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_incrementGeneration_args::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_incrementGeneration_args");

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


template <class Protocol_>
uint32_t ParentService_incrementGeneration_pargs::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_incrementGeneration_pargs");

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


template <class Protocol_>
uint32_t ParentService_incrementGeneration_result::read(Protocol_* 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 0:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->success);
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_incrementGeneration_result::write(Protocol_* oprot) const {

  uint32_t xfer = 0;

  xfer += oprot->writeStructBegin("ParentService_incrementGeneration_result");

  if (this->__isset.success) {
    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I32, 0);
    xfer += oprot->writeI32(this->success);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}


template <class Protocol_>
uint32_t ParentService_incrementGeneration_presult::read(Protocol_* 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 0:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32((*(this->success)));
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_incrementGeneration_presult::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_incrementGeneration_presult");

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

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


template <class Protocol_>
uint32_t ParentService_getGeneration_args::read(Protocol_* 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;
    }
    xfer += iprot->skip(ftype);
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_getGeneration_args::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_getGeneration_args");

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


template <class Protocol_>
uint32_t ParentService_getGeneration_pargs::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_getGeneration_pargs");

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


template <class Protocol_>
uint32_t ParentService_getGeneration_result::read(Protocol_* 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 0:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->success);
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_getGeneration_result::write(Protocol_* oprot) const {

  uint32_t xfer = 0;

  xfer += oprot->writeStructBegin("ParentService_getGeneration_result");

  if (this->__isset.success) {
    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I32, 0);
    xfer += oprot->writeI32(this->success);
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}


template <class Protocol_>
uint32_t ParentService_getGeneration_presult::read(Protocol_* 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 0:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32((*(this->success)));
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_getGeneration_presult::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_getGeneration_presult");

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

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


template <class Protocol_>
uint32_t ParentService_addString_args::read(Protocol_* 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->s);
          this->__isset.s = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_addString_args::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_addString_args");

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

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


template <class Protocol_>
uint32_t ParentService_addString_pargs::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_addString_pargs");

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

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


template <class Protocol_>
uint32_t ParentService_addString_result::read(Protocol_* 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;
    }
    xfer += iprot->skip(ftype);
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_addString_result::write(Protocol_* oprot) const {

  uint32_t xfer = 0;

  xfer += oprot->writeStructBegin("ParentService_addString_result");

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


template <class Protocol_>
uint32_t ParentService_addString_presult::read(Protocol_* 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;
    }
    xfer += iprot->skip(ftype);
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_addString_presult::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_addString_presult");

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


template <class Protocol_>
uint32_t ParentService_getStrings_args::read(Protocol_* 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;
    }
    xfer += iprot->skip(ftype);
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_getStrings_args::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_getStrings_args");

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


template <class Protocol_>
uint32_t ParentService_getStrings_pargs::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_getStrings_pargs");

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


template <class Protocol_>
uint32_t ParentService_getStrings_result::read(Protocol_* 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 0:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->success.clear();
            uint32_t _size2;
            ::apache::thrift::protocol::TType _etype5;
            xfer += iprot->readListBegin(_etype5, _size2);
            this->success.resize(_size2);
            uint32_t _i6;
            for (_i6 = 0; _i6 < _size2; ++_i6)
            {
              xfer += iprot->readString(this->success[_i6]);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_getStrings_result::write(Protocol_* oprot) const {

  uint32_t xfer = 0;

  xfer += oprot->writeStructBegin("ParentService_getStrings_result");

  if (this->__isset.success) {
    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0);
    {
      xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->success.size()));
      std::vector<std::string> ::const_iterator _iter7;
      for (_iter7 = this->success.begin(); _iter7 != this->success.end(); ++_iter7)
      {
        xfer += oprot->writeString((*_iter7));
      }
      xfer += oprot->writeListEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}


template <class Protocol_>
uint32_t ParentService_getStrings_presult::read(Protocol_* 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 0:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            (*(this->success)).clear();
            uint32_t _size8;
            ::apache::thrift::protocol::TType _etype11;
            xfer += iprot->readListBegin(_etype11, _size8);
            (*(this->success)).resize(_size8);
            uint32_t _i12;
            for (_i12 = 0; _i12 < _size8; ++_i12)
            {
              xfer += iprot->readString((*(this->success))[_i12]);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_getStrings_presult::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_getStrings_presult");

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

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


template <class Protocol_>
uint32_t ParentService_getDataWait_args::read(Protocol_* 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->length);
          this->__isset.length = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_getDataWait_args::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_getDataWait_args");

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

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


template <class Protocol_>
uint32_t ParentService_getDataWait_pargs::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_getDataWait_pargs");

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

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


template <class Protocol_>
uint32_t ParentService_getDataWait_result::read(Protocol_* 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 0:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->success);
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_getDataWait_result::write(Protocol_* oprot) const {

  uint32_t xfer = 0;

  xfer += oprot->writeStructBegin("ParentService_getDataWait_result");

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


template <class Protocol_>
uint32_t ParentService_getDataWait_presult::read(Protocol_* 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 0:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary((*(this->success)));
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_getDataWait_presult::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_getDataWait_presult");

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

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


template <class Protocol_>
uint32_t ParentService_onewayWait_args::read(Protocol_* 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;
    }
    xfer += iprot->skip(ftype);
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_onewayWait_args::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_onewayWait_args");

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


template <class Protocol_>
uint32_t ParentService_onewayWait_pargs::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_onewayWait_pargs");

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


template <class Protocol_>
uint32_t ParentService_exceptionWait_args::read(Protocol_* 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->message);
          this->__isset.message = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_exceptionWait_args::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_exceptionWait_args");

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

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


template <class Protocol_>
uint32_t ParentService_exceptionWait_pargs::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_exceptionWait_pargs");

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

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


template <class Protocol_>
uint32_t ParentService_exceptionWait_result::read(Protocol_* 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 2:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->error.read(iprot);
          this->__isset.error = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_exceptionWait_result::write(Protocol_* oprot) const {

  uint32_t xfer = 0;

  xfer += oprot->writeStructBegin("ParentService_exceptionWait_result");

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


template <class Protocol_>
uint32_t ParentService_exceptionWait_presult::read(Protocol_* 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 2:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->error.read(iprot);
          this->__isset.error = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_exceptionWait_presult::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_exceptionWait_presult");

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


template <class Protocol_>
uint32_t ParentService_unexpectedExceptionWait_args::read(Protocol_* 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->message);
          this->__isset.message = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_unexpectedExceptionWait_args::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_unexpectedExceptionWait_args");

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

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


template <class Protocol_>
uint32_t ParentService_unexpectedExceptionWait_pargs::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_unexpectedExceptionWait_pargs");

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

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


template <class Protocol_>
uint32_t ParentService_unexpectedExceptionWait_result::read(Protocol_* 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;
    }
    xfer += iprot->skip(ftype);
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_unexpectedExceptionWait_result::write(Protocol_* oprot) const {

  uint32_t xfer = 0;

  xfer += oprot->writeStructBegin("ParentService_unexpectedExceptionWait_result");

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


template <class Protocol_>
uint32_t ParentService_unexpectedExceptionWait_presult::read(Protocol_* 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;
    }
    xfer += iprot->skip(ftype);
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

template <class Protocol_>
uint32_t ParentService_unexpectedExceptionWait_presult::write(Protocol_* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("ParentService_unexpectedExceptionWait_presult");

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

template <class Protocol_>
int32_t ParentServiceClientT<Protocol_>::incrementGeneration()
{
  send_incrementGeneration();
  return recv_incrementGeneration();
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::send_incrementGeneration()
{
  int32_t cseqid = 0;
  this->oprot_->writeMessageBegin("incrementGeneration", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_incrementGeneration_pargs args;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();
}

template <class Protocol_>
int32_t ParentServiceClientT<Protocol_>::recv_incrementGeneration()
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;

  this->iprot_->readMessageBegin(fname, mtype, rseqid);
  if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
    ::apache::thrift::TApplicationException x;
    x.read(this->iprot_);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
    throw x;
  }
  if (mtype != ::apache::thrift::protocol::T_REPLY) {
    this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
  }
  if (fname.compare("incrementGeneration") != 0) {
    this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
  }
  int32_t _return;
  ParentService_incrementGeneration_presult result;
  result.success = &_return;
  result.read(this->iprot_);
  this->iprot_->readMessageEnd();
  this->iprot_->getTransport()->readEnd();

  if (result.__isset.success) {
    return _return;
  }
  throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "incrementGeneration failed: unknown result");
}

template <class Protocol_>
int32_t ParentServiceClientT<Protocol_>::getGeneration()
{
  send_getGeneration();
  return recv_getGeneration();
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::send_getGeneration()
{
  int32_t cseqid = 0;
  this->oprot_->writeMessageBegin("getGeneration", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_getGeneration_pargs args;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();
}

template <class Protocol_>
int32_t ParentServiceClientT<Protocol_>::recv_getGeneration()
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;

  this->iprot_->readMessageBegin(fname, mtype, rseqid);
  if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
    ::apache::thrift::TApplicationException x;
    x.read(this->iprot_);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
    throw x;
  }
  if (mtype != ::apache::thrift::protocol::T_REPLY) {
    this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
  }
  if (fname.compare("getGeneration") != 0) {
    this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
  }
  int32_t _return;
  ParentService_getGeneration_presult result;
  result.success = &_return;
  result.read(this->iprot_);
  this->iprot_->readMessageEnd();
  this->iprot_->getTransport()->readEnd();

  if (result.__isset.success) {
    return _return;
  }
  throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getGeneration failed: unknown result");
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::addString(const std::string& s)
{
  send_addString(s);
  recv_addString();
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::send_addString(const std::string& s)
{
  int32_t cseqid = 0;
  this->oprot_->writeMessageBegin("addString", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_addString_pargs args;
  args.s = &s;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::recv_addString()
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;

  this->iprot_->readMessageBegin(fname, mtype, rseqid);
  if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
    ::apache::thrift::TApplicationException x;
    x.read(this->iprot_);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
    throw x;
  }
  if (mtype != ::apache::thrift::protocol::T_REPLY) {
    this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
  }
  if (fname.compare("addString") != 0) {
    this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
  }
  ParentService_addString_presult result;
  result.read(this->iprot_);
  this->iprot_->readMessageEnd();
  this->iprot_->getTransport()->readEnd();

  return;
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::getStrings(std::vector<std::string> & _return)
{
  send_getStrings();
  recv_getStrings(_return);
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::send_getStrings()
{
  int32_t cseqid = 0;
  this->oprot_->writeMessageBegin("getStrings", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_getStrings_pargs args;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::recv_getStrings(std::vector<std::string> & _return)
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;

  this->iprot_->readMessageBegin(fname, mtype, rseqid);
  if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
    ::apache::thrift::TApplicationException x;
    x.read(this->iprot_);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
    throw x;
  }
  if (mtype != ::apache::thrift::protocol::T_REPLY) {
    this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
  }
  if (fname.compare("getStrings") != 0) {
    this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
  }
  ParentService_getStrings_presult result;
  result.success = &_return;
  result.read(this->iprot_);
  this->iprot_->readMessageEnd();
  this->iprot_->getTransport()->readEnd();

  if (result.__isset.success) {
    // _return pointer has now been filled
    return;
  }
  throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getStrings failed: unknown result");
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::getDataWait(std::string& _return, const int32_t length)
{
  send_getDataWait(length);
  recv_getDataWait(_return);
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::send_getDataWait(const int32_t length)
{
  int32_t cseqid = 0;
  this->oprot_->writeMessageBegin("getDataWait", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_getDataWait_pargs args;
  args.length = &length;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::recv_getDataWait(std::string& _return)
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;

  this->iprot_->readMessageBegin(fname, mtype, rseqid);
  if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
    ::apache::thrift::TApplicationException x;
    x.read(this->iprot_);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
    throw x;
  }
  if (mtype != ::apache::thrift::protocol::T_REPLY) {
    this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
  }
  if (fname.compare("getDataWait") != 0) {
    this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
  }
  ParentService_getDataWait_presult result;
  result.success = &_return;
  result.read(this->iprot_);
  this->iprot_->readMessageEnd();
  this->iprot_->getTransport()->readEnd();

  if (result.__isset.success) {
    // _return pointer has now been filled
    return;
  }
  throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getDataWait failed: unknown result");
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::onewayWait()
{
  send_onewayWait();
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::send_onewayWait()
{
  int32_t cseqid = 0;
  this->oprot_->writeMessageBegin("onewayWait", ::apache::thrift::protocol::T_ONEWAY, cseqid);

  ParentService_onewayWait_pargs args;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::exceptionWait(const std::string& message)
{
  send_exceptionWait(message);
  recv_exceptionWait();
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::send_exceptionWait(const std::string& message)
{
  int32_t cseqid = 0;
  this->oprot_->writeMessageBegin("exceptionWait", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_exceptionWait_pargs args;
  args.message = &message;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::recv_exceptionWait()
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;

  this->iprot_->readMessageBegin(fname, mtype, rseqid);
  if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
    ::apache::thrift::TApplicationException x;
    x.read(this->iprot_);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
    throw x;
  }
  if (mtype != ::apache::thrift::protocol::T_REPLY) {
    this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
  }
  if (fname.compare("exceptionWait") != 0) {
    this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
  }
  ParentService_exceptionWait_presult result;
  result.read(this->iprot_);
  this->iprot_->readMessageEnd();
  this->iprot_->getTransport()->readEnd();

  if (result.__isset.error) {
    throw result.error;
  }
  return;
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::unexpectedExceptionWait(const std::string& message)
{
  send_unexpectedExceptionWait(message);
  recv_unexpectedExceptionWait();
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::send_unexpectedExceptionWait(const std::string& message)
{
  int32_t cseqid = 0;
  this->oprot_->writeMessageBegin("unexpectedExceptionWait", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_unexpectedExceptionWait_pargs args;
  args.message = &message;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();
}

template <class Protocol_>
void ParentServiceClientT<Protocol_>::recv_unexpectedExceptionWait()
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;

  this->iprot_->readMessageBegin(fname, mtype, rseqid);
  if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
    ::apache::thrift::TApplicationException x;
    x.read(this->iprot_);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
    throw x;
  }
  if (mtype != ::apache::thrift::protocol::T_REPLY) {
    this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
  }
  if (fname.compare("unexpectedExceptionWait") != 0) {
    this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();
  }
  ParentService_unexpectedExceptionWait_presult result;
  result.read(this->iprot_);
  this->iprot_->readMessageEnd();
  this->iprot_->getTransport()->readEnd();

  return;
}

template <class Protocol_>
bool ParentServiceProcessorT<Protocol_>::dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext) {
  typename ProcessMap::iterator pfn;
  pfn = processMap_.find(fname);
  if (pfn == processMap_.end()) {
    iprot->skip(::apache::thrift::protocol::T_STRUCT);
    iprot->readMessageEnd();
    iprot->getTransport()->readEnd();
    ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, "Invalid method name: '"+fname+"'");
    oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return true;
  }
  (this->*(pfn->second.generic))(seqid, iprot, oprot, callContext);
  return true;
}

template <class Protocol_>
bool ParentServiceProcessorT<Protocol_>::dispatchCallTemplated(Protocol_* iprot, Protocol_* oprot, const std::string& fname, int32_t seqid, void* callContext) {
  typename ProcessMap::iterator pfn;
  pfn = processMap_.find(fname);
  if (pfn == processMap_.end()) {
    iprot->skip(::apache::thrift::protocol::T_STRUCT);
    iprot->readMessageEnd();
    iprot->getTransport()->readEnd();
    ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, "Invalid method name: '"+fname+"'");
    oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return true;
  }
  (this->*(pfn->second.specialized))(seqid, iprot, oprot, callContext);
  return true;
}

template <class Protocol_>
void ParentServiceProcessorT<Protocol_>::process_incrementGeneration(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
{
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.incrementGeneration", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.incrementGeneration");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preRead(ctx, "ParentService.incrementGeneration");
  }

  ParentService_incrementGeneration_args args;
  args.read(iprot);
  iprot->readMessageEnd();
  uint32_t bytes = iprot->getTransport()->readEnd();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postRead(ctx, "ParentService.incrementGeneration", bytes);
  }

  ParentService_incrementGeneration_result result;
  try {
    result.success = iface_->incrementGeneration();
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.incrementGeneration");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("incrementGeneration", ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return;
  }

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.incrementGeneration");
  }

  oprot->writeMessageBegin("incrementGeneration", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.incrementGeneration", bytes);
  }
}

template <class Protocol_>
void ParentServiceProcessorT<Protocol_>::process_incrementGeneration(int32_t seqid, Protocol_* iprot, Protocol_* oprot, void* callContext)
{
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.incrementGeneration", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.incrementGeneration");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preRead(ctx, "ParentService.incrementGeneration");
  }

  ParentService_incrementGeneration_args args;
  args.read(iprot);
  iprot->readMessageEnd();
  uint32_t bytes = iprot->getTransport()->readEnd();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postRead(ctx, "ParentService.incrementGeneration", bytes);
  }

  ParentService_incrementGeneration_result result;
  try {
    result.success = iface_->incrementGeneration();
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.incrementGeneration");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("incrementGeneration", ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return;
  }

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.incrementGeneration");
  }

  oprot->writeMessageBegin("incrementGeneration", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.incrementGeneration", bytes);
  }
}

template <class Protocol_>
void ParentServiceProcessorT<Protocol_>::process_getGeneration(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
{
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getGeneration", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getGeneration");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preRead(ctx, "ParentService.getGeneration");
  }

  ParentService_getGeneration_args args;
  args.read(iprot);
  iprot->readMessageEnd();
  uint32_t bytes = iprot->getTransport()->readEnd();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postRead(ctx, "ParentService.getGeneration", bytes);
  }

  ParentService_getGeneration_result result;
  try {
    result.success = iface_->getGeneration();
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.getGeneration");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("getGeneration", ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return;
  }

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.getGeneration");
  }

  oprot->writeMessageBegin("getGeneration", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.getGeneration", bytes);
  }
}

template <class Protocol_>
void ParentServiceProcessorT<Protocol_>::process_getGeneration(int32_t seqid, Protocol_* iprot, Protocol_* oprot, void* callContext)
{
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getGeneration", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getGeneration");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preRead(ctx, "ParentService.getGeneration");
  }

  ParentService_getGeneration_args args;
  args.read(iprot);
  iprot->readMessageEnd();
  uint32_t bytes = iprot->getTransport()->readEnd();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postRead(ctx, "ParentService.getGeneration", bytes);
  }

  ParentService_getGeneration_result result;
  try {
    result.success = iface_->getGeneration();
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.getGeneration");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("getGeneration", ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return;
  }

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.getGeneration");
  }

  oprot->writeMessageBegin("getGeneration", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.getGeneration", bytes);
  }
}

template <class Protocol_>
void ParentServiceProcessorT<Protocol_>::process_addString(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
{
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.addString", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.addString");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preRead(ctx, "ParentService.addString");
  }

  ParentService_addString_args args;
  args.read(iprot);
  iprot->readMessageEnd();
  uint32_t bytes = iprot->getTransport()->readEnd();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postRead(ctx, "ParentService.addString", bytes);
  }

  ParentService_addString_result result;
  try {
    iface_->addString(args.s);
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.addString");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("addString", ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return;
  }

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.addString");
  }

  oprot->writeMessageBegin("addString", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.addString", bytes);
  }
}

template <class Protocol_>
void ParentServiceProcessorT<Protocol_>::process_addString(int32_t seqid, Protocol_* iprot, Protocol_* oprot, void* callContext)
{
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.addString", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.addString");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preRead(ctx, "ParentService.addString");
  }

  ParentService_addString_args args;
  args.read(iprot);
  iprot->readMessageEnd();
  uint32_t bytes = iprot->getTransport()->readEnd();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postRead(ctx, "ParentService.addString", bytes);
  }

  ParentService_addString_result result;
  try {
    iface_->addString(args.s);
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.addString");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("addString", ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return;
  }

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.addString");
  }

  oprot->writeMessageBegin("addString", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.addString", bytes);
  }
}

template <class Protocol_>
void ParentServiceProcessorT<Protocol_>::process_getStrings(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
{
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getStrings", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getStrings");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preRead(ctx, "ParentService.getStrings");
  }

  ParentService_getStrings_args args;
  args.read(iprot);
  iprot->readMessageEnd();
  uint32_t bytes = iprot->getTransport()->readEnd();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postRead(ctx, "ParentService.getStrings", bytes);
  }

  ParentService_getStrings_result result;
  try {
    iface_->getStrings(result.success);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.getStrings");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("getStrings", ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return;
  }

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.getStrings");
  }

  oprot->writeMessageBegin("getStrings", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.getStrings", bytes);
  }
}

template <class Protocol_>
void ParentServiceProcessorT<Protocol_>::process_getStrings(int32_t seqid, Protocol_* iprot, Protocol_* oprot, void* callContext)
{
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getStrings", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getStrings");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preRead(ctx, "ParentService.getStrings");
  }

  ParentService_getStrings_args args;
  args.read(iprot);
  iprot->readMessageEnd();
  uint32_t bytes = iprot->getTransport()->readEnd();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postRead(ctx, "ParentService.getStrings", bytes);
  }

  ParentService_getStrings_result result;
  try {
    iface_->getStrings(result.success);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.getStrings");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("getStrings", ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return;
  }

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.getStrings");
  }

  oprot->writeMessageBegin("getStrings", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.getStrings", bytes);
  }
}

template <class Protocol_>
void ParentServiceProcessorT<Protocol_>::process_getDataWait(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
{
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getDataWait", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getDataWait");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preRead(ctx, "ParentService.getDataWait");
  }

  ParentService_getDataWait_args args;
  args.read(iprot);
  iprot->readMessageEnd();
  uint32_t bytes = iprot->getTransport()->readEnd();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postRead(ctx, "ParentService.getDataWait", bytes);
  }

  ParentService_getDataWait_result result;
  try {
    iface_->getDataWait(result.success, args.length);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.getDataWait");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("getDataWait", ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return;
  }

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.getDataWait");
  }

  oprot->writeMessageBegin("getDataWait", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.getDataWait", bytes);
  }
}

template <class Protocol_>
void ParentServiceProcessorT<Protocol_>::process_getDataWait(int32_t seqid, Protocol_* iprot, Protocol_* oprot, void* callContext)
{
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getDataWait", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getDataWait");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preRead(ctx, "ParentService.getDataWait");
  }

  ParentService_getDataWait_args args;
  args.read(iprot);
  iprot->readMessageEnd();
  uint32_t bytes = iprot->getTransport()->readEnd();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postRead(ctx, "ParentService.getDataWait", bytes);
  }

  ParentService_getDataWait_result result;
  try {
    iface_->getDataWait(result.success, args.length);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.getDataWait");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("getDataWait", ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return;
  }

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.getDataWait");
  }

  oprot->writeMessageBegin("getDataWait", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.getDataWait", bytes);
  }
}

template <class Protocol_>
void ParentServiceProcessorT<Protocol_>::process_onewayWait(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
{
  (void) seqid;
  (void) oprot;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.onewayWait", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.onewayWait");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preRead(ctx, "ParentService.onewayWait");
  }

  ParentService_onewayWait_args args;
  args.read(iprot);
  iprot->readMessageEnd();
  uint32_t bytes = iprot->getTransport()->readEnd();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postRead(ctx, "ParentService.onewayWait", bytes);
  }

  try {
    iface_->onewayWait();
  } catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.onewayWait");
    }
    return;
  }

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->asyncComplete(ctx, "ParentService.onewayWait");
  }

  return;
}

template <class Protocol_>
void ParentServiceProcessorT<Protocol_>::process_onewayWait(int32_t, Protocol_* iprot, Protocol_*, void* callContext)
{
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.onewayWait", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.onewayWait");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preRead(ctx, "ParentService.onewayWait");
  }

  ParentService_onewayWait_args args;
  args.read(iprot);
  iprot->readMessageEnd();
  uint32_t bytes = iprot->getTransport()->readEnd();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postRead(ctx, "ParentService.onewayWait", bytes);
  }

  try {
    iface_->onewayWait();
  } catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.onewayWait");
    }
    return;
  }

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->asyncComplete(ctx, "ParentService.onewayWait");
  }

  return;
}

template <class Protocol_>
void ParentServiceProcessorT<Protocol_>::process_exceptionWait(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
{
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.exceptionWait", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.exceptionWait");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preRead(ctx, "ParentService.exceptionWait");
  }

  ParentService_exceptionWait_args args;
  args.read(iprot);
  iprot->readMessageEnd();
  uint32_t bytes = iprot->getTransport()->readEnd();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postRead(ctx, "ParentService.exceptionWait", bytes);
  }

  ParentService_exceptionWait_result result;
  try {
    iface_->exceptionWait(args.message);
  } catch (MyError &error) {
    result.error = error;
    result.__isset.error = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.exceptionWait");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("exceptionWait", ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return;
  }

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.exceptionWait");
  }

  oprot->writeMessageBegin("exceptionWait", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.exceptionWait", bytes);
  }
}

template <class Protocol_>
void ParentServiceProcessorT<Protocol_>::process_exceptionWait(int32_t seqid, Protocol_* iprot, Protocol_* oprot, void* callContext)
{
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.exceptionWait", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.exceptionWait");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preRead(ctx, "ParentService.exceptionWait");
  }

  ParentService_exceptionWait_args args;
  args.read(iprot);
  iprot->readMessageEnd();
  uint32_t bytes = iprot->getTransport()->readEnd();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postRead(ctx, "ParentService.exceptionWait", bytes);
  }

  ParentService_exceptionWait_result result;
  try {
    iface_->exceptionWait(args.message);
  } catch (MyError &error) {
    result.error = error;
    result.__isset.error = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.exceptionWait");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("exceptionWait", ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return;
  }

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.exceptionWait");
  }

  oprot->writeMessageBegin("exceptionWait", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.exceptionWait", bytes);
  }
}

template <class Protocol_>
void ParentServiceProcessorT<Protocol_>::process_unexpectedExceptionWait(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
{
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.unexpectedExceptionWait", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.unexpectedExceptionWait");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preRead(ctx, "ParentService.unexpectedExceptionWait");
  }

  ParentService_unexpectedExceptionWait_args args;
  args.read(iprot);
  iprot->readMessageEnd();
  uint32_t bytes = iprot->getTransport()->readEnd();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postRead(ctx, "ParentService.unexpectedExceptionWait", bytes);
  }

  ParentService_unexpectedExceptionWait_result result;
  try {
    iface_->unexpectedExceptionWait(args.message);
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.unexpectedExceptionWait");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("unexpectedExceptionWait", ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return;
  }

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.unexpectedExceptionWait");
  }

  oprot->writeMessageBegin("unexpectedExceptionWait", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.unexpectedExceptionWait", bytes);
  }
}

template <class Protocol_>
void ParentServiceProcessorT<Protocol_>::process_unexpectedExceptionWait(int32_t seqid, Protocol_* iprot, Protocol_* oprot, void* callContext)
{
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.unexpectedExceptionWait", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.unexpectedExceptionWait");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preRead(ctx, "ParentService.unexpectedExceptionWait");
  }

  ParentService_unexpectedExceptionWait_args args;
  args.read(iprot);
  iprot->readMessageEnd();
  uint32_t bytes = iprot->getTransport()->readEnd();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postRead(ctx, "ParentService.unexpectedExceptionWait", bytes);
  }

  ParentService_unexpectedExceptionWait_result result;
  try {
    iface_->unexpectedExceptionWait(args.message);
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.unexpectedExceptionWait");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("unexpectedExceptionWait", ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return;
  }

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.unexpectedExceptionWait");
  }

  oprot->writeMessageBegin("unexpectedExceptionWait", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.unexpectedExceptionWait", bytes);
  }
}

template <class Protocol_>
::std::shared_ptr< ::apache::thrift::TProcessor > ParentServiceProcessorFactoryT<Protocol_>::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) {
  ::apache::thrift::ReleaseHandler< ParentServiceIfFactory > cleanup(handlerFactory_);
  ::std::shared_ptr< ParentServiceIf > handler(handlerFactory_->getHandler(connInfo), cleanup);
  ::std::shared_ptr< ::apache::thrift::TProcessor > processor(new ParentServiceProcessorT<Protocol_>(handler));
  return processor;
}

template <class Protocol_>
int32_t ParentServiceConcurrentClientT<Protocol_>::incrementGeneration()
{
  int32_t seqid = send_incrementGeneration();
  return recv_incrementGeneration(seqid);
}

template <class Protocol_>
int32_t ParentServiceConcurrentClientT<Protocol_>::send_incrementGeneration()
{
  int32_t cseqid = this->sync_->generateSeqId();
  ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
  this->oprot_->writeMessageBegin("incrementGeneration", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_incrementGeneration_pargs args;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();

  sentry.commit();
  return cseqid;
}

template <class Protocol_>
int32_t ParentServiceConcurrentClientT<Protocol_>::recv_incrementGeneration(const int32_t seqid)
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;

  // the read mutex gets dropped and reacquired as part of waitForWork()
  // The destructor of this sentry wakes up other clients
  ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);

  while(true) {
    if(!this->sync_->getPending(fname, mtype, rseqid)) {
      this->iprot_->readMessageBegin(fname, mtype, rseqid);
    }
    if(seqid == rseqid) {
      if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
        ::apache::thrift::TApplicationException x;
        x.read(this->iprot_);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();
        sentry.commit();
        throw x;
      }
      if (mtype != ::apache::thrift::protocol::T_REPLY) {
        this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();
      }
      if (fname.compare("incrementGeneration") != 0) {
        this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();

        // in a bad state, don't commit
        using ::apache::thrift::protocol::TProtocolException;
        throw TProtocolException(TProtocolException::INVALID_DATA);
      }
      int32_t _return;
      ParentService_incrementGeneration_presult result;
      result.success = &_return;
      result.read(this->iprot_);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();

      if (result.__isset.success) {
        sentry.commit();
        return _return;
      }
      // in a bad state, don't commit
      throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "incrementGeneration failed: unknown result");
    }
    // seqid != rseqid
    this->sync_->updatePending(fname, mtype, rseqid);

    // this will temporarily unlock the readMutex, and let other clients get work done
    this->sync_->waitForWork(seqid);
  } // end while(true)
}

template <class Protocol_>
int32_t ParentServiceConcurrentClientT<Protocol_>::getGeneration()
{
  int32_t seqid = send_getGeneration();
  return recv_getGeneration(seqid);
}

template <class Protocol_>
int32_t ParentServiceConcurrentClientT<Protocol_>::send_getGeneration()
{
  int32_t cseqid = this->sync_->generateSeqId();
  ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
  this->oprot_->writeMessageBegin("getGeneration", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_getGeneration_pargs args;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();

  sentry.commit();
  return cseqid;
}

template <class Protocol_>
int32_t ParentServiceConcurrentClientT<Protocol_>::recv_getGeneration(const int32_t seqid)
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;

  // the read mutex gets dropped and reacquired as part of waitForWork()
  // The destructor of this sentry wakes up other clients
  ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);

  while(true) {
    if(!this->sync_->getPending(fname, mtype, rseqid)) {
      this->iprot_->readMessageBegin(fname, mtype, rseqid);
    }
    if(seqid == rseqid) {
      if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
        ::apache::thrift::TApplicationException x;
        x.read(this->iprot_);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();
        sentry.commit();
        throw x;
      }
      if (mtype != ::apache::thrift::protocol::T_REPLY) {
        this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();
      }
      if (fname.compare("getGeneration") != 0) {
        this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();

        // in a bad state, don't commit
        using ::apache::thrift::protocol::TProtocolException;
        throw TProtocolException(TProtocolException::INVALID_DATA);
      }
      int32_t _return;
      ParentService_getGeneration_presult result;
      result.success = &_return;
      result.read(this->iprot_);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();

      if (result.__isset.success) {
        sentry.commit();
        return _return;
      }
      // in a bad state, don't commit
      throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getGeneration failed: unknown result");
    }
    // seqid != rseqid
    this->sync_->updatePending(fname, mtype, rseqid);

    // this will temporarily unlock the readMutex, and let other clients get work done
    this->sync_->waitForWork(seqid);
  } // end while(true)
}

template <class Protocol_>
void ParentServiceConcurrentClientT<Protocol_>::addString(const std::string& s)
{
  int32_t seqid = send_addString(s);
  recv_addString(seqid);
}

template <class Protocol_>
int32_t ParentServiceConcurrentClientT<Protocol_>::send_addString(const std::string& s)
{
  int32_t cseqid = this->sync_->generateSeqId();
  ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
  this->oprot_->writeMessageBegin("addString", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_addString_pargs args;
  args.s = &s;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();

  sentry.commit();
  return cseqid;
}

template <class Protocol_>
void ParentServiceConcurrentClientT<Protocol_>::recv_addString(const int32_t seqid)
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;

  // the read mutex gets dropped and reacquired as part of waitForWork()
  // The destructor of this sentry wakes up other clients
  ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);

  while(true) {
    if(!this->sync_->getPending(fname, mtype, rseqid)) {
      this->iprot_->readMessageBegin(fname, mtype, rseqid);
    }
    if(seqid == rseqid) {
      if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
        ::apache::thrift::TApplicationException x;
        x.read(this->iprot_);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();
        sentry.commit();
        throw x;
      }
      if (mtype != ::apache::thrift::protocol::T_REPLY) {
        this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();
      }
      if (fname.compare("addString") != 0) {
        this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();

        // in a bad state, don't commit
        using ::apache::thrift::protocol::TProtocolException;
        throw TProtocolException(TProtocolException::INVALID_DATA);
      }
      ParentService_addString_presult result;
      result.read(this->iprot_);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();

      sentry.commit();
      return;
    }
    // seqid != rseqid
    this->sync_->updatePending(fname, mtype, rseqid);

    // this will temporarily unlock the readMutex, and let other clients get work done
    this->sync_->waitForWork(seqid);
  } // end while(true)
}

template <class Protocol_>
void ParentServiceConcurrentClientT<Protocol_>::getStrings(std::vector<std::string> & _return)
{
  int32_t seqid = send_getStrings();
  recv_getStrings(_return, seqid);
}

template <class Protocol_>
int32_t ParentServiceConcurrentClientT<Protocol_>::send_getStrings()
{
  int32_t cseqid = this->sync_->generateSeqId();
  ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
  this->oprot_->writeMessageBegin("getStrings", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_getStrings_pargs args;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();

  sentry.commit();
  return cseqid;
}

template <class Protocol_>
void ParentServiceConcurrentClientT<Protocol_>::recv_getStrings(std::vector<std::string> & _return, const int32_t seqid)
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;

  // the read mutex gets dropped and reacquired as part of waitForWork()
  // The destructor of this sentry wakes up other clients
  ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);

  while(true) {
    if(!this->sync_->getPending(fname, mtype, rseqid)) {
      this->iprot_->readMessageBegin(fname, mtype, rseqid);
    }
    if(seqid == rseqid) {
      if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
        ::apache::thrift::TApplicationException x;
        x.read(this->iprot_);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();
        sentry.commit();
        throw x;
      }
      if (mtype != ::apache::thrift::protocol::T_REPLY) {
        this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();
      }
      if (fname.compare("getStrings") != 0) {
        this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();

        // in a bad state, don't commit
        using ::apache::thrift::protocol::TProtocolException;
        throw TProtocolException(TProtocolException::INVALID_DATA);
      }
      ParentService_getStrings_presult result;
      result.success = &_return;
      result.read(this->iprot_);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();

      if (result.__isset.success) {
        // _return pointer has now been filled
        sentry.commit();
        return;
      }
      // in a bad state, don't commit
      throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getStrings failed: unknown result");
    }
    // seqid != rseqid
    this->sync_->updatePending(fname, mtype, rseqid);

    // this will temporarily unlock the readMutex, and let other clients get work done
    this->sync_->waitForWork(seqid);
  } // end while(true)
}

template <class Protocol_>
void ParentServiceConcurrentClientT<Protocol_>::getDataWait(std::string& _return, const int32_t length)
{
  int32_t seqid = send_getDataWait(length);
  recv_getDataWait(_return, seqid);
}

template <class Protocol_>
int32_t ParentServiceConcurrentClientT<Protocol_>::send_getDataWait(const int32_t length)
{
  int32_t cseqid = this->sync_->generateSeqId();
  ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
  this->oprot_->writeMessageBegin("getDataWait", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_getDataWait_pargs args;
  args.length = &length;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();

  sentry.commit();
  return cseqid;
}

template <class Protocol_>
void ParentServiceConcurrentClientT<Protocol_>::recv_getDataWait(std::string& _return, const int32_t seqid)
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;

  // the read mutex gets dropped and reacquired as part of waitForWork()
  // The destructor of this sentry wakes up other clients
  ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);

  while(true) {
    if(!this->sync_->getPending(fname, mtype, rseqid)) {
      this->iprot_->readMessageBegin(fname, mtype, rseqid);
    }
    if(seqid == rseqid) {
      if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
        ::apache::thrift::TApplicationException x;
        x.read(this->iprot_);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();
        sentry.commit();
        throw x;
      }
      if (mtype != ::apache::thrift::protocol::T_REPLY) {
        this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();
      }
      if (fname.compare("getDataWait") != 0) {
        this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();

        // in a bad state, don't commit
        using ::apache::thrift::protocol::TProtocolException;
        throw TProtocolException(TProtocolException::INVALID_DATA);
      }
      ParentService_getDataWait_presult result;
      result.success = &_return;
      result.read(this->iprot_);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();

      if (result.__isset.success) {
        // _return pointer has now been filled
        sentry.commit();
        return;
      }
      // in a bad state, don't commit
      throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getDataWait failed: unknown result");
    }
    // seqid != rseqid
    this->sync_->updatePending(fname, mtype, rseqid);

    // this will temporarily unlock the readMutex, and let other clients get work done
    this->sync_->waitForWork(seqid);
  } // end while(true)
}

template <class Protocol_>
void ParentServiceConcurrentClientT<Protocol_>::onewayWait()
{
  send_onewayWait();
}

template <class Protocol_>
void ParentServiceConcurrentClientT<Protocol_>::send_onewayWait()
{
  int32_t cseqid = 0;
  ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
  this->oprot_->writeMessageBegin("onewayWait", ::apache::thrift::protocol::T_ONEWAY, cseqid);

  ParentService_onewayWait_pargs args;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();

  sentry.commit();
}

template <class Protocol_>
void ParentServiceConcurrentClientT<Protocol_>::exceptionWait(const std::string& message)
{
  int32_t seqid = send_exceptionWait(message);
  recv_exceptionWait(seqid);
}

template <class Protocol_>
int32_t ParentServiceConcurrentClientT<Protocol_>::send_exceptionWait(const std::string& message)
{
  int32_t cseqid = this->sync_->generateSeqId();
  ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
  this->oprot_->writeMessageBegin("exceptionWait", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_exceptionWait_pargs args;
  args.message = &message;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();

  sentry.commit();
  return cseqid;
}

template <class Protocol_>
void ParentServiceConcurrentClientT<Protocol_>::recv_exceptionWait(const int32_t seqid)
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;

  // the read mutex gets dropped and reacquired as part of waitForWork()
  // The destructor of this sentry wakes up other clients
  ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);

  while(true) {
    if(!this->sync_->getPending(fname, mtype, rseqid)) {
      this->iprot_->readMessageBegin(fname, mtype, rseqid);
    }
    if(seqid == rseqid) {
      if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
        ::apache::thrift::TApplicationException x;
        x.read(this->iprot_);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();
        sentry.commit();
        throw x;
      }
      if (mtype != ::apache::thrift::protocol::T_REPLY) {
        this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();
      }
      if (fname.compare("exceptionWait") != 0) {
        this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();

        // in a bad state, don't commit
        using ::apache::thrift::protocol::TProtocolException;
        throw TProtocolException(TProtocolException::INVALID_DATA);
      }
      ParentService_exceptionWait_presult result;
      result.read(this->iprot_);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();

      if (result.__isset.error) {
        sentry.commit();
        throw result.error;
      }
      sentry.commit();
      return;
    }
    // seqid != rseqid
    this->sync_->updatePending(fname, mtype, rseqid);

    // this will temporarily unlock the readMutex, and let other clients get work done
    this->sync_->waitForWork(seqid);
  } // end while(true)
}

template <class Protocol_>
void ParentServiceConcurrentClientT<Protocol_>::unexpectedExceptionWait(const std::string& message)
{
  int32_t seqid = send_unexpectedExceptionWait(message);
  recv_unexpectedExceptionWait(seqid);
}

template <class Protocol_>
int32_t ParentServiceConcurrentClientT<Protocol_>::send_unexpectedExceptionWait(const std::string& message)
{
  int32_t cseqid = this->sync_->generateSeqId();
  ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
  this->oprot_->writeMessageBegin("unexpectedExceptionWait", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_unexpectedExceptionWait_pargs args;
  args.message = &message;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();

  sentry.commit();
  return cseqid;
}

template <class Protocol_>
void ParentServiceConcurrentClientT<Protocol_>::recv_unexpectedExceptionWait(const int32_t seqid)
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;

  // the read mutex gets dropped and reacquired as part of waitForWork()
  // The destructor of this sentry wakes up other clients
  ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);

  while(true) {
    if(!this->sync_->getPending(fname, mtype, rseqid)) {
      this->iprot_->readMessageBegin(fname, mtype, rseqid);
    }
    if(seqid == rseqid) {
      if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
        ::apache::thrift::TApplicationException x;
        x.read(this->iprot_);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();
        sentry.commit();
        throw x;
      }
      if (mtype != ::apache::thrift::protocol::T_REPLY) {
        this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();
      }
      if (fname.compare("unexpectedExceptionWait") != 0) {
        this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
        this->iprot_->readMessageEnd();
        this->iprot_->getTransport()->readEnd();

        // in a bad state, don't commit
        using ::apache::thrift::protocol::TProtocolException;
        throw TProtocolException(TProtocolException::INVALID_DATA);
      }
      ParentService_unexpectedExceptionWait_presult result;
      result.read(this->iprot_);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();

      sentry.commit();
      return;
    }
    // seqid != rseqid
    this->sync_->updatePending(fname, mtype, rseqid);

    // this will temporarily unlock the readMutex, and let other clients get work done
    this->sync_->waitForWork(seqid);
  } // end while(true)
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::incrementGeneration(::std::function<void(ParentServiceCobClientT<Protocol_>* client)> cob)
{
  send_incrementGeneration();
  this->channel_->sendAndRecvMessage(::std::bind(cob, this), this->otrans_.get(), this->itrans_.get());
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::send_incrementGeneration()
{
  int32_t cseqid = 0;
  this->otrans_->resetBuffer();
  this->oprot_->writeMessageBegin("incrementGeneration", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_incrementGeneration_pargs args;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();
}

template <class Protocol_>
int32_t ParentServiceCobClientT<Protocol_>::recv_incrementGeneration()
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;
  bool completed = false;

  try {
    this->iprot_->readMessageBegin(fname, mtype, rseqid);
    if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
      ::apache::thrift::TApplicationException x;
      x.read(this->iprot_);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(true);
      throw x;
    }
    if (mtype != ::apache::thrift::protocol::T_REPLY) {
      this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(false);
    }
    if (fname.compare("incrementGeneration") != 0) {
      this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(false);
    }
    int32_t _return;
    ParentService_incrementGeneration_presult result;
    result.success = &_return;
    result.read(this->iprot_);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();

    if (result.__isset.success) {
      completed = true;
      completed__(true);
      return _return;
    }
    completed = true;
    completed__(true);
    throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "incrementGeneration failed: unknown result");
  } catch (...) {
    if (!completed) {
      completed__(false);
    }
    throw;
  }
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::getGeneration(::std::function<void(ParentServiceCobClientT<Protocol_>* client)> cob)
{
  send_getGeneration();
  this->channel_->sendAndRecvMessage(::std::bind(cob, this), this->otrans_.get(), this->itrans_.get());
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::send_getGeneration()
{
  int32_t cseqid = 0;
  this->otrans_->resetBuffer();
  this->oprot_->writeMessageBegin("getGeneration", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_getGeneration_pargs args;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();
}

template <class Protocol_>
int32_t ParentServiceCobClientT<Protocol_>::recv_getGeneration()
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;
  bool completed = false;

  try {
    this->iprot_->readMessageBegin(fname, mtype, rseqid);
    if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
      ::apache::thrift::TApplicationException x;
      x.read(this->iprot_);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(true);
      throw x;
    }
    if (mtype != ::apache::thrift::protocol::T_REPLY) {
      this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(false);
    }
    if (fname.compare("getGeneration") != 0) {
      this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(false);
    }
    int32_t _return;
    ParentService_getGeneration_presult result;
    result.success = &_return;
    result.read(this->iprot_);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();

    if (result.__isset.success) {
      completed = true;
      completed__(true);
      return _return;
    }
    completed = true;
    completed__(true);
    throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getGeneration failed: unknown result");
  } catch (...) {
    if (!completed) {
      completed__(false);
    }
    throw;
  }
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::addString(::std::function<void(ParentServiceCobClientT<Protocol_>* client)> cob, const std::string& s)
{
  send_addString(s);
  this->channel_->sendAndRecvMessage(::std::bind(cob, this), this->otrans_.get(), this->itrans_.get());
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::send_addString(const std::string& s)
{
  int32_t cseqid = 0;
  this->otrans_->resetBuffer();
  this->oprot_->writeMessageBegin("addString", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_addString_pargs args;
  args.s = &s;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::recv_addString()
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;
  bool completed = false;

  try {
    this->iprot_->readMessageBegin(fname, mtype, rseqid);
    if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
      ::apache::thrift::TApplicationException x;
      x.read(this->iprot_);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(true);
      throw x;
    }
    if (mtype != ::apache::thrift::protocol::T_REPLY) {
      this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(false);
    }
    if (fname.compare("addString") != 0) {
      this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(false);
    }
    ParentService_addString_presult result;
    result.read(this->iprot_);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();

    completed = true;
    completed__(true);
    return;
  } catch (...) {
    if (!completed) {
      completed__(false);
    }
    throw;
  }
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::getStrings(::std::function<void(ParentServiceCobClientT<Protocol_>* client)> cob)
{
  send_getStrings();
  this->channel_->sendAndRecvMessage(::std::bind(cob, this), this->otrans_.get(), this->itrans_.get());
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::send_getStrings()
{
  int32_t cseqid = 0;
  this->otrans_->resetBuffer();
  this->oprot_->writeMessageBegin("getStrings", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_getStrings_pargs args;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::recv_getStrings(std::vector<std::string> & _return)
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;
  bool completed = false;

  try {
    this->iprot_->readMessageBegin(fname, mtype, rseqid);
    if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
      ::apache::thrift::TApplicationException x;
      x.read(this->iprot_);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(true);
      throw x;
    }
    if (mtype != ::apache::thrift::protocol::T_REPLY) {
      this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(false);
    }
    if (fname.compare("getStrings") != 0) {
      this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(false);
    }
    ParentService_getStrings_presult result;
    result.success = &_return;
    result.read(this->iprot_);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();

    if (result.__isset.success) {
      // _return pointer has now been filled
      completed = true;
      completed__(true);
      return;
    }
    completed = true;
    completed__(true);
    throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getStrings failed: unknown result");
  } catch (...) {
    if (!completed) {
      completed__(false);
    }
    throw;
  }
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::getDataWait(::std::function<void(ParentServiceCobClientT<Protocol_>* client)> cob, const int32_t length)
{
  send_getDataWait(length);
  this->channel_->sendAndRecvMessage(::std::bind(cob, this), this->otrans_.get(), this->itrans_.get());
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::send_getDataWait(const int32_t length)
{
  int32_t cseqid = 0;
  this->otrans_->resetBuffer();
  this->oprot_->writeMessageBegin("getDataWait", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_getDataWait_pargs args;
  args.length = &length;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::recv_getDataWait(std::string& _return)
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;
  bool completed = false;

  try {
    this->iprot_->readMessageBegin(fname, mtype, rseqid);
    if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
      ::apache::thrift::TApplicationException x;
      x.read(this->iprot_);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(true);
      throw x;
    }
    if (mtype != ::apache::thrift::protocol::T_REPLY) {
      this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(false);
    }
    if (fname.compare("getDataWait") != 0) {
      this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(false);
    }
    ParentService_getDataWait_presult result;
    result.success = &_return;
    result.read(this->iprot_);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();

    if (result.__isset.success) {
      // _return pointer has now been filled
      completed = true;
      completed__(true);
      return;
    }
    completed = true;
    completed__(true);
    throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getDataWait failed: unknown result");
  } catch (...) {
    if (!completed) {
      completed__(false);
    }
    throw;
  }
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::onewayWait(::std::function<void(ParentServiceCobClientT<Protocol_>* client)> cob)
{
  send_onewayWait();
  this->channel_->sendMessage(::std::bind(cob, this), this->otrans_.get());
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::send_onewayWait()
{
  int32_t cseqid = 0;
  this->otrans_->resetBuffer();
  this->oprot_->writeMessageBegin("onewayWait", ::apache::thrift::protocol::T_ONEWAY, cseqid);

  ParentService_onewayWait_pargs args;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::exceptionWait(::std::function<void(ParentServiceCobClientT<Protocol_>* client)> cob, const std::string& message)
{
  send_exceptionWait(message);
  this->channel_->sendAndRecvMessage(::std::bind(cob, this), this->otrans_.get(), this->itrans_.get());
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::send_exceptionWait(const std::string& message)
{
  int32_t cseqid = 0;
  this->otrans_->resetBuffer();
  this->oprot_->writeMessageBegin("exceptionWait", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_exceptionWait_pargs args;
  args.message = &message;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::recv_exceptionWait()
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;
  bool completed = false;

  try {
    this->iprot_->readMessageBegin(fname, mtype, rseqid);
    if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
      ::apache::thrift::TApplicationException x;
      x.read(this->iprot_);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(true);
      throw x;
    }
    if (mtype != ::apache::thrift::protocol::T_REPLY) {
      this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(false);
    }
    if (fname.compare("exceptionWait") != 0) {
      this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(false);
    }
    ParentService_exceptionWait_presult result;
    result.read(this->iprot_);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();

    if (result.__isset.error) {
      completed = true;
      completed__(true);
      throw result.error;
    }
    completed = true;
    completed__(true);
    return;
  } catch (...) {
    if (!completed) {
      completed__(false);
    }
    throw;
  }
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::unexpectedExceptionWait(::std::function<void(ParentServiceCobClientT<Protocol_>* client)> cob, const std::string& message)
{
  send_unexpectedExceptionWait(message);
  this->channel_->sendAndRecvMessage(::std::bind(cob, this), this->otrans_.get(), this->itrans_.get());
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::send_unexpectedExceptionWait(const std::string& message)
{
  int32_t cseqid = 0;
  this->otrans_->resetBuffer();
  this->oprot_->writeMessageBegin("unexpectedExceptionWait", ::apache::thrift::protocol::T_CALL, cseqid);

  ParentService_unexpectedExceptionWait_pargs args;
  args.message = &message;
  args.write(this->oprot_);

  this->oprot_->writeMessageEnd();
  this->oprot_->getTransport()->writeEnd();
  this->oprot_->getTransport()->flush();
}

template <class Protocol_>
void ParentServiceCobClientT<Protocol_>::recv_unexpectedExceptionWait()
{

  int32_t rseqid = 0;
  std::string fname;
  ::apache::thrift::protocol::TMessageType mtype;
  bool completed = false;

  try {
    this->iprot_->readMessageBegin(fname, mtype, rseqid);
    if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
      ::apache::thrift::TApplicationException x;
      x.read(this->iprot_);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(true);
      throw x;
    }
    if (mtype != ::apache::thrift::protocol::T_REPLY) {
      this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(false);
    }
    if (fname.compare("unexpectedExceptionWait") != 0) {
      this->iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      this->iprot_->readMessageEnd();
      this->iprot_->getTransport()->readEnd();
      completed = true;
      completed__(false);
    }
    ParentService_unexpectedExceptionWait_presult result;
    result.read(this->iprot_);
    this->iprot_->readMessageEnd();
    this->iprot_->getTransport()->readEnd();

    completed = true;
    completed__(true);
    return;
  } catch (...) {
    if (!completed) {
      completed__(false);
    }
    throw;
  }
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::dispatchCall(::std::function<void(bool ok)> cob, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid) {
  typename ProcessMap::iterator pfn;
  pfn = processMap_.find(fname);
  if (pfn == processMap_.end()) {
    iprot->skip(::apache::thrift::protocol::T_STRUCT);
    iprot->readMessageEnd();
    iprot->getTransport()->readEnd();
    ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, "Invalid method name: '"+fname+"'");
    oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return cob(true);
  }
  (this->*(pfn->second.generic))(cob, seqid, iprot, oprot);
  return;
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::dispatchCallTemplated(::std::function<void(bool ok)> cob, Protocol_* iprot, Protocol_* oprot, const std::string& fname, int32_t seqid) {
  typename ProcessMap::iterator pfn;
  pfn = processMap_.find(fname);
  if (pfn == processMap_.end()) {
    iprot->skip(::apache::thrift::protocol::T_STRUCT);
    iprot->readMessageEnd();
    iprot->getTransport()->readEnd();
    ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, "Invalid method name: '"+fname+"'");
    oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return cob(true);
  }
  (this->*(pfn->second.specialized))(cob, seqid, iprot, oprot);
  return;
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::process_incrementGeneration(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot)
{
  Protocol_* _iprot = dynamic_cast<Protocol_*>(iprot);
  Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);
  if (_iprot && _oprot) {
    return process_incrementGeneration(cob, seqid, _iprot, _oprot);
  }
  T_GENERIC_PROTOCOL(this, iprot, _iprot);
  T_GENERIC_PROTOCOL(this, oprot, _oprot);

  ParentService_incrementGeneration_args args;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.incrementGeneration", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.incrementGeneration");

  try {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "ParentService.incrementGeneration");
    }
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "ParentService.incrementGeneration", bytes);
    }
  }
  catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.incrementGeneration");
    }
    return cob(false);
  }
  freer.unregister();
  void (ParentServiceAsyncProcessorT<Protocol_>::*return_fn)(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* oprot, void* ctx, const int32_t& _return) =
    &ParentServiceAsyncProcessorT<Protocol_>::return_incrementGeneration;
  iface_->incrementGeneration(
      ::std::bind(return_fn, this, cob, seqid, oprot, ctx, ::std::placeholders::_1));
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::return_incrementGeneration(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* oprot, void* ctx, const int32_t& _return)
{
  Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);
  if (_oprot) {
    return return_incrementGeneration(cob, seqid, _oprot, ctx, _return);
  }
  T_GENERIC_PROTOCOL(this, oprot, _oprot);

  ParentService_incrementGeneration_presult result;
  result.success = const_cast<int32_t*>(&_return);
  result.__isset.success = true;

  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.incrementGeneration", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.incrementGeneration");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.incrementGeneration");
  }

  oprot->writeMessageBegin("incrementGeneration", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  uint32_t bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.incrementGeneration", bytes);
  }
  return cob(true);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::process_incrementGeneration(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* iprot, Protocol_* oprot)
{
  ParentService_incrementGeneration_args args;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.incrementGeneration", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.incrementGeneration");

  try {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "ParentService.incrementGeneration");
    }
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "ParentService.incrementGeneration", bytes);
    }
  }
  catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.incrementGeneration");
    }
    return cob(false);
  }
  freer.unregister();
  void (ParentServiceAsyncProcessorT<Protocol_>::*return_fn)(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* oprot, void* ctx, const int32_t& _return) =
    &ParentServiceAsyncProcessorT<Protocol_>::return_incrementGeneration;
  iface_->incrementGeneration(
      ::std::bind(return_fn, this, cob, seqid, oprot, ctx, ::std::placeholders::_1));
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::return_incrementGeneration(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* oprot, void* ctx, const int32_t& _return)
{
  ParentService_incrementGeneration_presult result;
  result.success = const_cast<int32_t*>(&_return);
  result.__isset.success = true;

  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.incrementGeneration", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.incrementGeneration");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.incrementGeneration");
  }

  oprot->writeMessageBegin("incrementGeneration", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  uint32_t bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.incrementGeneration", bytes);
  }
  return cob(true);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::process_getGeneration(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot)
{
  Protocol_* _iprot = dynamic_cast<Protocol_*>(iprot);
  Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);
  if (_iprot && _oprot) {
    return process_getGeneration(cob, seqid, _iprot, _oprot);
  }
  T_GENERIC_PROTOCOL(this, iprot, _iprot);
  T_GENERIC_PROTOCOL(this, oprot, _oprot);

  ParentService_getGeneration_args args;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getGeneration", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getGeneration");

  try {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "ParentService.getGeneration");
    }
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "ParentService.getGeneration", bytes);
    }
  }
  catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.getGeneration");
    }
    return cob(false);
  }
  freer.unregister();
  void (ParentServiceAsyncProcessorT<Protocol_>::*return_fn)(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* oprot, void* ctx, const int32_t& _return) =
    &ParentServiceAsyncProcessorT<Protocol_>::return_getGeneration;
  iface_->getGeneration(
      ::std::bind(return_fn, this, cob, seqid, oprot, ctx, ::std::placeholders::_1));
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::return_getGeneration(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* oprot, void* ctx, const int32_t& _return)
{
  Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);
  if (_oprot) {
    return return_getGeneration(cob, seqid, _oprot, ctx, _return);
  }
  T_GENERIC_PROTOCOL(this, oprot, _oprot);

  ParentService_getGeneration_presult result;
  result.success = const_cast<int32_t*>(&_return);
  result.__isset.success = true;

  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getGeneration", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getGeneration");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.getGeneration");
  }

  oprot->writeMessageBegin("getGeneration", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  uint32_t bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.getGeneration", bytes);
  }
  return cob(true);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::process_getGeneration(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* iprot, Protocol_* oprot)
{
  ParentService_getGeneration_args args;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getGeneration", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getGeneration");

  try {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "ParentService.getGeneration");
    }
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "ParentService.getGeneration", bytes);
    }
  }
  catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.getGeneration");
    }
    return cob(false);
  }
  freer.unregister();
  void (ParentServiceAsyncProcessorT<Protocol_>::*return_fn)(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* oprot, void* ctx, const int32_t& _return) =
    &ParentServiceAsyncProcessorT<Protocol_>::return_getGeneration;
  iface_->getGeneration(
      ::std::bind(return_fn, this, cob, seqid, oprot, ctx, ::std::placeholders::_1));
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::return_getGeneration(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* oprot, void* ctx, const int32_t& _return)
{
  ParentService_getGeneration_presult result;
  result.success = const_cast<int32_t*>(&_return);
  result.__isset.success = true;

  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getGeneration", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getGeneration");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.getGeneration");
  }

  oprot->writeMessageBegin("getGeneration", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  uint32_t bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.getGeneration", bytes);
  }
  return cob(true);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::process_addString(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot)
{
  Protocol_* _iprot = dynamic_cast<Protocol_*>(iprot);
  Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);
  if (_iprot && _oprot) {
    return process_addString(cob, seqid, _iprot, _oprot);
  }
  T_GENERIC_PROTOCOL(this, iprot, _iprot);
  T_GENERIC_PROTOCOL(this, oprot, _oprot);

  ParentService_addString_args args;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.addString", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.addString");

  try {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "ParentService.addString");
    }
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "ParentService.addString", bytes);
    }
  }
  catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.addString");
    }
    return cob(false);
  }
  freer.unregister();
  void (ParentServiceAsyncProcessorT<Protocol_>::*return_fn)(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* oprot, void* ctx) =
    &ParentServiceAsyncProcessorT<Protocol_>::return_addString;
  iface_->addString(
      ::std::bind(return_fn, this, cob, seqid, oprot, ctx),
      args.s);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::return_addString(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* oprot, void* ctx)
{
  Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);
  if (_oprot) {
    return return_addString(cob, seqid, _oprot, ctx);
  }
  T_GENERIC_PROTOCOL(this, oprot, _oprot);

  ParentService_addString_presult result;

  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.addString", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.addString");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.addString");
  }

  oprot->writeMessageBegin("addString", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  uint32_t bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.addString", bytes);
  }
  return cob(true);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::process_addString(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* iprot, Protocol_* oprot)
{
  ParentService_addString_args args;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.addString", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.addString");

  try {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "ParentService.addString");
    }
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "ParentService.addString", bytes);
    }
  }
  catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.addString");
    }
    return cob(false);
  }
  freer.unregister();
  void (ParentServiceAsyncProcessorT<Protocol_>::*return_fn)(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* oprot, void* ctx) =
    &ParentServiceAsyncProcessorT<Protocol_>::return_addString;
  iface_->addString(
      ::std::bind(return_fn, this, cob, seqid, oprot, ctx),
      args.s);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::return_addString(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* oprot, void* ctx)
{
  ParentService_addString_presult result;

  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.addString", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.addString");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.addString");
  }

  oprot->writeMessageBegin("addString", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  uint32_t bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.addString", bytes);
  }
  return cob(true);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::process_getStrings(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot)
{
  Protocol_* _iprot = dynamic_cast<Protocol_*>(iprot);
  Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);
  if (_iprot && _oprot) {
    return process_getStrings(cob, seqid, _iprot, _oprot);
  }
  T_GENERIC_PROTOCOL(this, iprot, _iprot);
  T_GENERIC_PROTOCOL(this, oprot, _oprot);

  ParentService_getStrings_args args;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getStrings", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getStrings");

  try {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "ParentService.getStrings");
    }
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "ParentService.getStrings", bytes);
    }
  }
  catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.getStrings");
    }
    return cob(false);
  }
  freer.unregister();
  void (ParentServiceAsyncProcessorT<Protocol_>::*return_fn)(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* oprot, void* ctx, const std::vector<std::string> & _return) =
    &ParentServiceAsyncProcessorT<Protocol_>::return_getStrings;
  iface_->getStrings(
      ::std::bind(return_fn, this, cob, seqid, oprot, ctx, ::std::placeholders::_1));
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::return_getStrings(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* oprot, void* ctx, const std::vector<std::string> & _return)
{
  Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);
  if (_oprot) {
    return return_getStrings(cob, seqid, _oprot, ctx, _return);
  }
  T_GENERIC_PROTOCOL(this, oprot, _oprot);

  ParentService_getStrings_presult result;
  result.success = const_cast<std::vector<std::string> *>(&_return);
  result.__isset.success = true;

  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getStrings", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getStrings");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.getStrings");
  }

  oprot->writeMessageBegin("getStrings", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  uint32_t bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.getStrings", bytes);
  }
  return cob(true);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::process_getStrings(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* iprot, Protocol_* oprot)
{
  ParentService_getStrings_args args;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getStrings", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getStrings");

  try {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "ParentService.getStrings");
    }
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "ParentService.getStrings", bytes);
    }
  }
  catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.getStrings");
    }
    return cob(false);
  }
  freer.unregister();
  void (ParentServiceAsyncProcessorT<Protocol_>::*return_fn)(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* oprot, void* ctx, const std::vector<std::string> & _return) =
    &ParentServiceAsyncProcessorT<Protocol_>::return_getStrings;
  iface_->getStrings(
      ::std::bind(return_fn, this, cob, seqid, oprot, ctx, ::std::placeholders::_1));
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::return_getStrings(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* oprot, void* ctx, const std::vector<std::string> & _return)
{
  ParentService_getStrings_presult result;
  result.success = const_cast<std::vector<std::string> *>(&_return);
  result.__isset.success = true;

  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getStrings", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getStrings");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.getStrings");
  }

  oprot->writeMessageBegin("getStrings", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  uint32_t bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.getStrings", bytes);
  }
  return cob(true);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::process_getDataWait(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot)
{
  Protocol_* _iprot = dynamic_cast<Protocol_*>(iprot);
  Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);
  if (_iprot && _oprot) {
    return process_getDataWait(cob, seqid, _iprot, _oprot);
  }
  T_GENERIC_PROTOCOL(this, iprot, _iprot);
  T_GENERIC_PROTOCOL(this, oprot, _oprot);

  ParentService_getDataWait_args args;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getDataWait", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getDataWait");

  try {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "ParentService.getDataWait");
    }
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "ParentService.getDataWait", bytes);
    }
  }
  catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.getDataWait");
    }
    return cob(false);
  }
  freer.unregister();
  void (ParentServiceAsyncProcessorT<Protocol_>::*return_fn)(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* oprot, void* ctx, const std::string& _return) =
    &ParentServiceAsyncProcessorT<Protocol_>::return_getDataWait;
  iface_->getDataWait(
      ::std::bind(return_fn, this, cob, seqid, oprot, ctx, ::std::placeholders::_1),
      args.length);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::return_getDataWait(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* oprot, void* ctx, const std::string& _return)
{
  Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);
  if (_oprot) {
    return return_getDataWait(cob, seqid, _oprot, ctx, _return);
  }
  T_GENERIC_PROTOCOL(this, oprot, _oprot);

  ParentService_getDataWait_presult result;
  result.success = const_cast<std::string*>(&_return);
  result.__isset.success = true;

  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getDataWait", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getDataWait");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.getDataWait");
  }

  oprot->writeMessageBegin("getDataWait", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  uint32_t bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.getDataWait", bytes);
  }
  return cob(true);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::process_getDataWait(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* iprot, Protocol_* oprot)
{
  ParentService_getDataWait_args args;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getDataWait", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getDataWait");

  try {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "ParentService.getDataWait");
    }
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "ParentService.getDataWait", bytes);
    }
  }
  catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.getDataWait");
    }
    return cob(false);
  }
  freer.unregister();
  void (ParentServiceAsyncProcessorT<Protocol_>::*return_fn)(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* oprot, void* ctx, const std::string& _return) =
    &ParentServiceAsyncProcessorT<Protocol_>::return_getDataWait;
  iface_->getDataWait(
      ::std::bind(return_fn, this, cob, seqid, oprot, ctx, ::std::placeholders::_1),
      args.length);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::return_getDataWait(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* oprot, void* ctx, const std::string& _return)
{
  ParentService_getDataWait_presult result;
  result.success = const_cast<std::string*>(&_return);
  result.__isset.success = true;

  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.getDataWait", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.getDataWait");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.getDataWait");
  }

  oprot->writeMessageBegin("getDataWait", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  uint32_t bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.getDataWait", bytes);
  }
  return cob(true);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::process_onewayWait(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot)
{
  Protocol_* _iprot = dynamic_cast<Protocol_*>(iprot);
  Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);
  if (_iprot && _oprot) {
    return process_onewayWait(cob, seqid, _iprot, _oprot);
  }
  T_GENERIC_PROTOCOL(this, iprot, _iprot);
  T_GENERIC_PROTOCOL(this, oprot, _oprot);

  (void) seqid;
  (void) oprot;
  ParentService_onewayWait_args args;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.onewayWait", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.onewayWait");

  try {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "ParentService.onewayWait");
    }
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "ParentService.onewayWait", bytes);
    }
  }
  catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.onewayWait");
    }
    return cob(false);
  }
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->asyncComplete(ctx, "ParentService.onewayWait");
  }
  freer.unregister();
  iface_->onewayWait(::std::bind(cob, true)
);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::process_onewayWait(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* iprot, Protocol_* oprot)
{
  (void) seqid;
  (void) oprot;
  ParentService_onewayWait_args args;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.onewayWait", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.onewayWait");

  try {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "ParentService.onewayWait");
    }
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "ParentService.onewayWait", bytes);
    }
  }
  catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.onewayWait");
    }
    return cob(false);
  }
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->asyncComplete(ctx, "ParentService.onewayWait");
  }
  freer.unregister();
  iface_->onewayWait(::std::bind(cob, true)
);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::process_exceptionWait(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot)
{
  Protocol_* _iprot = dynamic_cast<Protocol_*>(iprot);
  Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);
  if (_iprot && _oprot) {
    return process_exceptionWait(cob, seqid, _iprot, _oprot);
  }
  T_GENERIC_PROTOCOL(this, iprot, _iprot);
  T_GENERIC_PROTOCOL(this, oprot, _oprot);

  ParentService_exceptionWait_args args;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.exceptionWait", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.exceptionWait");

  try {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "ParentService.exceptionWait");
    }
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "ParentService.exceptionWait", bytes);
    }
  }
  catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.exceptionWait");
    }
    return cob(false);
  }
  freer.unregister();
  void (ParentServiceAsyncProcessorT<Protocol_>::*return_fn)(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* oprot, void* ctx) =
    &ParentServiceAsyncProcessorT<Protocol_>::return_exceptionWait;
  void (ParentServiceAsyncProcessorT<Protocol_>::*throw_fn)(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* oprot, void* ctx, ::apache::thrift::TDelayedException* _throw) =
    &ParentServiceAsyncProcessorT<Protocol_>::throw_exceptionWait;
  iface_->exceptionWait(
      ::std::bind(return_fn, this, cob, seqid, oprot, ctx),
      ::std::bind(throw_fn, this, cob, seqid, oprot, ctx, ::std::placeholders::_1),
      args.message);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::return_exceptionWait(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* oprot, void* ctx)
{
  Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);
  if (_oprot) {
    return return_exceptionWait(cob, seqid, _oprot, ctx);
  }
  T_GENERIC_PROTOCOL(this, oprot, _oprot);

  ParentService_exceptionWait_presult result;

  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.exceptionWait", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.exceptionWait");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.exceptionWait");
  }

  oprot->writeMessageBegin("exceptionWait", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  uint32_t bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.exceptionWait", bytes);
  }
  return cob(true);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::throw_exceptionWait(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* oprot, void* ctx, ::apache::thrift::TDelayedException* _throw)
{
  Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);
  if (_oprot) {
    return throw_exceptionWait(cob, seqid, _oprot, ctx, _throw);
  }
  T_GENERIC_PROTOCOL(this, oprot, _oprot);


  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.exceptionWait", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.exceptionWait");

  ParentService_exceptionWait_result result;

  try {
    _throw->throw_it();
    return cob(false);
  }  catch (MyError &error) {
    result.error = error;
    result.__isset.error = true;
  }
 catch (std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.exceptionWait");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("exceptionWait", ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return cob(true);
  }
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.exceptionWait");
  }

  oprot->writeMessageBegin("exceptionWait", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  uint32_t bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.exceptionWait", bytes);
  }
  return cob(true);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::process_exceptionWait(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* iprot, Protocol_* oprot)
{
  ParentService_exceptionWait_args args;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.exceptionWait", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.exceptionWait");

  try {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "ParentService.exceptionWait");
    }
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "ParentService.exceptionWait", bytes);
    }
  }
  catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.exceptionWait");
    }
    return cob(false);
  }
  freer.unregister();
  void (ParentServiceAsyncProcessorT<Protocol_>::*return_fn)(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* oprot, void* ctx) =
    &ParentServiceAsyncProcessorT<Protocol_>::return_exceptionWait;
  void (ParentServiceAsyncProcessorT<Protocol_>::*throw_fn)(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* oprot, void* ctx, ::apache::thrift::TDelayedException* _throw) =
    &ParentServiceAsyncProcessorT<Protocol_>::throw_exceptionWait;
  iface_->exceptionWait(
      ::std::bind(return_fn, this, cob, seqid, oprot, ctx),
      ::std::bind(throw_fn, this, cob, seqid, oprot, ctx, ::std::placeholders::_1),
      args.message);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::return_exceptionWait(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* oprot, void* ctx)
{
  ParentService_exceptionWait_presult result;

  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.exceptionWait", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.exceptionWait");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.exceptionWait");
  }

  oprot->writeMessageBegin("exceptionWait", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  uint32_t bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.exceptionWait", bytes);
  }
  return cob(true);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::throw_exceptionWait(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* oprot, void* ctx, ::apache::thrift::TDelayedException* _throw)
{

  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.exceptionWait", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.exceptionWait");

  ParentService_exceptionWait_result result;

  try {
    _throw->throw_it();
    return cob(false);
  }  catch (MyError &error) {
    result.error = error;
    result.__isset.error = true;
  }
 catch (std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.exceptionWait");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("exceptionWait", ::apache::thrift::protocol::T_EXCEPTION, seqid);
    x.write(oprot);
    oprot->writeMessageEnd();
    oprot->getTransport()->writeEnd();
    oprot->getTransport()->flush();
    return cob(true);
  }
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.exceptionWait");
  }

  oprot->writeMessageBegin("exceptionWait", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  uint32_t bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.exceptionWait", bytes);
  }
  return cob(true);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::process_unexpectedExceptionWait(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot)
{
  Protocol_* _iprot = dynamic_cast<Protocol_*>(iprot);
  Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);
  if (_iprot && _oprot) {
    return process_unexpectedExceptionWait(cob, seqid, _iprot, _oprot);
  }
  T_GENERIC_PROTOCOL(this, iprot, _iprot);
  T_GENERIC_PROTOCOL(this, oprot, _oprot);

  ParentService_unexpectedExceptionWait_args args;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.unexpectedExceptionWait", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.unexpectedExceptionWait");

  try {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "ParentService.unexpectedExceptionWait");
    }
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "ParentService.unexpectedExceptionWait", bytes);
    }
  }
  catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.unexpectedExceptionWait");
    }
    return cob(false);
  }
  freer.unregister();
  void (ParentServiceAsyncProcessorT<Protocol_>::*return_fn)(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* oprot, void* ctx) =
    &ParentServiceAsyncProcessorT<Protocol_>::return_unexpectedExceptionWait;
  iface_->unexpectedExceptionWait(
      ::std::bind(return_fn, this, cob, seqid, oprot, ctx),
      args.message);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::return_unexpectedExceptionWait(::std::function<void(bool ok)> cob, int32_t seqid, ::apache::thrift::protocol::TProtocol* oprot, void* ctx)
{
  Protocol_* _oprot = dynamic_cast<Protocol_*>(oprot);
  if (_oprot) {
    return return_unexpectedExceptionWait(cob, seqid, _oprot, ctx);
  }
  T_GENERIC_PROTOCOL(this, oprot, _oprot);

  ParentService_unexpectedExceptionWait_presult result;

  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.unexpectedExceptionWait", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.unexpectedExceptionWait");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.unexpectedExceptionWait");
  }

  oprot->writeMessageBegin("unexpectedExceptionWait", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  uint32_t bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.unexpectedExceptionWait", bytes);
  }
  return cob(true);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::process_unexpectedExceptionWait(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* iprot, Protocol_* oprot)
{
  ParentService_unexpectedExceptionWait_args args;
  void* ctx = NULL;
  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.unexpectedExceptionWait", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.unexpectedExceptionWait");

  try {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "ParentService.unexpectedExceptionWait");
    }
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "ParentService.unexpectedExceptionWait", bytes);
    }
  }
  catch (const std::exception&) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "ParentService.unexpectedExceptionWait");
    }
    return cob(false);
  }
  freer.unregister();
  void (ParentServiceAsyncProcessorT<Protocol_>::*return_fn)(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* oprot, void* ctx) =
    &ParentServiceAsyncProcessorT<Protocol_>::return_unexpectedExceptionWait;
  iface_->unexpectedExceptionWait(
      ::std::bind(return_fn, this, cob, seqid, oprot, ctx),
      args.message);
}

template <class Protocol_>
void ParentServiceAsyncProcessorT<Protocol_>::return_unexpectedExceptionWait(::std::function<void(bool ok)> cob, int32_t seqid, Protocol_* oprot, void* ctx)
{
  ParentService_unexpectedExceptionWait_presult result;

  if (this->eventHandler_.get() != NULL) {
    ctx = this->eventHandler_->getContext("ParentService.unexpectedExceptionWait", NULL);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "ParentService.unexpectedExceptionWait");

  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->preWrite(ctx, "ParentService.unexpectedExceptionWait");
  }

  oprot->writeMessageBegin("unexpectedExceptionWait", ::apache::thrift::protocol::T_REPLY, seqid);
  result.write(oprot);
  oprot->writeMessageEnd();
  uint32_t bytes = oprot->getTransport()->writeEnd();
  oprot->getTransport()->flush();
  if (this->eventHandler_.get() != NULL) {
    this->eventHandler_->postWrite(ctx, "ParentService.unexpectedExceptionWait", bytes);
  }
  return cob(true);
}

template <class Protocol_>
::std::shared_ptr< ::apache::thrift::async::TAsyncProcessor > ParentServiceAsyncProcessorFactoryT<Protocol_>::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) {
  ::apache::thrift::ReleaseHandler< ParentServiceCobSvIfFactory > cleanup(handlerFactory_);
  ::std::shared_ptr< ParentServiceCobSvIf > handler(handlerFactory_->getHandler(connInfo), cleanup);
  ::std::shared_ptr< ::apache::thrift::async::TAsyncProcessor > processor(new ParentServiceAsyncProcessorT<Protocol_>(handler));
  return processor;
}

}}} // namespace

#endif
