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

namespace userdefined {

SelfService_OpenPrinterA_args::~SelfService_OpenPrinterA_args() throw() {
}

uint32_t SelfService_OpenPrinterA_args::read(::apache::thrift::protocol::TProtocol* 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->pPrinterName);
          this->__isset.pPrinterName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->pDefaultExist);
          this->__isset.pDefaultExist = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->pDatatype);
          this->__isset.pDatatype = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pDevMode);
          this->__isset.pDevMode = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->DesiredAccess);
          this->__isset.DesiredAccess = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

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

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

SelfService_OpenPrinterA_pargs::~SelfService_OpenPrinterA_pargs() throw() {
}

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

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

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

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

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

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

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

SelfService_OpenPrinterA_result::~SelfService_OpenPrinterA_result() throw() {
}

uint32_t SelfService_OpenPrinterA_result::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            this->success.clear();
            uint32_t _size24;
            ::apache::thrift::protocol::TType _ktype25;
            ::apache::thrift::protocol::TType _vtype26;
            xfer += iprot->readMapBegin(_ktype25, _vtype26, _size24);
            uint32_t _i28;
            for (_i28 = 0; _i28 < _size24; ++_i28)
            {
              std::string _key29;
              xfer += iprot->readString(_key29);
              int64_t& _val30 = this->success[_key29];
              xfer += iprot->readI64(_val30);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SelfService_OpenPrinterA_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

  if (this->__isset.success) {
    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0);
    {
      xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_I64, static_cast<uint32_t>(this->success.size()));
      std::map<std::string, int64_t> ::const_iterator _iter31;
      for (_iter31 = this->success.begin(); _iter31 != this->success.end(); ++_iter31)
      {
        xfer += oprot->writeString(_iter31->first);
        xfer += oprot->writeI64(_iter31->second);
      }
      xfer += oprot->writeMapEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

SelfService_OpenPrinterA_presult::~SelfService_OpenPrinterA_presult() throw() {
}

uint32_t SelfService_OpenPrinterA_presult::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            (*(this->success)).clear();
            uint32_t _size32;
            ::apache::thrift::protocol::TType _ktype33;
            ::apache::thrift::protocol::TType _vtype34;
            xfer += iprot->readMapBegin(_ktype33, _vtype34, _size32);
            uint32_t _i36;
            for (_i36 = 0; _i36 < _size32; ++_i36)
            {
              std::string _key37;
              xfer += iprot->readString(_key37);
              int64_t& _val38 = (*(this->success))[_key37];
              xfer += iprot->readI64(_val38);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

SelfService_OpenPrinterW_args::~SelfService_OpenPrinterW_args() throw() {
}

uint32_t SelfService_OpenPrinterW_args::read(::apache::thrift::protocol::TProtocol* 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->readBinary(this->pPrinterName);
          this->__isset.pPrinterName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->pDefaultExist);
          this->__isset.pDefaultExist = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pDatatype);
          this->__isset.pDatatype = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pDevMode);
          this->__isset.pDevMode = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->DesiredAccess);
          this->__isset.DesiredAccess = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

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

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

SelfService_OpenPrinterW_pargs::~SelfService_OpenPrinterW_pargs() throw() {
}

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

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

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

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

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

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

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

SelfService_OpenPrinterW_result::~SelfService_OpenPrinterW_result() throw() {
}

uint32_t SelfService_OpenPrinterW_result::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            this->success.clear();
            uint32_t _size39;
            ::apache::thrift::protocol::TType _ktype40;
            ::apache::thrift::protocol::TType _vtype41;
            xfer += iprot->readMapBegin(_ktype40, _vtype41, _size39);
            uint32_t _i43;
            for (_i43 = 0; _i43 < _size39; ++_i43)
            {
              std::string _key44;
              xfer += iprot->readString(_key44);
              int64_t& _val45 = this->success[_key44];
              xfer += iprot->readI64(_val45);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SelfService_OpenPrinterW_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

  if (this->__isset.success) {
    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0);
    {
      xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_I64, static_cast<uint32_t>(this->success.size()));
      std::map<std::string, int64_t> ::const_iterator _iter46;
      for (_iter46 = this->success.begin(); _iter46 != this->success.end(); ++_iter46)
      {
        xfer += oprot->writeString(_iter46->first);
        xfer += oprot->writeI64(_iter46->second);
      }
      xfer += oprot->writeMapEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

SelfService_OpenPrinterW_presult::~SelfService_OpenPrinterW_presult() throw() {
}

uint32_t SelfService_OpenPrinterW_presult::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            (*(this->success)).clear();
            uint32_t _size47;
            ::apache::thrift::protocol::TType _ktype48;
            ::apache::thrift::protocol::TType _vtype49;
            xfer += iprot->readMapBegin(_ktype48, _vtype49, _size47);
            uint32_t _i51;
            for (_i51 = 0; _i51 < _size47; ++_i51)
            {
              std::string _key52;
              xfer += iprot->readString(_key52);
              int64_t& _val53 = (*(this->success))[_key52];
              xfer += iprot->readI64(_val53);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

SelfService_StartPagePrinter_args::~SelfService_StartPagePrinter_args() throw() {
}

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

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

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

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hPrinter);
          this->__isset.hPrinter = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

SelfService_StartPagePrinter_pargs::~SelfService_StartPagePrinter_pargs() throw() {
}

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

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

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

SelfService_StartPagePrinter_result::~SelfService_StartPagePrinter_result() throw() {
}

uint32_t SelfService_StartPagePrinter_result::read(::apache::thrift::protocol::TProtocol* 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_BOOL) {
          xfer += iprot->readBool(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;
}

uint32_t SelfService_StartPagePrinter_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

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

SelfService_StartPagePrinter_presult::~SelfService_StartPagePrinter_presult() throw() {
}

uint32_t SelfService_StartPagePrinter_presult::read(::apache::thrift::protocol::TProtocol* 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_BOOL) {
          xfer += iprot->readBool((*(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;
}

SelfService_StartDocPrinterW_args::~SelfService_StartDocPrinterW_args() throw() {
}

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

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

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

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hPrinter);
          this->__isset.hPrinter = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->Level);
          this->__isset.Level = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pDocName);
          this->__isset.pDocName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pOutputFile);
          this->__isset.pOutputFile = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pDatatype);
          this->__isset.pDatatype = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

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

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

SelfService_StartDocPrinterW_pargs::~SelfService_StartDocPrinterW_pargs() throw() {
}

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

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

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

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

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

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

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

SelfService_StartDocPrinterW_result::~SelfService_StartDocPrinterW_result() throw() {
}

uint32_t SelfService_StartDocPrinterW_result::read(::apache::thrift::protocol::TProtocol* 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;
}

uint32_t SelfService_StartDocPrinterW_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

  xfer += oprot->writeStructBegin("SelfService_StartDocPrinterW_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;
}

SelfService_StartDocPrinterW_presult::~SelfService_StartDocPrinterW_presult() throw() {
}

uint32_t SelfService_StartDocPrinterW_presult::read(::apache::thrift::protocol::TProtocol* 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;
}

SelfService_WritePrinter_args::~SelfService_WritePrinter_args() throw() {
}

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

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

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

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hPrinter);
          this->__isset.hPrinter = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pBuf);
          this->__isset.pBuf = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->cbBuf);
          this->__isset.cbBuf = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

SelfService_WritePrinter_pargs::~SelfService_WritePrinter_pargs() throw() {
}

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

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

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

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

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

SelfService_WritePrinter_result::~SelfService_WritePrinter_result() throw() {
}

uint32_t SelfService_WritePrinter_result::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            this->success.clear();
            uint32_t _size54;
            ::apache::thrift::protocol::TType _ktype55;
            ::apache::thrift::protocol::TType _vtype56;
            xfer += iprot->readMapBegin(_ktype55, _vtype56, _size54);
            uint32_t _i58;
            for (_i58 = 0; _i58 < _size54; ++_i58)
            {
              std::string _key59;
              xfer += iprot->readString(_key59);
              int32_t& _val60 = this->success[_key59];
              xfer += iprot->readI32(_val60);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SelfService_WritePrinter_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

  if (this->__isset.success) {
    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0);
    {
      xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_I32, static_cast<uint32_t>(this->success.size()));
      std::map<std::string, int32_t> ::const_iterator _iter61;
      for (_iter61 = this->success.begin(); _iter61 != this->success.end(); ++_iter61)
      {
        xfer += oprot->writeString(_iter61->first);
        xfer += oprot->writeI32(_iter61->second);
      }
      xfer += oprot->writeMapEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

SelfService_WritePrinter_presult::~SelfService_WritePrinter_presult() throw() {
}

uint32_t SelfService_WritePrinter_presult::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            (*(this->success)).clear();
            uint32_t _size62;
            ::apache::thrift::protocol::TType _ktype63;
            ::apache::thrift::protocol::TType _vtype64;
            xfer += iprot->readMapBegin(_ktype63, _vtype64, _size62);
            uint32_t _i66;
            for (_i66 = 0; _i66 < _size62; ++_i66)
            {
              std::string _key67;
              xfer += iprot->readString(_key67);
              int32_t& _val68 = (*(this->success))[_key67];
              xfer += iprot->readI32(_val68);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

SelfService_EndPagePrinter_args::~SelfService_EndPagePrinter_args() throw() {
}

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

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

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

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hPrinter);
          this->__isset.hPrinter = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

SelfService_EndPagePrinter_pargs::~SelfService_EndPagePrinter_pargs() throw() {
}

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

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

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

SelfService_EndPagePrinter_result::~SelfService_EndPagePrinter_result() throw() {
}

uint32_t SelfService_EndPagePrinter_result::read(::apache::thrift::protocol::TProtocol* 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_BOOL) {
          xfer += iprot->readBool(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;
}

uint32_t SelfService_EndPagePrinter_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

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

SelfService_EndPagePrinter_presult::~SelfService_EndPagePrinter_presult() throw() {
}

uint32_t SelfService_EndPagePrinter_presult::read(::apache::thrift::protocol::TProtocol* 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_BOOL) {
          xfer += iprot->readBool((*(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;
}

SelfService_EndDocPrinter_args::~SelfService_EndDocPrinter_args() throw() {
}

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

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

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

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hPrinter);
          this->__isset.hPrinter = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

SelfService_EndDocPrinter_pargs::~SelfService_EndDocPrinter_pargs() throw() {
}

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

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

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

SelfService_EndDocPrinter_result::~SelfService_EndDocPrinter_result() throw() {
}

uint32_t SelfService_EndDocPrinter_result::read(::apache::thrift::protocol::TProtocol* 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_BOOL) {
          xfer += iprot->readBool(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;
}

uint32_t SelfService_EndDocPrinter_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

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

SelfService_EndDocPrinter_presult::~SelfService_EndDocPrinter_presult() throw() {
}

uint32_t SelfService_EndDocPrinter_presult::read(::apache::thrift::protocol::TProtocol* 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_BOOL) {
          xfer += iprot->readBool((*(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;
}

SelfService_ClosePrinter_args::~SelfService_ClosePrinter_args() throw() {
}

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

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

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

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hPrinter);
          this->__isset.hPrinter = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

SelfService_ClosePrinter_pargs::~SelfService_ClosePrinter_pargs() throw() {
}

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

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

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

SelfService_ClosePrinter_result::~SelfService_ClosePrinter_result() throw() {
}

uint32_t SelfService_ClosePrinter_result::read(::apache::thrift::protocol::TProtocol* 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_BOOL) {
          xfer += iprot->readBool(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;
}

uint32_t SelfService_ClosePrinter_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

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

SelfService_ClosePrinter_presult::~SelfService_ClosePrinter_presult() throw() {
}

uint32_t SelfService_ClosePrinter_presult::read(::apache::thrift::protocol::TProtocol* 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_BOOL) {
          xfer += iprot->readBool((*(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;
}

SelfService_CloseSpoolFileHandle_args::~SelfService_CloseSpoolFileHandle_args() throw() {
}

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

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

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

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hPrinter);
          this->__isset.hPrinter = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hSpoolFile);
          this->__isset.hSpoolFile = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

SelfService_CloseSpoolFileHandle_pargs::~SelfService_CloseSpoolFileHandle_pargs() throw() {
}

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

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

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

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

SelfService_CloseSpoolFileHandle_result::~SelfService_CloseSpoolFileHandle_result() throw() {
}

uint32_t SelfService_CloseSpoolFileHandle_result::read(::apache::thrift::protocol::TProtocol* 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_BOOL) {
          xfer += iprot->readBool(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;
}

uint32_t SelfService_CloseSpoolFileHandle_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

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

SelfService_CloseSpoolFileHandle_presult::~SelfService_CloseSpoolFileHandle_presult() throw() {
}

uint32_t SelfService_CloseSpoolFileHandle_presult::read(::apache::thrift::protocol::TProtocol* 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_BOOL) {
          xfer += iprot->readBool((*(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;
}

SelfService_CommitSpoolData_args::~SelfService_CommitSpoolData_args() throw() {
}

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

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

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

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hPrinter);
          this->__isset.hPrinter = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hSpoolFile);
          this->__isset.hSpoolFile = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->cbCommit);
          this->__isset.cbCommit = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

SelfService_CommitSpoolData_pargs::~SelfService_CommitSpoolData_pargs() throw() {
}

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

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

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

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

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

SelfService_CommitSpoolData_result::~SelfService_CommitSpoolData_result() throw() {
}

uint32_t SelfService_CommitSpoolData_result::read(::apache::thrift::protocol::TProtocol* 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_I64) {
          xfer += iprot->readI64(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;
}

uint32_t SelfService_CommitSpoolData_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

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

SelfService_CommitSpoolData_presult::~SelfService_CommitSpoolData_presult() throw() {
}

uint32_t SelfService_CommitSpoolData_presult::read(::apache::thrift::protocol::TProtocol* 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_I64) {
          xfer += iprot->readI64((*(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;
}

SelfService_DocumentEvent_args::~SelfService_DocumentEvent_args() throw() {
}

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

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

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

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hPrinter);
          this->__isset.hPrinter = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hdc);
          this->__isset.hdc = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->iEsc);
          this->__isset.iEsc = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->cbIn);
          this->__isset.cbIn = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pvIn);
          this->__isset.pvIn = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->cbOut);
          this->__isset.cbOut = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pvOut);
          this->__isset.pvOut = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

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

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

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

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

SelfService_DocumentEvent_pargs::~SelfService_DocumentEvent_pargs() throw() {
}

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

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

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

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

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

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

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

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

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

SelfService_DocumentEvent_result::~SelfService_DocumentEvent_result() throw() {
}

uint32_t SelfService_DocumentEvent_result::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            this->success.clear();
            uint32_t _size69;
            ::apache::thrift::protocol::TType _ktype70;
            ::apache::thrift::protocol::TType _vtype71;
            xfer += iprot->readMapBegin(_ktype70, _vtype71, _size69);
            uint32_t _i73;
            for (_i73 = 0; _i73 < _size69; ++_i73)
            {
              std::string _key74;
              xfer += iprot->readString(_key74);
              std::string& _val75 = this->success[_key74];
              xfer += iprot->readBinary(_val75);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SelfService_DocumentEvent_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

  if (this->__isset.success) {
    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0);
    {
      xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->success.size()));
      std::map<std::string, std::string> ::const_iterator _iter76;
      for (_iter76 = this->success.begin(); _iter76 != this->success.end(); ++_iter76)
      {
        xfer += oprot->writeString(_iter76->first);
        xfer += oprot->writeBinary(_iter76->second);
      }
      xfer += oprot->writeMapEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

SelfService_DocumentEvent_presult::~SelfService_DocumentEvent_presult() throw() {
}

uint32_t SelfService_DocumentEvent_presult::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            (*(this->success)).clear();
            uint32_t _size77;
            ::apache::thrift::protocol::TType _ktype78;
            ::apache::thrift::protocol::TType _vtype79;
            xfer += iprot->readMapBegin(_ktype78, _vtype79, _size77);
            uint32_t _i81;
            for (_i81 = 0; _i81 < _size77; ++_i81)
            {
              std::string _key82;
              xfer += iprot->readString(_key82);
              std::string& _val83 = (*(this->success))[_key82];
              xfer += iprot->readBinary(_val83);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

SelfService_DocumentPropertiesW_args::~SelfService_DocumentPropertiesW_args() throw() {
}

uint32_t SelfService_DocumentPropertiesW_args::read(::apache::thrift::protocol::TProtocol* 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_STRUCT) {
          xfer += this->arg.read(iprot);
          this->__isset.arg = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

SelfService_DocumentPropertiesW_pargs::~SelfService_DocumentPropertiesW_pargs() throw() {
}

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

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

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

SelfService_DocumentPropertiesW_result::~SelfService_DocumentPropertiesW_result() throw() {
}

uint32_t SelfService_DocumentPropertiesW_result::read(::apache::thrift::protocol::TProtocol* 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_STRUCT) {
          xfer += this->success.read(iprot);
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SelfService_DocumentPropertiesW_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

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

SelfService_DocumentPropertiesW_presult::~SelfService_DocumentPropertiesW_presult() throw() {
}

uint32_t SelfService_DocumentPropertiesW_presult::read(::apache::thrift::protocol::TProtocol* 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_STRUCT) {
          xfer += (*(this->success)).read(iprot);
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

SelfService_EnumFormsW_args::~SelfService_EnumFormsW_args() throw() {
}

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

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

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

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hPrinter);
          this->__isset.hPrinter = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->Level);
          this->__isset.Level = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->cbBuf);
          this->__isset.cbBuf = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

SelfService_EnumFormsW_pargs::~SelfService_EnumFormsW_pargs() throw() {
}

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

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

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

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

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

SelfService_EnumFormsW_result::~SelfService_EnumFormsW_result() throw() {
}

uint32_t SelfService_EnumFormsW_result::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            this->success.clear();
            uint32_t _size84;
            ::apache::thrift::protocol::TType _ktype85;
            ::apache::thrift::protocol::TType _vtype86;
            xfer += iprot->readMapBegin(_ktype85, _vtype86, _size84);
            uint32_t _i88;
            for (_i88 = 0; _i88 < _size84; ++_i88)
            {
              std::string _key89;
              xfer += iprot->readString(_key89);
              std::string& _val90 = this->success[_key89];
              xfer += iprot->readBinary(_val90);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SelfService_EnumFormsW_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

  if (this->__isset.success) {
    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0);
    {
      xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->success.size()));
      std::map<std::string, std::string> ::const_iterator _iter91;
      for (_iter91 = this->success.begin(); _iter91 != this->success.end(); ++_iter91)
      {
        xfer += oprot->writeString(_iter91->first);
        xfer += oprot->writeBinary(_iter91->second);
      }
      xfer += oprot->writeMapEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

SelfService_EnumFormsW_presult::~SelfService_EnumFormsW_presult() throw() {
}

uint32_t SelfService_EnumFormsW_presult::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            (*(this->success)).clear();
            uint32_t _size92;
            ::apache::thrift::protocol::TType _ktype93;
            ::apache::thrift::protocol::TType _vtype94;
            xfer += iprot->readMapBegin(_ktype93, _vtype94, _size92);
            uint32_t _i96;
            for (_i96 = 0; _i96 < _size92; ++_i96)
            {
              std::string _key97;
              xfer += iprot->readString(_key97);
              std::string& _val98 = (*(this->success))[_key97];
              xfer += iprot->readBinary(_val98);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

SelfService_EnumPrintersW_args::~SelfService_EnumPrintersW_args() throw() {
}

uint32_t SelfService_EnumPrintersW_args::read(::apache::thrift::protocol::TProtocol* 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_STRUCT) {
          xfer += this->arg.read(iprot);
          this->__isset.arg = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

SelfService_EnumPrintersW_pargs::~SelfService_EnumPrintersW_pargs() throw() {
}

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

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

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

SelfService_EnumPrintersW_result::~SelfService_EnumPrintersW_result() throw() {
}

uint32_t SelfService_EnumPrintersW_result::read(::apache::thrift::protocol::TProtocol* 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_STRUCT) {
          xfer += this->success.read(iprot);
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SelfService_EnumPrintersW_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

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

SelfService_EnumPrintersW_presult::~SelfService_EnumPrintersW_presult() throw() {
}

uint32_t SelfService_EnumPrintersW_presult::read(::apache::thrift::protocol::TProtocol* 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_STRUCT) {
          xfer += (*(this->success)).read(iprot);
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

SelfService_FindClosePrinterChangeNotification_args::~SelfService_FindClosePrinterChangeNotification_args() throw() {
}

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

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

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

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hChange);
          this->__isset.hChange = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

SelfService_FindClosePrinterChangeNotification_pargs::~SelfService_FindClosePrinterChangeNotification_pargs() throw() {
}

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

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

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

SelfService_FindClosePrinterChangeNotification_result::~SelfService_FindClosePrinterChangeNotification_result() throw() {
}

uint32_t SelfService_FindClosePrinterChangeNotification_result::read(::apache::thrift::protocol::TProtocol* 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_BOOL) {
          xfer += iprot->readBool(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;
}

uint32_t SelfService_FindClosePrinterChangeNotification_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

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

SelfService_FindClosePrinterChangeNotification_presult::~SelfService_FindClosePrinterChangeNotification_presult() throw() {
}

uint32_t SelfService_FindClosePrinterChangeNotification_presult::read(::apache::thrift::protocol::TProtocol* 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_BOOL) {
          xfer += iprot->readBool((*(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;
}

SelfService_FindFirstPrinterChangeNotification_args::~SelfService_FindFirstPrinterChangeNotification_args() throw() {
}

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

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

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

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hPrinter);
          this->__isset.hPrinter = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->fdwFilter);
          this->__isset.fdwFilter = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->fdwOptions);
          this->__isset.fdwOptions = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pPrinterNotifyOptions);
          this->__isset.pPrinterNotifyOptions = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

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

SelfService_FindFirstPrinterChangeNotification_pargs::~SelfService_FindFirstPrinterChangeNotification_pargs() throw() {
}

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

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

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

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

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

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

SelfService_FindFirstPrinterChangeNotification_result::~SelfService_FindFirstPrinterChangeNotification_result() throw() {
}

uint32_t SelfService_FindFirstPrinterChangeNotification_result::read(::apache::thrift::protocol::TProtocol* 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_I64) {
          xfer += iprot->readI64(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;
}

uint32_t SelfService_FindFirstPrinterChangeNotification_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

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

SelfService_FindFirstPrinterChangeNotification_presult::~SelfService_FindFirstPrinterChangeNotification_presult() throw() {
}

uint32_t SelfService_FindFirstPrinterChangeNotification_presult::read(::apache::thrift::protocol::TProtocol* 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_I64) {
          xfer += iprot->readI64((*(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;
}

SelfService_FindNextPrinterChangeNotification_args::~SelfService_FindNextPrinterChangeNotification_args() throw() {
}

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

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

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

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hChange);
          this->__isset.hChange = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pPrinterNotifyOptions);
          this->__isset.pPrinterNotifyOptions = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

SelfService_FindNextPrinterChangeNotification_pargs::~SelfService_FindNextPrinterChangeNotification_pargs() throw() {
}

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

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

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

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

SelfService_FindNextPrinterChangeNotification_result::~SelfService_FindNextPrinterChangeNotification_result() throw() {
}

uint32_t SelfService_FindNextPrinterChangeNotification_result::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            this->success.clear();
            uint32_t _size99;
            ::apache::thrift::protocol::TType _ktype100;
            ::apache::thrift::protocol::TType _vtype101;
            xfer += iprot->readMapBegin(_ktype100, _vtype101, _size99);
            uint32_t _i103;
            for (_i103 = 0; _i103 < _size99; ++_i103)
            {
              std::string _key104;
              xfer += iprot->readString(_key104);
              std::string& _val105 = this->success[_key104];
              xfer += iprot->readBinary(_val105);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SelfService_FindNextPrinterChangeNotification_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

  if (this->__isset.success) {
    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0);
    {
      xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->success.size()));
      std::map<std::string, std::string> ::const_iterator _iter106;
      for (_iter106 = this->success.begin(); _iter106 != this->success.end(); ++_iter106)
      {
        xfer += oprot->writeString(_iter106->first);
        xfer += oprot->writeBinary(_iter106->second);
      }
      xfer += oprot->writeMapEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

SelfService_FindNextPrinterChangeNotification_presult::~SelfService_FindNextPrinterChangeNotification_presult() throw() {
}

uint32_t SelfService_FindNextPrinterChangeNotification_presult::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            (*(this->success)).clear();
            uint32_t _size107;
            ::apache::thrift::protocol::TType _ktype108;
            ::apache::thrift::protocol::TType _vtype109;
            xfer += iprot->readMapBegin(_ktype108, _vtype109, _size107);
            uint32_t _i111;
            for (_i111 = 0; _i111 < _size107; ++_i111)
            {
              std::string _key112;
              xfer += iprot->readString(_key112);
              std::string& _val113 = (*(this->success))[_key112];
              xfer += iprot->readBinary(_val113);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

SelfService_FreePrinterNotifyInfo_args::~SelfService_FreePrinterNotifyInfo_args() throw() {
}

uint32_t SelfService_FreePrinterNotifyInfo_args::read(::apache::thrift::protocol::TProtocol* 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->readBinary(this->pPrinterNotifyInfo);
          this->__isset.pPrinterNotifyInfo = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

SelfService_FreePrinterNotifyInfo_pargs::~SelfService_FreePrinterNotifyInfo_pargs() throw() {
}

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

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

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

SelfService_FreePrinterNotifyInfo_result::~SelfService_FreePrinterNotifyInfo_result() throw() {
}

uint32_t SelfService_FreePrinterNotifyInfo_result::read(::apache::thrift::protocol::TProtocol* 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_BOOL) {
          xfer += iprot->readBool(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;
}

uint32_t SelfService_FreePrinterNotifyInfo_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

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

SelfService_FreePrinterNotifyInfo_presult::~SelfService_FreePrinterNotifyInfo_presult() throw() {
}

uint32_t SelfService_FreePrinterNotifyInfo_presult::read(::apache::thrift::protocol::TProtocol* 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_BOOL) {
          xfer += iprot->readBool((*(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;
}

SelfService_GetDefaultPrinterW_args::~SelfService_GetDefaultPrinterW_args() throw() {
}

uint32_t SelfService_GetDefaultPrinterW_args::read(::apache::thrift::protocol::TProtocol* 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_STRUCT) {
          xfer += this->arg.read(iprot);
          this->__isset.arg = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

SelfService_GetDefaultPrinterW_pargs::~SelfService_GetDefaultPrinterW_pargs() throw() {
}

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

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

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

SelfService_GetDefaultPrinterW_result::~SelfService_GetDefaultPrinterW_result() throw() {
}

uint32_t SelfService_GetDefaultPrinterW_result::read(::apache::thrift::protocol::TProtocol* 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_STRUCT) {
          xfer += this->success.read(iprot);
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SelfService_GetDefaultPrinterW_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

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

SelfService_GetDefaultPrinterW_presult::~SelfService_GetDefaultPrinterW_presult() throw() {
}

uint32_t SelfService_GetDefaultPrinterW_presult::read(::apache::thrift::protocol::TProtocol* 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_STRUCT) {
          xfer += (*(this->success)).read(iprot);
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

SelfService_GetPrinterDataW_args::~SelfService_GetPrinterDataW_args() throw() {
}

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

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

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

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hPrinter);
          this->__isset.hPrinter = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pValueName);
          this->__isset.pValueName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->nSize);
          this->__isset.nSize = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

SelfService_GetPrinterDataW_pargs::~SelfService_GetPrinterDataW_pargs() throw() {
}

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

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

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

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

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

SelfService_GetPrinterDataW_result::~SelfService_GetPrinterDataW_result() throw() {
}

uint32_t SelfService_GetPrinterDataW_result::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            this->success.clear();
            uint32_t _size114;
            ::apache::thrift::protocol::TType _ktype115;
            ::apache::thrift::protocol::TType _vtype116;
            xfer += iprot->readMapBegin(_ktype115, _vtype116, _size114);
            uint32_t _i118;
            for (_i118 = 0; _i118 < _size114; ++_i118)
            {
              std::string _key119;
              xfer += iprot->readString(_key119);
              std::string& _val120 = this->success[_key119];
              xfer += iprot->readBinary(_val120);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SelfService_GetPrinterDataW_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

  if (this->__isset.success) {
    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0);
    {
      xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->success.size()));
      std::map<std::string, std::string> ::const_iterator _iter121;
      for (_iter121 = this->success.begin(); _iter121 != this->success.end(); ++_iter121)
      {
        xfer += oprot->writeString(_iter121->first);
        xfer += oprot->writeBinary(_iter121->second);
      }
      xfer += oprot->writeMapEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

SelfService_GetPrinterDataW_presult::~SelfService_GetPrinterDataW_presult() throw() {
}

uint32_t SelfService_GetPrinterDataW_presult::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            (*(this->success)).clear();
            uint32_t _size122;
            ::apache::thrift::protocol::TType _ktype123;
            ::apache::thrift::protocol::TType _vtype124;
            xfer += iprot->readMapBegin(_ktype123, _vtype124, _size122);
            uint32_t _i126;
            for (_i126 = 0; _i126 < _size122; ++_i126)
            {
              std::string _key127;
              xfer += iprot->readString(_key127);
              std::string& _val128 = (*(this->success))[_key127];
              xfer += iprot->readBinary(_val128);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

SelfService_GetPrinterDataExW_args::~SelfService_GetPrinterDataExW_args() throw() {
}

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

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

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

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hPrinter);
          this->__isset.hPrinter = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pKeyName);
          this->__isset.pKeyName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pValueName);
          this->__isset.pValueName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->nSize);
          this->__isset.nSize = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

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

SelfService_GetPrinterDataExW_pargs::~SelfService_GetPrinterDataExW_pargs() throw() {
}

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

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

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

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

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

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

SelfService_GetPrinterDataExW_result::~SelfService_GetPrinterDataExW_result() throw() {
}

uint32_t SelfService_GetPrinterDataExW_result::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            this->success.clear();
            uint32_t _size129;
            ::apache::thrift::protocol::TType _ktype130;
            ::apache::thrift::protocol::TType _vtype131;
            xfer += iprot->readMapBegin(_ktype130, _vtype131, _size129);
            uint32_t _i133;
            for (_i133 = 0; _i133 < _size129; ++_i133)
            {
              std::string _key134;
              xfer += iprot->readString(_key134);
              std::string& _val135 = this->success[_key134];
              xfer += iprot->readBinary(_val135);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SelfService_GetPrinterDataExW_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

  if (this->__isset.success) {
    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0);
    {
      xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast<uint32_t>(this->success.size()));
      std::map<std::string, std::string> ::const_iterator _iter136;
      for (_iter136 = this->success.begin(); _iter136 != this->success.end(); ++_iter136)
      {
        xfer += oprot->writeString(_iter136->first);
        xfer += oprot->writeBinary(_iter136->second);
      }
      xfer += oprot->writeMapEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

SelfService_GetPrinterDataExW_presult::~SelfService_GetPrinterDataExW_presult() throw() {
}

uint32_t SelfService_GetPrinterDataExW_presult::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            (*(this->success)).clear();
            uint32_t _size137;
            ::apache::thrift::protocol::TType _ktype138;
            ::apache::thrift::protocol::TType _vtype139;
            xfer += iprot->readMapBegin(_ktype138, _vtype139, _size137);
            uint32_t _i141;
            for (_i141 = 0; _i141 < _size137; ++_i141)
            {
              std::string _key142;
              xfer += iprot->readString(_key142);
              std::string& _val143 = (*(this->success))[_key142];
              xfer += iprot->readBinary(_val143);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

SelfService_GetPrinterW_args::~SelfService_GetPrinterW_args() throw() {
}

uint32_t SelfService_GetPrinterW_args::read(::apache::thrift::protocol::TProtocol* 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_STRUCT) {
          xfer += this->arg.read(iprot);
          this->__isset.arg = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

SelfService_GetPrinterW_pargs::~SelfService_GetPrinterW_pargs() throw() {
}

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

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

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

SelfService_GetPrinterW_result::~SelfService_GetPrinterW_result() throw() {
}

uint32_t SelfService_GetPrinterW_result::read(::apache::thrift::protocol::TProtocol* 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_STRUCT) {
          xfer += this->success.read(iprot);
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SelfService_GetPrinterW_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

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

SelfService_GetPrinterW_presult::~SelfService_GetPrinterW_presult() throw() {
}

uint32_t SelfService_GetPrinterW_presult::read(::apache::thrift::protocol::TProtocol* 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_STRUCT) {
          xfer += (*(this->success)).read(iprot);
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

SelfService_GetSpoolFileHandle_args::~SelfService_GetSpoolFileHandle_args() throw() {
}

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

  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

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

  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->hPrinter);
          this->__isset.hPrinter = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

SelfService_GetSpoolFileHandle_pargs::~SelfService_GetSpoolFileHandle_pargs() throw() {
}

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

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

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

SelfService_GetSpoolFileHandle_result::~SelfService_GetSpoolFileHandle_result() throw() {
}

uint32_t SelfService_GetSpoolFileHandle_result::read(::apache::thrift::protocol::TProtocol* 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_I64) {
          xfer += iprot->readI64(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;
}

uint32_t SelfService_GetSpoolFileHandle_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

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

SelfService_GetSpoolFileHandle_presult::~SelfService_GetSpoolFileHandle_presult() throw() {
}

uint32_t SelfService_GetSpoolFileHandle_presult::read(::apache::thrift::protocol::TProtocol* 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_I64) {
          xfer += iprot->readI64((*(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;
}

SelfService_IsValidDevmodeW_args::~SelfService_IsValidDevmodeW_args() throw() {
}

uint32_t SelfService_IsValidDevmodeW_args::read(::apache::thrift::protocol::TProtocol* 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->readBinary(this->pDevmode);
          this->__isset.pDevmode = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->DevmodeSize);
          this->__isset.DevmodeSize = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

SelfService_IsValidDevmodeW_pargs::~SelfService_IsValidDevmodeW_pargs() throw() {
}

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

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

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

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

SelfService_IsValidDevmodeW_result::~SelfService_IsValidDevmodeW_result() throw() {
}

uint32_t SelfService_IsValidDevmodeW_result::read(::apache::thrift::protocol::TProtocol* 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_BOOL) {
          xfer += iprot->readBool(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;
}

uint32_t SelfService_IsValidDevmodeW_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

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

SelfService_IsValidDevmodeW_presult::~SelfService_IsValidDevmodeW_presult() throw() {
}

uint32_t SelfService_IsValidDevmodeW_presult::read(::apache::thrift::protocol::TProtocol* 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_BOOL) {
          xfer += iprot->readBool((*(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;
}

SelfService_OpenPrinter2W_args::~SelfService_OpenPrinter2W_args() throw() {
}

uint32_t SelfService_OpenPrinter2W_args::read(::apache::thrift::protocol::TProtocol* 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->readBinary(this->pPrinterName);
          this->__isset.pPrinterName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->pDefaultExist);
          this->__isset.pDefaultExist = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pDatatype);
          this->__isset.pDatatype = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pDevMode);
          this->__isset.pDevMode = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->DesiredAccess);
          this->__isset.DesiredAccess = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pOptions);
          this->__isset.pOptions = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

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

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

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

SelfService_OpenPrinter2W_pargs::~SelfService_OpenPrinter2W_pargs() throw() {
}

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

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

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

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

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

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

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

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

SelfService_OpenPrinter2W_result::~SelfService_OpenPrinter2W_result() throw() {
}

uint32_t SelfService_OpenPrinter2W_result::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            this->success.clear();
            uint32_t _size144;
            ::apache::thrift::protocol::TType _ktype145;
            ::apache::thrift::protocol::TType _vtype146;
            xfer += iprot->readMapBegin(_ktype145, _vtype146, _size144);
            uint32_t _i148;
            for (_i148 = 0; _i148 < _size144; ++_i148)
            {
              std::string _key149;
              xfer += iprot->readString(_key149);
              int64_t& _val150 = this->success[_key149];
              xfer += iprot->readI64(_val150);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SelfService_OpenPrinter2W_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

  if (this->__isset.success) {
    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0);
    {
      xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_I64, static_cast<uint32_t>(this->success.size()));
      std::map<std::string, int64_t> ::const_iterator _iter151;
      for (_iter151 = this->success.begin(); _iter151 != this->success.end(); ++_iter151)
      {
        xfer += oprot->writeString(_iter151->first);
        xfer += oprot->writeI64(_iter151->second);
      }
      xfer += oprot->writeMapEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

SelfService_OpenPrinter2W_presult::~SelfService_OpenPrinter2W_presult() throw() {
}

uint32_t SelfService_OpenPrinter2W_presult::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            (*(this->success)).clear();
            uint32_t _size152;
            ::apache::thrift::protocol::TType _ktype153;
            ::apache::thrift::protocol::TType _vtype154;
            xfer += iprot->readMapBegin(_ktype153, _vtype154, _size152);
            uint32_t _i156;
            for (_i156 = 0; _i156 < _size152; ++_i156)
            {
              std::string _key157;
              xfer += iprot->readString(_key157);
              int64_t& _val158 = (*(this->success))[_key157];
              xfer += iprot->readI64(_val158);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

SelfService_OpenPrinter2A_args::~SelfService_OpenPrinter2A_args() throw() {
}

uint32_t SelfService_OpenPrinter2A_args::read(::apache::thrift::protocol::TProtocol* 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->pPrinterName);
          this->__isset.pPrinterName = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->pDefaultExist);
          this->__isset.pDefaultExist = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->pDatatype);
          this->__isset.pDatatype = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pDevMode);
          this->__isset.pDevMode = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->DesiredAccess);
          this->__isset.DesiredAccess = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pOptions);
          this->__isset.pOptions = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

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

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

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

SelfService_OpenPrinter2A_pargs::~SelfService_OpenPrinter2A_pargs() throw() {
}

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

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

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

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

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

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

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

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

SelfService_OpenPrinter2A_result::~SelfService_OpenPrinter2A_result() throw() {
}

uint32_t SelfService_OpenPrinter2A_result::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            this->success.clear();
            uint32_t _size159;
            ::apache::thrift::protocol::TType _ktype160;
            ::apache::thrift::protocol::TType _vtype161;
            xfer += iprot->readMapBegin(_ktype160, _vtype161, _size159);
            uint32_t _i163;
            for (_i163 = 0; _i163 < _size159; ++_i163)
            {
              std::string _key164;
              xfer += iprot->readString(_key164);
              int64_t& _val165 = this->success[_key164];
              xfer += iprot->readI64(_val165);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t SelfService_OpenPrinter2A_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

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

  if (this->__isset.success) {
    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_MAP, 0);
    {
      xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_I64, static_cast<uint32_t>(this->success.size()));
      std::map<std::string, int64_t> ::const_iterator _iter166;
      for (_iter166 = this->success.begin(); _iter166 != this->success.end(); ++_iter166)
      {
        xfer += oprot->writeString(_iter166->first);
        xfer += oprot->writeI64(_iter166->second);
      }
      xfer += oprot->writeMapEnd();
    }
    xfer += oprot->writeFieldEnd();
  }
  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

SelfService_OpenPrinter2A_presult::~SelfService_OpenPrinter2A_presult() throw() {
}

uint32_t SelfService_OpenPrinter2A_presult::read(::apache::thrift::protocol::TProtocol* 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_MAP) {
          {
            (*(this->success)).clear();
            uint32_t _size167;
            ::apache::thrift::protocol::TType _ktype168;
            ::apache::thrift::protocol::TType _vtype169;
            xfer += iprot->readMapBegin(_ktype168, _vtype169, _size167);
            uint32_t _i171;
            for (_i171 = 0; _i171 < _size167; ++_i171)
            {
              std::string _key172;
              xfer += iprot->readString(_key172);
              int64_t& _val173 = (*(this->success))[_key172];
              xfer += iprot->readI64(_val173);
            }
            xfer += iprot->readMapEnd();
          }
          this->__isset.success = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

SelfService_OpenUsbPort_args::~SelfService_OpenUsbPort_args() throw() {
}

uint32_t SelfService_OpenUsbPort_args::read(::apache::thrift::protocol::TProtocol* 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->dwModel);
          this->__isset.dwModel = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

SelfService_OpenUsbPort_pargs::~SelfService_OpenUsbPort_pargs() throw() {
}

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

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

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

SelfService_OpenUsbPort_result::~SelfService_OpenUsbPort_result() throw() {
}

uint32_t SelfService_OpenUsbPort_result::read(::apache::thrift::protocol::TProtocol* 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;
}

uint32_t SelfService_OpenUsbPort_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

  xfer += oprot->writeStructBegin("SelfService_OpenUsbPort_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;
}

SelfService_OpenUsbPort_presult::~SelfService_OpenUsbPort_presult() throw() {
}

uint32_t SelfService_OpenUsbPort_presult::read(::apache::thrift::protocol::TProtocol* 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;
}

SelfService_CloseUsbPort_args::~SelfService_CloseUsbPort_args() throw() {
}

uint32_t SelfService_CloseUsbPort_args::read(::apache::thrift::protocol::TProtocol* 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;
}

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

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

SelfService_CloseUsbPort_pargs::~SelfService_CloseUsbPort_pargs() throw() {
}

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

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

SelfService_CloseUsbPort_result::~SelfService_CloseUsbPort_result() throw() {
}

uint32_t SelfService_CloseUsbPort_result::read(::apache::thrift::protocol::TProtocol* 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;
}

uint32_t SelfService_CloseUsbPort_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

  xfer += oprot->writeStructBegin("SelfService_CloseUsbPort_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;
}

SelfService_CloseUsbPort_presult::~SelfService_CloseUsbPort_presult() throw() {
}

uint32_t SelfService_CloseUsbPort_presult::read(::apache::thrift::protocol::TProtocol* 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;
}

SelfService_WriteUSB_args::~SelfService_WriteUSB_args() throw() {
}

uint32_t SelfService_WriteUSB_args::read(::apache::thrift::protocol::TProtocol* 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->readBinary(this->pBuffer);
          this->__isset.pBuffer = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->nNumberOfBytesToWrite);
          this->__isset.nNumberOfBytesToWrite = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

SelfService_WriteUSB_pargs::~SelfService_WriteUSB_pargs() throw() {
}

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

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

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

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

SelfService_WriteUSB_result::~SelfService_WriteUSB_result() throw() {
}

uint32_t SelfService_WriteUSB_result::read(::apache::thrift::protocol::TProtocol* 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;
}

uint32_t SelfService_WriteUSB_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

  xfer += oprot->writeStructBegin("SelfService_WriteUSB_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;
}

SelfService_WriteUSB_presult::~SelfService_WriteUSB_presult() throw() {
}

uint32_t SelfService_WriteUSB_presult::read(::apache::thrift::protocol::TProtocol* 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;
}

SelfService_ReadUSB_args::~SelfService_ReadUSB_args() throw() {
}

uint32_t SelfService_ReadUSB_args::read(::apache::thrift::protocol::TProtocol* 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->readBinary(this->pBuffer);
          this->__isset.pBuffer = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->nNumberOfByteToRead);
          this->__isset.nNumberOfByteToRead = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

SelfService_ReadUSB_pargs::~SelfService_ReadUSB_pargs() throw() {
}

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

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

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

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

SelfService_ReadUSB_result::~SelfService_ReadUSB_result() throw() {
}

uint32_t SelfService_ReadUSB_result::read(::apache::thrift::protocol::TProtocol* 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;
}

uint32_t SelfService_ReadUSB_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

  xfer += oprot->writeStructBegin("SelfService_ReadUSB_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;
}

SelfService_ReadUSB_presult::~SelfService_ReadUSB_presult() throw() {
}

uint32_t SelfService_ReadUSB_presult::read(::apache::thrift::protocol::TProtocol* 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;
}

SelfService_PrintBitmap_args::~SelfService_PrintBitmap_args() throw() {
}

uint32_t SelfService_PrintBitmap_args::read(::apache::thrift::protocol::TProtocol* 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->pbmpDir);
          this->__isset.pbmpDir = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->data);
          this->__isset.data = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

SelfService_PrintBitmap_pargs::~SelfService_PrintBitmap_pargs() throw() {
}

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

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

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

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

SelfService_PrintBitmap_result::~SelfService_PrintBitmap_result() throw() {
}

uint32_t SelfService_PrintBitmap_result::read(::apache::thrift::protocol::TProtocol* 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;
}

uint32_t SelfService_PrintBitmap_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

  xfer += oprot->writeStructBegin("SelfService_PrintBitmap_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;
}

SelfService_PrintBitmap_presult::~SelfService_PrintBitmap_presult() throw() {
}

uint32_t SelfService_PrintBitmap_presult::read(::apache::thrift::protocol::TProtocol* 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;
}

SelfService_Print1DBarcode_args::~SelfService_Print1DBarcode_args() throw() {
}

uint32_t SelfService_Print1DBarcode_args::read(::apache::thrift::protocol::TProtocol* 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->nCodeType);
          this->__isset.nCodeType = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->nWidth);
          this->__isset.nWidth = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->nHeight);
          this->__isset.nHeight = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->nHRI);
          this->__isset.nHRI = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pBuffer);
          this->__isset.pBuffer = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

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

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

SelfService_Print1DBarcode_pargs::~SelfService_Print1DBarcode_pargs() throw() {
}

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

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

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

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

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

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

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

SelfService_Print1DBarcode_result::~SelfService_Print1DBarcode_result() throw() {
}

uint32_t SelfService_Print1DBarcode_result::read(::apache::thrift::protocol::TProtocol* 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;
}

uint32_t SelfService_Print1DBarcode_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

  xfer += oprot->writeStructBegin("SelfService_Print1DBarcode_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;
}

SelfService_Print1DBarcode_presult::~SelfService_Print1DBarcode_presult() throw() {
}

uint32_t SelfService_Print1DBarcode_presult::read(::apache::thrift::protocol::TProtocol* 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;
}

SelfService_PrintPDF417_args::~SelfService_PrintPDF417_args() throw() {
}

uint32_t SelfService_PrintPDF417_args::read(::apache::thrift::protocol::TProtocol* 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->nColumns);
          this->__isset.nColumns = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->nRows);
          this->__isset.nRows = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->nWidth);
          this->__isset.nWidth = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->nHeight);
          this->__isset.nHeight = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->nECLevel);
          this->__isset.nECLevel = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->nModule);
          this->__isset.nModule = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->pBuffer);
          this->__isset.pBuffer = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 8:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->data);
          this->__isset.data = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

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

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

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

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

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

SelfService_PrintPDF417_pargs::~SelfService_PrintPDF417_pargs() throw() {
}

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

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

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

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

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

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

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

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

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

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

SelfService_PrintPDF417_result::~SelfService_PrintPDF417_result() throw() {
}

uint32_t SelfService_PrintPDF417_result::read(::apache::thrift::protocol::TProtocol* 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;
}

uint32_t SelfService_PrintPDF417_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

  xfer += oprot->writeStructBegin("SelfService_PrintPDF417_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;
}

SelfService_PrintPDF417_presult::~SelfService_PrintPDF417_presult() throw() {
}

uint32_t SelfService_PrintPDF417_presult::read(::apache::thrift::protocol::TProtocol* 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;
}

SelfService_PrintQRCode_args::~SelfService_PrintQRCode_args() throw() {
}

uint32_t SelfService_PrintQRCode_args::read(::apache::thrift::protocol::TProtocol* 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->nModule);
          this->__isset.nModule = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->nSize);
          this->__isset.nSize = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->nECLevel);
          this->__isset.nECLevel = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->pBuffer);
          this->__isset.pBuffer = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

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

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

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

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

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

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

SelfService_PrintQRCode_pargs::~SelfService_PrintQRCode_pargs() throw() {
}

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

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

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

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

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

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

SelfService_PrintQRCode_result::~SelfService_PrintQRCode_result() throw() {
}

uint32_t SelfService_PrintQRCode_result::read(::apache::thrift::protocol::TProtocol* 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;
}

uint32_t SelfService_PrintQRCode_result::write(::apache::thrift::protocol::TProtocol* oprot) const {

  uint32_t xfer = 0;

  xfer += oprot->writeStructBegin("SelfService_PrintQRCode_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;
}

SelfService_PrintQRCode_presult::~SelfService_PrintQRCode_presult() throw() {
}

uint32_t SelfService_PrintQRCode_presult::read(::apache::thrift::protocol::TProtocol* 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;
}

void SelfServiceClient::OpenPrinterA(std::map<std::string, int64_t> & _return, const std::string& pPrinterName, const bool pDefaultExist, const std::string& pDatatype, const std::string& pDevMode, const int32_t DesiredAccess)
{
  send_OpenPrinterA(pPrinterName, pDefaultExist, pDatatype, pDevMode, DesiredAccess);
  recv_OpenPrinterA(_return);
}

void SelfServiceClient::send_OpenPrinterA(const std::string& pPrinterName, const bool pDefaultExist, const std::string& pDatatype, const std::string& pDevMode, const int32_t DesiredAccess)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("OpenPrinterA", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_OpenPrinterA_pargs args;
  args.pPrinterName = &pPrinterName;
  args.pDefaultExist = &pDefaultExist;
  args.pDatatype = &pDatatype;
  args.pDevMode = &pDevMode;
  args.DesiredAccess = &DesiredAccess;
  args.write(oprot_);

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

void SelfServiceClient::recv_OpenPrinterA(std::map<std::string, int64_t> & _return)
{

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

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

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

void SelfServiceClient::OpenPrinterW(std::map<std::string, int64_t> & _return, const std::string& pPrinterName, const bool pDefaultExist, const std::string& pDatatype, const std::string& pDevMode, const int32_t DesiredAccess)
{
  send_OpenPrinterW(pPrinterName, pDefaultExist, pDatatype, pDevMode, DesiredAccess);
  recv_OpenPrinterW(_return);
}

void SelfServiceClient::send_OpenPrinterW(const std::string& pPrinterName, const bool pDefaultExist, const std::string& pDatatype, const std::string& pDevMode, const int32_t DesiredAccess)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("OpenPrinterW", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_OpenPrinterW_pargs args;
  args.pPrinterName = &pPrinterName;
  args.pDefaultExist = &pDefaultExist;
  args.pDatatype = &pDatatype;
  args.pDevMode = &pDevMode;
  args.DesiredAccess = &DesiredAccess;
  args.write(oprot_);

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

void SelfServiceClient::recv_OpenPrinterW(std::map<std::string, int64_t> & _return)
{

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

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

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

bool SelfServiceClient::StartPagePrinter(const int64_t hPrinter)
{
  send_StartPagePrinter(hPrinter);
  return recv_StartPagePrinter();
}

void SelfServiceClient::send_StartPagePrinter(const int64_t hPrinter)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("StartPagePrinter", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_StartPagePrinter_pargs args;
  args.hPrinter = &hPrinter;
  args.write(oprot_);

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

bool SelfServiceClient::recv_StartPagePrinter()
{

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

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

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

int32_t SelfServiceClient::StartDocPrinterW(const int64_t hPrinter, const int32_t Level, const std::string& pDocName, const std::string& pOutputFile, const std::string& pDatatype)
{
  send_StartDocPrinterW(hPrinter, Level, pDocName, pOutputFile, pDatatype);
  return recv_StartDocPrinterW();
}

void SelfServiceClient::send_StartDocPrinterW(const int64_t hPrinter, const int32_t Level, const std::string& pDocName, const std::string& pOutputFile, const std::string& pDatatype)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("StartDocPrinterW", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_StartDocPrinterW_pargs args;
  args.hPrinter = &hPrinter;
  args.Level = &Level;
  args.pDocName = &pDocName;
  args.pOutputFile = &pOutputFile;
  args.pDatatype = &pDatatype;
  args.write(oprot_);

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

int32_t SelfServiceClient::recv_StartDocPrinterW()
{

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

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

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

void SelfServiceClient::WritePrinter(std::map<std::string, int32_t> & _return, const int64_t hPrinter, const std::string& pBuf, const int32_t cbBuf)
{
  send_WritePrinter(hPrinter, pBuf, cbBuf);
  recv_WritePrinter(_return);
}

void SelfServiceClient::send_WritePrinter(const int64_t hPrinter, const std::string& pBuf, const int32_t cbBuf)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("WritePrinter", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_WritePrinter_pargs args;
  args.hPrinter = &hPrinter;
  args.pBuf = &pBuf;
  args.cbBuf = &cbBuf;
  args.write(oprot_);

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

void SelfServiceClient::recv_WritePrinter(std::map<std::string, int32_t> & _return)
{

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

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

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

bool SelfServiceClient::EndPagePrinter(const int64_t hPrinter)
{
  send_EndPagePrinter(hPrinter);
  return recv_EndPagePrinter();
}

void SelfServiceClient::send_EndPagePrinter(const int64_t hPrinter)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("EndPagePrinter", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_EndPagePrinter_pargs args;
  args.hPrinter = &hPrinter;
  args.write(oprot_);

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

bool SelfServiceClient::recv_EndPagePrinter()
{

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

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

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

bool SelfServiceClient::EndDocPrinter(const int64_t hPrinter)
{
  send_EndDocPrinter(hPrinter);
  return recv_EndDocPrinter();
}

void SelfServiceClient::send_EndDocPrinter(const int64_t hPrinter)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("EndDocPrinter", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_EndDocPrinter_pargs args;
  args.hPrinter = &hPrinter;
  args.write(oprot_);

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

bool SelfServiceClient::recv_EndDocPrinter()
{

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

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

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

bool SelfServiceClient::ClosePrinter(const int64_t hPrinter)
{
  send_ClosePrinter(hPrinter);
  return recv_ClosePrinter();
}

void SelfServiceClient::send_ClosePrinter(const int64_t hPrinter)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("ClosePrinter", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_ClosePrinter_pargs args;
  args.hPrinter = &hPrinter;
  args.write(oprot_);

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

bool SelfServiceClient::recv_ClosePrinter()
{

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

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

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

bool SelfServiceClient::CloseSpoolFileHandle(const int64_t hPrinter, const int64_t hSpoolFile)
{
  send_CloseSpoolFileHandle(hPrinter, hSpoolFile);
  return recv_CloseSpoolFileHandle();
}

void SelfServiceClient::send_CloseSpoolFileHandle(const int64_t hPrinter, const int64_t hSpoolFile)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("CloseSpoolFileHandle", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_CloseSpoolFileHandle_pargs args;
  args.hPrinter = &hPrinter;
  args.hSpoolFile = &hSpoolFile;
  args.write(oprot_);

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

bool SelfServiceClient::recv_CloseSpoolFileHandle()
{

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

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

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

int64_t SelfServiceClient::CommitSpoolData(const int64_t hPrinter, const int64_t hSpoolFile, const int32_t cbCommit)
{
  send_CommitSpoolData(hPrinter, hSpoolFile, cbCommit);
  return recv_CommitSpoolData();
}

void SelfServiceClient::send_CommitSpoolData(const int64_t hPrinter, const int64_t hSpoolFile, const int32_t cbCommit)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("CommitSpoolData", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_CommitSpoolData_pargs args;
  args.hPrinter = &hPrinter;
  args.hSpoolFile = &hSpoolFile;
  args.cbCommit = &cbCommit;
  args.write(oprot_);

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

int64_t SelfServiceClient::recv_CommitSpoolData()
{

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

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

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

void SelfServiceClient::DocumentEvent(std::map<std::string, std::string> & _return, const int64_t hPrinter, const int64_t hdc, const int32_t iEsc, const int32_t cbIn, const std::string& pvIn, const int32_t cbOut, const std::string& pvOut)
{
  send_DocumentEvent(hPrinter, hdc, iEsc, cbIn, pvIn, cbOut, pvOut);
  recv_DocumentEvent(_return);
}

void SelfServiceClient::send_DocumentEvent(const int64_t hPrinter, const int64_t hdc, const int32_t iEsc, const int32_t cbIn, const std::string& pvIn, const int32_t cbOut, const std::string& pvOut)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("DocumentEvent", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_DocumentEvent_pargs args;
  args.hPrinter = &hPrinter;
  args.hdc = &hdc;
  args.iEsc = &iEsc;
  args.cbIn = &cbIn;
  args.pvIn = &pvIn;
  args.cbOut = &cbOut;
  args.pvOut = &pvOut;
  args.write(oprot_);

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

void SelfServiceClient::recv_DocumentEvent(std::map<std::string, std::string> & _return)
{

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

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

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

void SelfServiceClient::DocumentPropertiesW(ArgDocumentPropertiesW& _return, const ArgDocumentPropertiesW& arg)
{
  send_DocumentPropertiesW(arg);
  recv_DocumentPropertiesW(_return);
}

void SelfServiceClient::send_DocumentPropertiesW(const ArgDocumentPropertiesW& arg)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("DocumentPropertiesW", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_DocumentPropertiesW_pargs args;
  args.arg = &arg;
  args.write(oprot_);

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

void SelfServiceClient::recv_DocumentPropertiesW(ArgDocumentPropertiesW& _return)
{

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

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

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

void SelfServiceClient::EnumFormsW(std::map<std::string, std::string> & _return, const int64_t hPrinter, const int32_t Level, const int32_t cbBuf)
{
  send_EnumFormsW(hPrinter, Level, cbBuf);
  recv_EnumFormsW(_return);
}

void SelfServiceClient::send_EnumFormsW(const int64_t hPrinter, const int32_t Level, const int32_t cbBuf)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("EnumFormsW", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_EnumFormsW_pargs args;
  args.hPrinter = &hPrinter;
  args.Level = &Level;
  args.cbBuf = &cbBuf;
  args.write(oprot_);

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

void SelfServiceClient::recv_EnumFormsW(std::map<std::string, std::string> & _return)
{

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

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

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

void SelfServiceClient::EnumPrintersW(ArgEnumPrintersW& _return, const ArgEnumPrintersW& arg)
{
  send_EnumPrintersW(arg);
  recv_EnumPrintersW(_return);
}

void SelfServiceClient::send_EnumPrintersW(const ArgEnumPrintersW& arg)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("EnumPrintersW", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_EnumPrintersW_pargs args;
  args.arg = &arg;
  args.write(oprot_);

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

void SelfServiceClient::recv_EnumPrintersW(ArgEnumPrintersW& _return)
{

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

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

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

bool SelfServiceClient::FindClosePrinterChangeNotification(const int64_t hChange)
{
  send_FindClosePrinterChangeNotification(hChange);
  return recv_FindClosePrinterChangeNotification();
}

void SelfServiceClient::send_FindClosePrinterChangeNotification(const int64_t hChange)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("FindClosePrinterChangeNotification", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_FindClosePrinterChangeNotification_pargs args;
  args.hChange = &hChange;
  args.write(oprot_);

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

bool SelfServiceClient::recv_FindClosePrinterChangeNotification()
{

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

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

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

int64_t SelfServiceClient::FindFirstPrinterChangeNotification(const int64_t hPrinter, const int32_t fdwFilter, const int32_t fdwOptions, const std::string& pPrinterNotifyOptions)
{
  send_FindFirstPrinterChangeNotification(hPrinter, fdwFilter, fdwOptions, pPrinterNotifyOptions);
  return recv_FindFirstPrinterChangeNotification();
}

void SelfServiceClient::send_FindFirstPrinterChangeNotification(const int64_t hPrinter, const int32_t fdwFilter, const int32_t fdwOptions, const std::string& pPrinterNotifyOptions)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("FindFirstPrinterChangeNotification", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_FindFirstPrinterChangeNotification_pargs args;
  args.hPrinter = &hPrinter;
  args.fdwFilter = &fdwFilter;
  args.fdwOptions = &fdwOptions;
  args.pPrinterNotifyOptions = &pPrinterNotifyOptions;
  args.write(oprot_);

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

int64_t SelfServiceClient::recv_FindFirstPrinterChangeNotification()
{

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

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

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

void SelfServiceClient::FindNextPrinterChangeNotification(std::map<std::string, std::string> & _return, const int64_t hChange, const std::string& pPrinterNotifyOptions)
{
  send_FindNextPrinterChangeNotification(hChange, pPrinterNotifyOptions);
  recv_FindNextPrinterChangeNotification(_return);
}

void SelfServiceClient::send_FindNextPrinterChangeNotification(const int64_t hChange, const std::string& pPrinterNotifyOptions)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("FindNextPrinterChangeNotification", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_FindNextPrinterChangeNotification_pargs args;
  args.hChange = &hChange;
  args.pPrinterNotifyOptions = &pPrinterNotifyOptions;
  args.write(oprot_);

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

void SelfServiceClient::recv_FindNextPrinterChangeNotification(std::map<std::string, std::string> & _return)
{

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

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

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

bool SelfServiceClient::FreePrinterNotifyInfo(const std::string& pPrinterNotifyInfo)
{
  send_FreePrinterNotifyInfo(pPrinterNotifyInfo);
  return recv_FreePrinterNotifyInfo();
}

void SelfServiceClient::send_FreePrinterNotifyInfo(const std::string& pPrinterNotifyInfo)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("FreePrinterNotifyInfo", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_FreePrinterNotifyInfo_pargs args;
  args.pPrinterNotifyInfo = &pPrinterNotifyInfo;
  args.write(oprot_);

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

bool SelfServiceClient::recv_FreePrinterNotifyInfo()
{

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

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

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

void SelfServiceClient::GetDefaultPrinterW(ArgGetDefaultPrinterW& _return, const ArgGetDefaultPrinterW& arg)
{
  send_GetDefaultPrinterW(arg);
  recv_GetDefaultPrinterW(_return);
}

void SelfServiceClient::send_GetDefaultPrinterW(const ArgGetDefaultPrinterW& arg)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("GetDefaultPrinterW", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_GetDefaultPrinterW_pargs args;
  args.arg = &arg;
  args.write(oprot_);

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

void SelfServiceClient::recv_GetDefaultPrinterW(ArgGetDefaultPrinterW& _return)
{

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

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

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

void SelfServiceClient::GetPrinterDataW(std::map<std::string, std::string> & _return, const int64_t hPrinter, const std::string& pValueName, const int32_t nSize)
{
  send_GetPrinterDataW(hPrinter, pValueName, nSize);
  recv_GetPrinterDataW(_return);
}

void SelfServiceClient::send_GetPrinterDataW(const int64_t hPrinter, const std::string& pValueName, const int32_t nSize)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("GetPrinterDataW", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_GetPrinterDataW_pargs args;
  args.hPrinter = &hPrinter;
  args.pValueName = &pValueName;
  args.nSize = &nSize;
  args.write(oprot_);

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

void SelfServiceClient::recv_GetPrinterDataW(std::map<std::string, std::string> & _return)
{

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

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

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

void SelfServiceClient::GetPrinterDataExW(std::map<std::string, std::string> & _return, const int64_t hPrinter, const std::string& pKeyName, const std::string& pValueName, const int32_t nSize)
{
  send_GetPrinterDataExW(hPrinter, pKeyName, pValueName, nSize);
  recv_GetPrinterDataExW(_return);
}

void SelfServiceClient::send_GetPrinterDataExW(const int64_t hPrinter, const std::string& pKeyName, const std::string& pValueName, const int32_t nSize)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("GetPrinterDataExW", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_GetPrinterDataExW_pargs args;
  args.hPrinter = &hPrinter;
  args.pKeyName = &pKeyName;
  args.pValueName = &pValueName;
  args.nSize = &nSize;
  args.write(oprot_);

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

void SelfServiceClient::recv_GetPrinterDataExW(std::map<std::string, std::string> & _return)
{

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

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

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

void SelfServiceClient::GetPrinterW(ArgGetPrinterW& _return, const ArgGetPrinterW& arg)
{
  send_GetPrinterW(arg);
  recv_GetPrinterW(_return);
}

void SelfServiceClient::send_GetPrinterW(const ArgGetPrinterW& arg)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("GetPrinterW", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_GetPrinterW_pargs args;
  args.arg = &arg;
  args.write(oprot_);

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

void SelfServiceClient::recv_GetPrinterW(ArgGetPrinterW& _return)
{

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

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

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

int64_t SelfServiceClient::GetSpoolFileHandle(const int64_t hPrinter)
{
  send_GetSpoolFileHandle(hPrinter);
  return recv_GetSpoolFileHandle();
}

void SelfServiceClient::send_GetSpoolFileHandle(const int64_t hPrinter)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("GetSpoolFileHandle", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_GetSpoolFileHandle_pargs args;
  args.hPrinter = &hPrinter;
  args.write(oprot_);

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

int64_t SelfServiceClient::recv_GetSpoolFileHandle()
{

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

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

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

bool SelfServiceClient::IsValidDevmodeW(const std::string& pDevmode, const int32_t DevmodeSize)
{
  send_IsValidDevmodeW(pDevmode, DevmodeSize);
  return recv_IsValidDevmodeW();
}

void SelfServiceClient::send_IsValidDevmodeW(const std::string& pDevmode, const int32_t DevmodeSize)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("IsValidDevmodeW", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_IsValidDevmodeW_pargs args;
  args.pDevmode = &pDevmode;
  args.DevmodeSize = &DevmodeSize;
  args.write(oprot_);

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

bool SelfServiceClient::recv_IsValidDevmodeW()
{

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

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

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

void SelfServiceClient::OpenPrinter2W(std::map<std::string, int64_t> & _return, const std::string& pPrinterName, const bool pDefaultExist, const std::string& pDatatype, const std::string& pDevMode, const int32_t DesiredAccess, const std::string& pOptions)
{
  send_OpenPrinter2W(pPrinterName, pDefaultExist, pDatatype, pDevMode, DesiredAccess, pOptions);
  recv_OpenPrinter2W(_return);
}

void SelfServiceClient::send_OpenPrinter2W(const std::string& pPrinterName, const bool pDefaultExist, const std::string& pDatatype, const std::string& pDevMode, const int32_t DesiredAccess, const std::string& pOptions)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("OpenPrinter2W", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_OpenPrinter2W_pargs args;
  args.pPrinterName = &pPrinterName;
  args.pDefaultExist = &pDefaultExist;
  args.pDatatype = &pDatatype;
  args.pDevMode = &pDevMode;
  args.DesiredAccess = &DesiredAccess;
  args.pOptions = &pOptions;
  args.write(oprot_);

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

void SelfServiceClient::recv_OpenPrinter2W(std::map<std::string, int64_t> & _return)
{

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

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

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

void SelfServiceClient::OpenPrinter2A(std::map<std::string, int64_t> & _return, const std::string& pPrinterName, const bool pDefaultExist, const std::string& pDatatype, const std::string& pDevMode, const int32_t DesiredAccess, const std::string& pOptions)
{
  send_OpenPrinter2A(pPrinterName, pDefaultExist, pDatatype, pDevMode, DesiredAccess, pOptions);
  recv_OpenPrinter2A(_return);
}

void SelfServiceClient::send_OpenPrinter2A(const std::string& pPrinterName, const bool pDefaultExist, const std::string& pDatatype, const std::string& pDevMode, const int32_t DesiredAccess, const std::string& pOptions)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("OpenPrinter2A", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_OpenPrinter2A_pargs args;
  args.pPrinterName = &pPrinterName;
  args.pDefaultExist = &pDefaultExist;
  args.pDatatype = &pDatatype;
  args.pDevMode = &pDevMode;
  args.DesiredAccess = &DesiredAccess;
  args.pOptions = &pOptions;
  args.write(oprot_);

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

void SelfServiceClient::recv_OpenPrinter2A(std::map<std::string, int64_t> & _return)
{

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

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

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

int32_t SelfServiceClient::OpenUsbPort(const int32_t dwModel)
{
  send_OpenUsbPort(dwModel);
  return recv_OpenUsbPort();
}

void SelfServiceClient::send_OpenUsbPort(const int32_t dwModel)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("OpenUsbPort", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_OpenUsbPort_pargs args;
  args.dwModel = &dwModel;
  args.write(oprot_);

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

int32_t SelfServiceClient::recv_OpenUsbPort()
{

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

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

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

int32_t SelfServiceClient::CloseUsbPort()
{
  send_CloseUsbPort();
  return recv_CloseUsbPort();
}

void SelfServiceClient::send_CloseUsbPort()
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("CloseUsbPort", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_CloseUsbPort_pargs args;
  args.write(oprot_);

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

int32_t SelfServiceClient::recv_CloseUsbPort()
{

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

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

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

int32_t SelfServiceClient::WriteUSB(const std::string& pBuffer, const int32_t nNumberOfBytesToWrite)
{
  send_WriteUSB(pBuffer, nNumberOfBytesToWrite);
  return recv_WriteUSB();
}

void SelfServiceClient::send_WriteUSB(const std::string& pBuffer, const int32_t nNumberOfBytesToWrite)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("WriteUSB", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_WriteUSB_pargs args;
  args.pBuffer = &pBuffer;
  args.nNumberOfBytesToWrite = &nNumberOfBytesToWrite;
  args.write(oprot_);

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

int32_t SelfServiceClient::recv_WriteUSB()
{

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

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

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

int32_t SelfServiceClient::ReadUSB(const std::string& pBuffer, const int32_t nNumberOfByteToRead)
{
  send_ReadUSB(pBuffer, nNumberOfByteToRead);
  return recv_ReadUSB();
}

void SelfServiceClient::send_ReadUSB(const std::string& pBuffer, const int32_t nNumberOfByteToRead)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("ReadUSB", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_ReadUSB_pargs args;
  args.pBuffer = &pBuffer;
  args.nNumberOfByteToRead = &nNumberOfByteToRead;
  args.write(oprot_);

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

int32_t SelfServiceClient::recv_ReadUSB()
{

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

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

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

int32_t SelfServiceClient::PrintBitmap(const std::string& pbmpDir, const std::string& data)
{
  send_PrintBitmap(pbmpDir, data);
  return recv_PrintBitmap();
}

void SelfServiceClient::send_PrintBitmap(const std::string& pbmpDir, const std::string& data)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("PrintBitmap", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_PrintBitmap_pargs args;
  args.pbmpDir = &pbmpDir;
  args.data = &data;
  args.write(oprot_);

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

int32_t SelfServiceClient::recv_PrintBitmap()
{

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

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

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

int32_t SelfServiceClient::Print1DBarcode(const int32_t nCodeType, const int32_t nWidth, const int32_t nHeight, const int32_t nHRI, const std::string& pBuffer)
{
  send_Print1DBarcode(nCodeType, nWidth, nHeight, nHRI, pBuffer);
  return recv_Print1DBarcode();
}

void SelfServiceClient::send_Print1DBarcode(const int32_t nCodeType, const int32_t nWidth, const int32_t nHeight, const int32_t nHRI, const std::string& pBuffer)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("Print1DBarcode", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_Print1DBarcode_pargs args;
  args.nCodeType = &nCodeType;
  args.nWidth = &nWidth;
  args.nHeight = &nHeight;
  args.nHRI = &nHRI;
  args.pBuffer = &pBuffer;
  args.write(oprot_);

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

int32_t SelfServiceClient::recv_Print1DBarcode()
{

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

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

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

int32_t SelfServiceClient::PrintPDF417(const int32_t nColumns, const int32_t nRows, const int32_t nWidth, const int32_t nHeight, const int32_t nECLevel, const int32_t nModule, const std::string& pBuffer, const std::string& data)
{
  send_PrintPDF417(nColumns, nRows, nWidth, nHeight, nECLevel, nModule, pBuffer, data);
  return recv_PrintPDF417();
}

void SelfServiceClient::send_PrintPDF417(const int32_t nColumns, const int32_t nRows, const int32_t nWidth, const int32_t nHeight, const int32_t nECLevel, const int32_t nModule, const std::string& pBuffer, const std::string& data)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("PrintPDF417", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_PrintPDF417_pargs args;
  args.nColumns = &nColumns;
  args.nRows = &nRows;
  args.nWidth = &nWidth;
  args.nHeight = &nHeight;
  args.nECLevel = &nECLevel;
  args.nModule = &nModule;
  args.pBuffer = &pBuffer;
  args.data = &data;
  args.write(oprot_);

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

int32_t SelfServiceClient::recv_PrintPDF417()
{

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

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

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

int32_t SelfServiceClient::PrintQRCode(const int32_t nModule, const int32_t nSize, const int32_t nECLevel, const std::string& pBuffer)
{
  send_PrintQRCode(nModule, nSize, nECLevel, pBuffer);
  return recv_PrintQRCode();
}

void SelfServiceClient::send_PrintQRCode(const int32_t nModule, const int32_t nSize, const int32_t nECLevel, const std::string& pBuffer)
{
  int32_t cseqid = 0;
  oprot_->writeMessageBegin("PrintQRCode", ::apache::thrift::protocol::T_CALL, cseqid);

  SelfService_PrintQRCode_pargs args;
  args.nModule = &nModule;
  args.nSize = &nSize;
  args.nECLevel = &nECLevel;
  args.pBuffer = &pBuffer;
  args.write(oprot_);

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

int32_t SelfServiceClient::recv_PrintQRCode()
{

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

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

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

bool SelfServiceProcessor::dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext) {
  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))(seqid, iprot, oprot, callContext);
  return true;
}

void SelfServiceProcessor::process_OpenPrinterA(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("SelfService.OpenPrinterA", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.OpenPrinterA");

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

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

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

  SelfService_OpenPrinterA_result result;
  try {
    iface_->OpenPrinterA(result.success, args.pPrinterName, args.pDefaultExist, args.pDatatype, args.pDevMode, args.DesiredAccess);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.OpenPrinterA");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("OpenPrinterA", ::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, "SelfService.OpenPrinterA");
  }

  oprot->writeMessageBegin("OpenPrinterA", ::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, "SelfService.OpenPrinterA", bytes);
  }
}

void SelfServiceProcessor::process_OpenPrinterW(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("SelfService.OpenPrinterW", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.OpenPrinterW");

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

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

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

  SelfService_OpenPrinterW_result result;
  try {
    iface_->OpenPrinterW(result.success, args.pPrinterName, args.pDefaultExist, args.pDatatype, args.pDevMode, args.DesiredAccess);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.OpenPrinterW");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("OpenPrinterW", ::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, "SelfService.OpenPrinterW");
  }

  oprot->writeMessageBegin("OpenPrinterW", ::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, "SelfService.OpenPrinterW", bytes);
  }
}

void SelfServiceProcessor::process_StartPagePrinter(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("SelfService.StartPagePrinter", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.StartPagePrinter");

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

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

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

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

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("StartPagePrinter", ::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, "SelfService.StartPagePrinter");
  }

  oprot->writeMessageBegin("StartPagePrinter", ::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, "SelfService.StartPagePrinter", bytes);
  }
}

void SelfServiceProcessor::process_StartDocPrinterW(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("SelfService.StartDocPrinterW", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.StartDocPrinterW");

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

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

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

  SelfService_StartDocPrinterW_result result;
  try {
    result.success = iface_->StartDocPrinterW(args.hPrinter, args.Level, args.pDocName, args.pOutputFile, args.pDatatype);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.StartDocPrinterW");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("StartDocPrinterW", ::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, "SelfService.StartDocPrinterW");
  }

  oprot->writeMessageBegin("StartDocPrinterW", ::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, "SelfService.StartDocPrinterW", bytes);
  }
}

void SelfServiceProcessor::process_WritePrinter(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("SelfService.WritePrinter", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.WritePrinter");

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

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

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

  SelfService_WritePrinter_result result;
  try {
    iface_->WritePrinter(result.success, args.hPrinter, args.pBuf, args.cbBuf);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.WritePrinter");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("WritePrinter", ::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, "SelfService.WritePrinter");
  }

  oprot->writeMessageBegin("WritePrinter", ::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, "SelfService.WritePrinter", bytes);
  }
}

void SelfServiceProcessor::process_EndPagePrinter(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("SelfService.EndPagePrinter", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.EndPagePrinter");

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

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

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

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

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("EndPagePrinter", ::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, "SelfService.EndPagePrinter");
  }

  oprot->writeMessageBegin("EndPagePrinter", ::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, "SelfService.EndPagePrinter", bytes);
  }
}

void SelfServiceProcessor::process_EndDocPrinter(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("SelfService.EndDocPrinter", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.EndDocPrinter");

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

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

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

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

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("EndDocPrinter", ::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, "SelfService.EndDocPrinter");
  }

  oprot->writeMessageBegin("EndDocPrinter", ::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, "SelfService.EndDocPrinter", bytes);
  }
}

void SelfServiceProcessor::process_ClosePrinter(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("SelfService.ClosePrinter", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.ClosePrinter");

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

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

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

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

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("ClosePrinter", ::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, "SelfService.ClosePrinter");
  }

  oprot->writeMessageBegin("ClosePrinter", ::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, "SelfService.ClosePrinter", bytes);
  }
}

void SelfServiceProcessor::process_CloseSpoolFileHandle(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("SelfService.CloseSpoolFileHandle", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.CloseSpoolFileHandle");

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

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

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

  SelfService_CloseSpoolFileHandle_result result;
  try {
    result.success = iface_->CloseSpoolFileHandle(args.hPrinter, args.hSpoolFile);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.CloseSpoolFileHandle");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("CloseSpoolFileHandle", ::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, "SelfService.CloseSpoolFileHandle");
  }

  oprot->writeMessageBegin("CloseSpoolFileHandle", ::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, "SelfService.CloseSpoolFileHandle", bytes);
  }
}

void SelfServiceProcessor::process_CommitSpoolData(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("SelfService.CommitSpoolData", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.CommitSpoolData");

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

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

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

  SelfService_CommitSpoolData_result result;
  try {
    result.success = iface_->CommitSpoolData(args.hPrinter, args.hSpoolFile, args.cbCommit);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.CommitSpoolData");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("CommitSpoolData", ::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, "SelfService.CommitSpoolData");
  }

  oprot->writeMessageBegin("CommitSpoolData", ::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, "SelfService.CommitSpoolData", bytes);
  }
}

void SelfServiceProcessor::process_DocumentEvent(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("SelfService.DocumentEvent", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.DocumentEvent");

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

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

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

  SelfService_DocumentEvent_result result;
  try {
    iface_->DocumentEvent(result.success, args.hPrinter, args.hdc, args.iEsc, args.cbIn, args.pvIn, args.cbOut, args.pvOut);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.DocumentEvent");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("DocumentEvent", ::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, "SelfService.DocumentEvent");
  }

  oprot->writeMessageBegin("DocumentEvent", ::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, "SelfService.DocumentEvent", bytes);
  }
}

void SelfServiceProcessor::process_DocumentPropertiesW(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("SelfService.DocumentPropertiesW", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.DocumentPropertiesW");

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

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

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

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

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("DocumentPropertiesW", ::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, "SelfService.DocumentPropertiesW");
  }

  oprot->writeMessageBegin("DocumentPropertiesW", ::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, "SelfService.DocumentPropertiesW", bytes);
  }
}

void SelfServiceProcessor::process_EnumFormsW(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("SelfService.EnumFormsW", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.EnumFormsW");

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

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

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

  SelfService_EnumFormsW_result result;
  try {
    iface_->EnumFormsW(result.success, args.hPrinter, args.Level, args.cbBuf);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.EnumFormsW");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("EnumFormsW", ::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, "SelfService.EnumFormsW");
  }

  oprot->writeMessageBegin("EnumFormsW", ::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, "SelfService.EnumFormsW", bytes);
  }
}

void SelfServiceProcessor::process_EnumPrintersW(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("SelfService.EnumPrintersW", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.EnumPrintersW");

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

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

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

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

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("EnumPrintersW", ::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, "SelfService.EnumPrintersW");
  }

  oprot->writeMessageBegin("EnumPrintersW", ::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, "SelfService.EnumPrintersW", bytes);
  }
}

void SelfServiceProcessor::process_FindClosePrinterChangeNotification(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("SelfService.FindClosePrinterChangeNotification", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.FindClosePrinterChangeNotification");

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

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

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

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

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("FindClosePrinterChangeNotification", ::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, "SelfService.FindClosePrinterChangeNotification");
  }

  oprot->writeMessageBegin("FindClosePrinterChangeNotification", ::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, "SelfService.FindClosePrinterChangeNotification", bytes);
  }
}

void SelfServiceProcessor::process_FindFirstPrinterChangeNotification(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("SelfService.FindFirstPrinterChangeNotification", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.FindFirstPrinterChangeNotification");

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

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

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

  SelfService_FindFirstPrinterChangeNotification_result result;
  try {
    result.success = iface_->FindFirstPrinterChangeNotification(args.hPrinter, args.fdwFilter, args.fdwOptions, args.pPrinterNotifyOptions);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.FindFirstPrinterChangeNotification");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("FindFirstPrinterChangeNotification", ::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, "SelfService.FindFirstPrinterChangeNotification");
  }

  oprot->writeMessageBegin("FindFirstPrinterChangeNotification", ::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, "SelfService.FindFirstPrinterChangeNotification", bytes);
  }
}

void SelfServiceProcessor::process_FindNextPrinterChangeNotification(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("SelfService.FindNextPrinterChangeNotification", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.FindNextPrinterChangeNotification");

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

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

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

  SelfService_FindNextPrinterChangeNotification_result result;
  try {
    iface_->FindNextPrinterChangeNotification(result.success, args.hChange, args.pPrinterNotifyOptions);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.FindNextPrinterChangeNotification");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("FindNextPrinterChangeNotification", ::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, "SelfService.FindNextPrinterChangeNotification");
  }

  oprot->writeMessageBegin("FindNextPrinterChangeNotification", ::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, "SelfService.FindNextPrinterChangeNotification", bytes);
  }
}

void SelfServiceProcessor::process_FreePrinterNotifyInfo(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("SelfService.FreePrinterNotifyInfo", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.FreePrinterNotifyInfo");

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

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

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

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

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("FreePrinterNotifyInfo", ::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, "SelfService.FreePrinterNotifyInfo");
  }

  oprot->writeMessageBegin("FreePrinterNotifyInfo", ::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, "SelfService.FreePrinterNotifyInfo", bytes);
  }
}

void SelfServiceProcessor::process_GetDefaultPrinterW(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("SelfService.GetDefaultPrinterW", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.GetDefaultPrinterW");

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

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

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

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

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("GetDefaultPrinterW", ::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, "SelfService.GetDefaultPrinterW");
  }

  oprot->writeMessageBegin("GetDefaultPrinterW", ::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, "SelfService.GetDefaultPrinterW", bytes);
  }
}

void SelfServiceProcessor::process_GetPrinterDataW(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("SelfService.GetPrinterDataW", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.GetPrinterDataW");

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

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

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

  SelfService_GetPrinterDataW_result result;
  try {
    iface_->GetPrinterDataW(result.success, args.hPrinter, args.pValueName, args.nSize);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.GetPrinterDataW");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("GetPrinterDataW", ::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, "SelfService.GetPrinterDataW");
  }

  oprot->writeMessageBegin("GetPrinterDataW", ::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, "SelfService.GetPrinterDataW", bytes);
  }
}

void SelfServiceProcessor::process_GetPrinterDataExW(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("SelfService.GetPrinterDataExW", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.GetPrinterDataExW");

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

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

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

  SelfService_GetPrinterDataExW_result result;
  try {
    iface_->GetPrinterDataExW(result.success, args.hPrinter, args.pKeyName, args.pValueName, args.nSize);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.GetPrinterDataExW");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("GetPrinterDataExW", ::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, "SelfService.GetPrinterDataExW");
  }

  oprot->writeMessageBegin("GetPrinterDataExW", ::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, "SelfService.GetPrinterDataExW", bytes);
  }
}

void SelfServiceProcessor::process_GetPrinterW(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("SelfService.GetPrinterW", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.GetPrinterW");

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

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

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

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

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("GetPrinterW", ::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, "SelfService.GetPrinterW");
  }

  oprot->writeMessageBegin("GetPrinterW", ::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, "SelfService.GetPrinterW", bytes);
  }
}

void SelfServiceProcessor::process_GetSpoolFileHandle(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("SelfService.GetSpoolFileHandle", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.GetSpoolFileHandle");

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

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

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

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

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("GetSpoolFileHandle", ::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, "SelfService.GetSpoolFileHandle");
  }

  oprot->writeMessageBegin("GetSpoolFileHandle", ::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, "SelfService.GetSpoolFileHandle", bytes);
  }
}

void SelfServiceProcessor::process_IsValidDevmodeW(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("SelfService.IsValidDevmodeW", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.IsValidDevmodeW");

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

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

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

  SelfService_IsValidDevmodeW_result result;
  try {
    result.success = iface_->IsValidDevmodeW(args.pDevmode, args.DevmodeSize);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.IsValidDevmodeW");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("IsValidDevmodeW", ::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, "SelfService.IsValidDevmodeW");
  }

  oprot->writeMessageBegin("IsValidDevmodeW", ::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, "SelfService.IsValidDevmodeW", bytes);
  }
}

void SelfServiceProcessor::process_OpenPrinter2W(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("SelfService.OpenPrinter2W", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.OpenPrinter2W");

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

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

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

  SelfService_OpenPrinter2W_result result;
  try {
    iface_->OpenPrinter2W(result.success, args.pPrinterName, args.pDefaultExist, args.pDatatype, args.pDevMode, args.DesiredAccess, args.pOptions);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.OpenPrinter2W");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("OpenPrinter2W", ::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, "SelfService.OpenPrinter2W");
  }

  oprot->writeMessageBegin("OpenPrinter2W", ::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, "SelfService.OpenPrinter2W", bytes);
  }
}

void SelfServiceProcessor::process_OpenPrinter2A(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("SelfService.OpenPrinter2A", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.OpenPrinter2A");

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

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

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

  SelfService_OpenPrinter2A_result result;
  try {
    iface_->OpenPrinter2A(result.success, args.pPrinterName, args.pDefaultExist, args.pDatatype, args.pDevMode, args.DesiredAccess, args.pOptions);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.OpenPrinter2A");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("OpenPrinter2A", ::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, "SelfService.OpenPrinter2A");
  }

  oprot->writeMessageBegin("OpenPrinter2A", ::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, "SelfService.OpenPrinter2A", bytes);
  }
}

void SelfServiceProcessor::process_OpenUsbPort(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("SelfService.OpenUsbPort", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.OpenUsbPort");

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

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

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

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

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("OpenUsbPort", ::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, "SelfService.OpenUsbPort");
  }

  oprot->writeMessageBegin("OpenUsbPort", ::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, "SelfService.OpenUsbPort", bytes);
  }
}

void SelfServiceProcessor::process_CloseUsbPort(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("SelfService.CloseUsbPort", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.CloseUsbPort");

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

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

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

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

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("CloseUsbPort", ::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, "SelfService.CloseUsbPort");
  }

  oprot->writeMessageBegin("CloseUsbPort", ::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, "SelfService.CloseUsbPort", bytes);
  }
}

void SelfServiceProcessor::process_WriteUSB(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("SelfService.WriteUSB", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.WriteUSB");

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

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

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

  SelfService_WriteUSB_result result;
  try {
    result.success = iface_->WriteUSB(args.pBuffer, args.nNumberOfBytesToWrite);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.WriteUSB");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("WriteUSB", ::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, "SelfService.WriteUSB");
  }

  oprot->writeMessageBegin("WriteUSB", ::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, "SelfService.WriteUSB", bytes);
  }
}

void SelfServiceProcessor::process_ReadUSB(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("SelfService.ReadUSB", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.ReadUSB");

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

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

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

  SelfService_ReadUSB_result result;
  try {
    result.success = iface_->ReadUSB(args.pBuffer, args.nNumberOfByteToRead);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.ReadUSB");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("ReadUSB", ::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, "SelfService.ReadUSB");
  }

  oprot->writeMessageBegin("ReadUSB", ::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, "SelfService.ReadUSB", bytes);
  }
}

void SelfServiceProcessor::process_PrintBitmap(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("SelfService.PrintBitmap", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.PrintBitmap");

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

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

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

  SelfService_PrintBitmap_result result;
  try {
    result.success = iface_->PrintBitmap(args.pbmpDir, args.data);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.PrintBitmap");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("PrintBitmap", ::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, "SelfService.PrintBitmap");
  }

  oprot->writeMessageBegin("PrintBitmap", ::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, "SelfService.PrintBitmap", bytes);
  }
}

void SelfServiceProcessor::process_Print1DBarcode(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("SelfService.Print1DBarcode", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.Print1DBarcode");

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

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

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

  SelfService_Print1DBarcode_result result;
  try {
    result.success = iface_->Print1DBarcode(args.nCodeType, args.nWidth, args.nHeight, args.nHRI, args.pBuffer);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.Print1DBarcode");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("Print1DBarcode", ::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, "SelfService.Print1DBarcode");
  }

  oprot->writeMessageBegin("Print1DBarcode", ::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, "SelfService.Print1DBarcode", bytes);
  }
}

void SelfServiceProcessor::process_PrintPDF417(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("SelfService.PrintPDF417", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.PrintPDF417");

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

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

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

  SelfService_PrintPDF417_result result;
  try {
    result.success = iface_->PrintPDF417(args.nColumns, args.nRows, args.nWidth, args.nHeight, args.nECLevel, args.nModule, args.pBuffer, args.data);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.PrintPDF417");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("PrintPDF417", ::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, "SelfService.PrintPDF417");
  }

  oprot->writeMessageBegin("PrintPDF417", ::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, "SelfService.PrintPDF417", bytes);
  }
}

void SelfServiceProcessor::process_PrintQRCode(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("SelfService.PrintQRCode", callContext);
  }
  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "SelfService.PrintQRCode");

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

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

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

  SelfService_PrintQRCode_result result;
  try {
    result.success = iface_->PrintQRCode(args.nModule, args.nSize, args.nECLevel, args.pBuffer);
    result.__isset.success = true;
  } catch (const std::exception& e) {
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->handlerError(ctx, "SelfService.PrintQRCode");
    }

    ::apache::thrift::TApplicationException x(e.what());
    oprot->writeMessageBegin("PrintQRCode", ::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, "SelfService.PrintQRCode");
  }

  oprot->writeMessageBegin("PrintQRCode", ::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, "SelfService.PrintQRCode", bytes);
  }
}

::boost::shared_ptr< ::apache::thrift::TProcessor > SelfServiceProcessorFactory::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) {
  ::apache::thrift::ReleaseHandler< SelfServiceIfFactory > cleanup(handlerFactory_);
  ::boost::shared_ptr< SelfServiceIf > handler(handlerFactory_->getHandler(connInfo), cleanup);
  ::boost::shared_ptr< ::apache::thrift::TProcessor > processor(new SelfServiceProcessor(handler));
  return processor;
}
} // namespace

redpajama_set_name: RedPajamaGithub