text: /**
   * Autogenerated by Thrift Compiler (0.13.0)
   *
   * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
   *  @generated
   */
  #include "TUniquepairService.h"
  
  namespace gen {
  
  
  TUniquepairService_get_args::~TUniquepairService_get_args() noexcept {
  }
  
  
  uint32_t TUniquepairService_get_args::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 1:
          if (ftype == ::apache::thrift::protocol::T_I32) {
            xfer += iprot->readI32(this->uniquepair_id);
            this->__isset.uniquepair_id = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t TUniquepairService_get_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_get_args");
  
    xfer += oprot->writeFieldBegin("uniquepair_id", ::apache::thrift::protocol::T_I32, 1);
    xfer += oprot->writeI32(this->uniquepair_id);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_get_pargs::~TUniquepairService_get_pargs() noexcept {
  }
  
  
  uint32_t TUniquepairService_get_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_get_pargs");
  
    xfer += oprot->writeFieldBegin("uniquepair_id", ::apache::thrift::protocol::T_I32, 1);
    xfer += oprot->writeI32((*(this->uniquepair_id)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_get_result::~TUniquepairService_get_result() noexcept {
  }
  
  
  uint32_t TUniquepairService_get_result::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 0:
          if (ftype == ::apache::thrift::protocol::T_STRUCT) {
            xfer += this->success.read(iprot);
            this->__isset.success = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 1:
          if (ftype == ::apache::thrift::protocol::T_STRUCT) {
            xfer += this->e.read(iprot);
            this->__isset.e = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t TUniquepairService_get_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
  
    uint32_t xfer = 0;
  
    xfer += oprot->writeStructBegin("TUniquepairService_get_result");
  
    if (this->__isset.success) {
      xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0);
      xfer += this->success.write(oprot);
      xfer += oprot->writeFieldEnd();
    } else if (this->__isset.e) {
      xfer += oprot->writeFieldBegin("e", ::apache::thrift::protocol::T_STRUCT, 1);
      xfer += this->e.write(oprot);
      xfer += oprot->writeFieldEnd();
    }
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_get_presult::~TUniquepairService_get_presult() noexcept {
  }
  
  
  uint32_t TUniquepairService_get_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 0:
          if (ftype == ::apache::thrift::protocol::T_STRUCT) {
            xfer += (*(this->success)).read(iprot);
            this->__isset.success = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 1:
          if (ftype == ::apache::thrift::protocol::T_STRUCT) {
            xfer += this->e.read(iprot);
            this->__isset.e = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  
  TUniquepairService_add_args::~TUniquepairService_add_args() noexcept {
  }
  
  
  uint32_t TUniquepairService_add_args::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 1:
          if (ftype == ::apache::thrift::protocol::T_STRING) {
            xfer += iprot->readString(this->domain);
            this->__isset.domain = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 2:
          if (ftype == ::apache::thrift::protocol::T_I32) {
            xfer += iprot->readI32(this->first_elem);
            this->__isset.first_elem = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 3:
          if (ftype == ::apache::thrift::protocol::T_I32) {
            xfer += iprot->readI32(this->second_elem);
            this->__isset.second_elem = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t TUniquepairService_add_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_add_args");
  
    xfer += oprot->writeFieldBegin("domain", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->domain);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("first_elem", ::apache::thrift::protocol::T_I32, 2);
    xfer += oprot->writeI32(this->first_elem);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("second_elem", ::apache::thrift::protocol::T_I32, 3);
    xfer += oprot->writeI32(this->second_elem);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_add_pargs::~TUniquepairService_add_pargs() noexcept {
  }
  
  
  uint32_t TUniquepairService_add_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_add_pargs");
  
    xfer += oprot->writeFieldBegin("domain", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString((*(this->domain)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("first_elem", ::apache::thrift::protocol::T_I32, 2);
    xfer += oprot->writeI32((*(this->first_elem)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("second_elem", ::apache::thrift::protocol::T_I32, 3);
    xfer += oprot->writeI32((*(this->second_elem)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_add_result::~TUniquepairService_add_result() noexcept {
  }
  
  
  uint32_t TUniquepairService_add_result::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 0:
          if (ftype == ::apache::thrift::protocol::T_STRUCT) {
            xfer += this->success.read(iprot);
            this->__isset.success = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 1:
          if (ftype == ::apache::thrift::protocol::T_STRUCT) {
            xfer += this->e.read(iprot);
            this->__isset.e = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t TUniquepairService_add_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
  
    uint32_t xfer = 0;
  
    xfer += oprot->writeStructBegin("TUniquepairService_add_result");
  
    if (this->__isset.success) {
      xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0);
      xfer += this->success.write(oprot);
      xfer += oprot->writeFieldEnd();
    } else if (this->__isset.e) {
      xfer += oprot->writeFieldBegin("e", ::apache::thrift::protocol::T_STRUCT, 1);
      xfer += this->e.write(oprot);
      xfer += oprot->writeFieldEnd();
    }
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_add_presult::~TUniquepairService_add_presult() noexcept {
  }
  
  
  uint32_t TUniquepairService_add_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 0:
          if (ftype == ::apache::thrift::protocol::T_STRUCT) {
            xfer += (*(this->success)).read(iprot);
            this->__isset.success = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 1:
          if (ftype == ::apache::thrift::protocol::T_STRUCT) {
            xfer += this->e.read(iprot);
            this->__isset.e = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  
  TUniquepairService_remove_args::~TUniquepairService_remove_args() noexcept {
  }
  
  
  uint32_t TUniquepairService_remove_args::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 1:
          if (ftype == ::apache::thrift::protocol::T_I32) {
            xfer += iprot->readI32(this->uniquepair_id);
            this->__isset.uniquepair_id = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t TUniquepairService_remove_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_remove_args");
  
    xfer += oprot->writeFieldBegin("uniquepair_id", ::apache::thrift::protocol::T_I32, 1);
    xfer += oprot->writeI32(this->uniquepair_id);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_remove_pargs::~TUniquepairService_remove_pargs() noexcept {
  }
  
  
  uint32_t TUniquepairService_remove_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_remove_pargs");
  
    xfer += oprot->writeFieldBegin("uniquepair_id", ::apache::thrift::protocol::T_I32, 1);
    xfer += oprot->writeI32((*(this->uniquepair_id)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_remove_result::~TUniquepairService_remove_result() noexcept {
  }
  
  
  uint32_t TUniquepairService_remove_result::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 1:
          if (ftype == ::apache::thrift::protocol::T_STRUCT) {
            xfer += this->e.read(iprot);
            this->__isset.e = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t TUniquepairService_remove_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
  
    uint32_t xfer = 0;
  
    xfer += oprot->writeStructBegin("TUniquepairService_remove_result");
  
    if (this->__isset.e) {
      xfer += oprot->writeFieldBegin("e", ::apache::thrift::protocol::T_STRUCT, 1);
      xfer += this->e.write(oprot);
      xfer += oprot->writeFieldEnd();
    }
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_remove_presult::~TUniquepairService_remove_presult() noexcept {
  }
  
  
  uint32_t TUniquepairService_remove_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 1:
          if (ftype == ::apache::thrift::protocol::T_STRUCT) {
            xfer += this->e.read(iprot);
            this->__isset.e = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  
  TUniquepairService_find_args::~TUniquepairService_find_args() noexcept {
  }
  
  
  uint32_t TUniquepairService_find_args::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 1:
          if (ftype == ::apache::thrift::protocol::T_STRING) {
            xfer += iprot->readString(this->domain);
            this->__isset.domain = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 2:
          if (ftype == ::apache::thrift::protocol::T_I32) {
            xfer += iprot->readI32(this->first_elem);
            this->__isset.first_elem = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 3:
          if (ftype == ::apache::thrift::protocol::T_I32) {
            xfer += iprot->readI32(this->second_elem);
            this->__isset.second_elem = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t TUniquepairService_find_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_find_args");
  
    xfer += oprot->writeFieldBegin("domain", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->domain);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("first_elem", ::apache::thrift::protocol::T_I32, 2);
    xfer += oprot->writeI32(this->first_elem);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("second_elem", ::apache::thrift::protocol::T_I32, 3);
    xfer += oprot->writeI32(this->second_elem);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_find_pargs::~TUniquepairService_find_pargs() noexcept {
  }
  
  
  uint32_t TUniquepairService_find_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_find_pargs");
  
    xfer += oprot->writeFieldBegin("domain", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString((*(this->domain)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("first_elem", ::apache::thrift::protocol::T_I32, 2);
    xfer += oprot->writeI32((*(this->first_elem)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("second_elem", ::apache::thrift::protocol::T_I32, 3);
    xfer += oprot->writeI32((*(this->second_elem)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_find_result::~TUniquepairService_find_result() noexcept {
  }
  
  
  uint32_t TUniquepairService_find_result::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 0:
          if (ftype == ::apache::thrift::protocol::T_STRUCT) {
            xfer += this->success.read(iprot);
            this->__isset.success = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 1:
          if (ftype == ::apache::thrift::protocol::T_STRUCT) {
            xfer += this->e.read(iprot);
            this->__isset.e = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t TUniquepairService_find_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
  
    uint32_t xfer = 0;
  
    xfer += oprot->writeStructBegin("TUniquepairService_find_result");
  
    if (this->__isset.success) {
      xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0);
      xfer += this->success.write(oprot);
      xfer += oprot->writeFieldEnd();
    } else if (this->__isset.e) {
      xfer += oprot->writeFieldBegin("e", ::apache::thrift::protocol::T_STRUCT, 1);
      xfer += this->e.write(oprot);
      xfer += oprot->writeFieldEnd();
    }
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_find_presult::~TUniquepairService_find_presult() noexcept {
  }
  
  
  uint32_t TUniquepairService_find_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 0:
          if (ftype == ::apache::thrift::protocol::T_STRUCT) {
            xfer += (*(this->success)).read(iprot);
            this->__isset.success = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 1:
          if (ftype == ::apache::thrift::protocol::T_STRUCT) {
            xfer += this->e.read(iprot);
            this->__isset.e = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  
  TUniquepairService_all_args::~TUniquepairService_all_args() noexcept {
  }
  
  
  uint32_t TUniquepairService_all_args::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 1:
          if (ftype == ::apache::thrift::protocol::T_STRING) {
            xfer += iprot->readString(this->domain);
            this->__isset.domain = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t TUniquepairService_all_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_all_args");
  
    xfer += oprot->writeFieldBegin("domain", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->domain);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_all_pargs::~TUniquepairService_all_pargs() noexcept {
  }
  
  
  uint32_t TUniquepairService_all_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_all_pargs");
  
    xfer += oprot->writeFieldBegin("domain", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString((*(this->domain)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_all_result::~TUniquepairService_all_result() noexcept {
  }
  
  
  uint32_t TUniquepairService_all_result::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 0:
          if (ftype == ::apache::thrift::protocol::T_LIST) {
            {
              this->success.clear();
              uint32_t _size85;
              ::apache::thrift::protocol::TType _etype88;
              xfer += iprot->readListBegin(_etype88, _size85);
              this->success.resize(_size85);
              uint32_t _i89;
              for (_i89 = 0; _i89 < _size85; ++_i89)
              {
                xfer += this->success[_i89].read(iprot);
              }
              xfer += iprot->readListEnd();
            }
            this->__isset.success = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t TUniquepairService_all_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
  
    uint32_t xfer = 0;
  
    xfer += oprot->writeStructBegin("TUniquepairService_all_result");
  
    if (this->__isset.success) {
      xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0);
      {
        xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->success.size()));
        std::vector<TUniquepair> ::const_iterator _iter90;
        for (_iter90 = this->success.begin(); _iter90 != this->success.end(); ++_iter90)
        {
          xfer += (*_iter90).write(oprot);
        }
        xfer += oprot->writeListEnd();
      }
      xfer += oprot->writeFieldEnd();
    }
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_all_presult::~TUniquepairService_all_presult() noexcept {
  }
  
  
  uint32_t TUniquepairService_all_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 0:
          if (ftype == ::apache::thrift::protocol::T_LIST) {
            {
              (*(this->success)).clear();
              uint32_t _size91;
              ::apache::thrift::protocol::TType _etype94;
              xfer += iprot->readListBegin(_etype94, _size91);
              (*(this->success)).resize(_size91);
              uint32_t _i95;
              for (_i95 = 0; _i95 < _size91; ++_i95)
              {
                xfer += (*(this->success))[_i95].read(iprot);
              }
              xfer += iprot->readListEnd();
            }
            this->__isset.success = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  
  TUniquepairService_filter_by_first_elem_args::~TUniquepairService_filter_by_first_elem_args() noexcept {
  }
  
  
  uint32_t TUniquepairService_filter_by_first_elem_args::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 1:
          if (ftype == ::apache::thrift::protocol::T_STRING) {
            xfer += iprot->readString(this->domain);
            this->__isset.domain = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 2:
          if (ftype == ::apache::thrift::protocol::T_I32) {
            xfer += iprot->readI32(this->first_elem);
            this->__isset.first_elem = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t TUniquepairService_filter_by_first_elem_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_filter_by_first_elem_args");
  
    xfer += oprot->writeFieldBegin("domain", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->domain);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("first_elem", ::apache::thrift::protocol::T_I32, 2);
    xfer += oprot->writeI32(this->first_elem);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_filter_by_first_elem_pargs::~TUniquepairService_filter_by_first_elem_pargs() noexcept {
  }
  
  
  uint32_t TUniquepairService_filter_by_first_elem_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_filter_by_first_elem_pargs");
  
    xfer += oprot->writeFieldBegin("domain", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString((*(this->domain)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("first_elem", ::apache::thrift::protocol::T_I32, 2);
    xfer += oprot->writeI32((*(this->first_elem)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_filter_by_first_elem_result::~TUniquepairService_filter_by_first_elem_result() noexcept {
  }
  
  
  uint32_t TUniquepairService_filter_by_first_elem_result::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 0:
          if (ftype == ::apache::thrift::protocol::T_LIST) {
            {
              this->success.clear();
              uint32_t _size96;
              ::apache::thrift::protocol::TType _etype99;
              xfer += iprot->readListBegin(_etype99, _size96);
              this->success.resize(_size96);
              uint32_t _i100;
              for (_i100 = 0; _i100 < _size96; ++_i100)
              {
                xfer += this->success[_i100].read(iprot);
              }
              xfer += iprot->readListEnd();
            }
            this->__isset.success = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t TUniquepairService_filter_by_first_elem_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
  
    uint32_t xfer = 0;
  
    xfer += oprot->writeStructBegin("TUniquepairService_filter_by_first_elem_result");
  
    if (this->__isset.success) {
      xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0);
      {
        xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->success.size()));
        std::vector<TUniquepair> ::const_iterator _iter101;
        for (_iter101 = this->success.begin(); _iter101 != this->success.end(); ++_iter101)
        {
          xfer += (*_iter101).write(oprot);
        }
        xfer += oprot->writeListEnd();
      }
      xfer += oprot->writeFieldEnd();
    }
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_filter_by_first_elem_presult::~TUniquepairService_filter_by_first_elem_presult() noexcept {
  }
  
  
  uint32_t TUniquepairService_filter_by_first_elem_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 0:
          if (ftype == ::apache::thrift::protocol::T_LIST) {
            {
              (*(this->success)).clear();
              uint32_t _size102;
              ::apache::thrift::protocol::TType _etype105;
              xfer += iprot->readListBegin(_etype105, _size102);
              (*(this->success)).resize(_size102);
              uint32_t _i106;
              for (_i106 = 0; _i106 < _size102; ++_i106)
              {
                xfer += (*(this->success))[_i106].read(iprot);
              }
              xfer += iprot->readListEnd();
            }
            this->__isset.success = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  
  TUniquepairService_filter_by_second_elem_args::~TUniquepairService_filter_by_second_elem_args() noexcept {
  }
  
  
  uint32_t TUniquepairService_filter_by_second_elem_args::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 1:
          if (ftype == ::apache::thrift::protocol::T_STRING) {
            xfer += iprot->readString(this->domain);
            this->__isset.domain = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 2:
          if (ftype == ::apache::thrift::protocol::T_I32) {
            xfer += iprot->readI32(this->second_elem);
            this->__isset.second_elem = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t TUniquepairService_filter_by_second_elem_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_filter_by_second_elem_args");
  
    xfer += oprot->writeFieldBegin("domain", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->domain);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("second_elem", ::apache::thrift::protocol::T_I32, 2);
    xfer += oprot->writeI32(this->second_elem);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_filter_by_second_elem_pargs::~TUniquepairService_filter_by_second_elem_pargs() noexcept {
  }
  
  
  uint32_t TUniquepairService_filter_by_second_elem_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_filter_by_second_elem_pargs");
  
    xfer += oprot->writeFieldBegin("domain", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString((*(this->domain)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("second_elem", ::apache::thrift::protocol::T_I32, 2);
    xfer += oprot->writeI32((*(this->second_elem)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_filter_by_second_elem_result::~TUniquepairService_filter_by_second_elem_result() noexcept {
  }
  
  
  uint32_t TUniquepairService_filter_by_second_elem_result::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 0:
          if (ftype == ::apache::thrift::protocol::T_LIST) {
            {
              this->success.clear();
              uint32_t _size107;
              ::apache::thrift::protocol::TType _etype110;
              xfer += iprot->readListBegin(_etype110, _size107);
              this->success.resize(_size107);
              uint32_t _i111;
              for (_i111 = 0; _i111 < _size107; ++_i111)
              {
                xfer += this->success[_i111].read(iprot);
              }
              xfer += iprot->readListEnd();
            }
            this->__isset.success = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t TUniquepairService_filter_by_second_elem_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
  
    uint32_t xfer = 0;
  
    xfer += oprot->writeStructBegin("TUniquepairService_filter_by_second_elem_result");
  
    if (this->__isset.success) {
      xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_LIST, 0);
      {
        xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->success.size()));
        std::vector<TUniquepair> ::const_iterator _iter112;
        for (_iter112 = this->success.begin(); _iter112 != this->success.end(); ++_iter112)
        {
          xfer += (*_iter112).write(oprot);
        }
        xfer += oprot->writeListEnd();
      }
      xfer += oprot->writeFieldEnd();
    }
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_filter_by_second_elem_presult::~TUniquepairService_filter_by_second_elem_presult() noexcept {
  }
  
  
  uint32_t TUniquepairService_filter_by_second_elem_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 0:
          if (ftype == ::apache::thrift::protocol::T_LIST) {
            {
              (*(this->success)).clear();
              uint32_t _size113;
              ::apache::thrift::protocol::TType _etype116;
              xfer += iprot->readListBegin(_etype116, _size113);
              (*(this->success)).resize(_size113);
              uint32_t _i117;
              for (_i117 = 0; _i117 < _size113; ++_i117)
              {
                xfer += (*(this->success))[_i117].read(iprot);
              }
              xfer += iprot->readListEnd();
            }
            this->__isset.success = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  
  TUniquepairService_count_first_elem_args::~TUniquepairService_count_first_elem_args() noexcept {
  }
  
  
  uint32_t TUniquepairService_count_first_elem_args::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 1:
          if (ftype == ::apache::thrift::protocol::T_STRING) {
            xfer += iprot->readString(this->domain);
            this->__isset.domain = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 2:
          if (ftype == ::apache::thrift::protocol::T_I32) {
            xfer += iprot->readI32(this->first_elem);
            this->__isset.first_elem = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t TUniquepairService_count_first_elem_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_count_first_elem_args");
  
    xfer += oprot->writeFieldBegin("domain", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->domain);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("first_elem", ::apache::thrift::protocol::T_I32, 2);
    xfer += oprot->writeI32(this->first_elem);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_count_first_elem_pargs::~TUniquepairService_count_first_elem_pargs() noexcept {
  }
  
  
  uint32_t TUniquepairService_count_first_elem_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_count_first_elem_pargs");
  
    xfer += oprot->writeFieldBegin("domain", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString((*(this->domain)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("first_elem", ::apache::thrift::protocol::T_I32, 2);
    xfer += oprot->writeI32((*(this->first_elem)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_count_first_elem_result::~TUniquepairService_count_first_elem_result() noexcept {
  }
  
  
  uint32_t TUniquepairService_count_first_elem_result::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 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 TUniquepairService_count_first_elem_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
  
    uint32_t xfer = 0;
  
    xfer += oprot->writeStructBegin("TUniquepairService_count_first_elem_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;
  }
  
  
  TUniquepairService_count_first_elem_presult::~TUniquepairService_count_first_elem_presult() noexcept {
  }
  
  
  uint32_t TUniquepairService_count_first_elem_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 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;
  }
  
  
  TUniquepairService_count_second_elem_args::~TUniquepairService_count_second_elem_args() noexcept {
  }
  
  
  uint32_t TUniquepairService_count_second_elem_args::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 1:
          if (ftype == ::apache::thrift::protocol::T_STRING) {
            xfer += iprot->readString(this->domain);
            this->__isset.domain = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 2:
          if (ftype == ::apache::thrift::protocol::T_I32) {
            xfer += iprot->readI32(this->second_elem);
            this->__isset.second_elem = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t TUniquepairService_count_second_elem_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_count_second_elem_args");
  
    xfer += oprot->writeFieldBegin("domain", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->domain);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("second_elem", ::apache::thrift::protocol::T_I32, 2);
    xfer += oprot->writeI32(this->second_elem);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_count_second_elem_pargs::~TUniquepairService_count_second_elem_pargs() noexcept {
  }
  
  
  uint32_t TUniquepairService_count_second_elem_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("TUniquepairService_count_second_elem_pargs");
  
    xfer += oprot->writeFieldBegin("domain", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString((*(this->domain)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("second_elem", ::apache::thrift::protocol::T_I32, 2);
    xfer += oprot->writeI32((*(this->second_elem)));
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  
  TUniquepairService_count_second_elem_result::~TUniquepairService_count_second_elem_result() noexcept {
  }
  
  
  uint32_t TUniquepairService_count_second_elem_result::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 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 TUniquepairService_count_second_elem_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
  
    uint32_t xfer = 0;
  
    xfer += oprot->writeStructBegin("TUniquepairService_count_second_elem_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;
  }
  
  
  TUniquepairService_count_second_elem_presult::~TUniquepairService_count_second_elem_presult() noexcept {
  }
  
  
  uint32_t TUniquepairService_count_second_elem_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
  
    ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
    uint32_t xfer = 0;
    std::string fname;
    ::apache::thrift::protocol::TType ftype;
    int16_t fid;
  
    xfer += iprot->readStructBegin(fname);
  
    using ::apache::thrift::protocol::TProtocolException;
  
  
    while (true)
    {
      xfer += iprot->readFieldBegin(fname, ftype, fid);
      if (ftype == ::apache::thrift::protocol::T_STOP) {
        break;
      }
      switch (fid)
      {
        case 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 TUniquepairServiceClient::get(TUniquepair& _return, const int32_t uniquepair_id)
  {
    send_get(uniquepair_id);
    recv_get(_return);
  }
  
  void TUniquepairServiceClient::send_get(const int32_t uniquepair_id)
  {
    int32_t cseqid = 0;
    oprot_->writeMessageBegin("get", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_get_pargs args;
    args.uniquepair_id = &uniquepair_id;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  }
  
  void TUniquepairServiceClient::recv_get(TUniquepair& _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("get") != 0) {
      iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      iprot_->readMessageEnd();
      iprot_->getTransport()->readEnd();
    }
    TUniquepairService_get_presult result;
    result.success = &_return;
    result.read(iprot_);
    iprot_->readMessageEnd();
    iprot_->getTransport()->readEnd();
  
    if (result.__isset.success) {
      // _return pointer has now been filled
      return;
    }
    if (result.__isset.e) {
      throw result.e;
    }
    throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get failed: unknown result");
  }
  
  void TUniquepairServiceClient::add(TUniquepair& _return, const std::string& domain, const int32_t first_elem, const int32_t second_elem)
  {
    send_add(domain, first_elem, second_elem);
    recv_add(_return);
  }
  
  void TUniquepairServiceClient::send_add(const std::string& domain, const int32_t first_elem, const int32_t second_elem)
  {
    int32_t cseqid = 0;
    oprot_->writeMessageBegin("add", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_add_pargs args;
    args.domain = &domain;
    args.first_elem = &first_elem;
    args.second_elem = &second_elem;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  }
  
  void TUniquepairServiceClient::recv_add(TUniquepair& _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("add") != 0) {
      iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      iprot_->readMessageEnd();
      iprot_->getTransport()->readEnd();
    }
    TUniquepairService_add_presult result;
    result.success = &_return;
    result.read(iprot_);
    iprot_->readMessageEnd();
    iprot_->getTransport()->readEnd();
  
    if (result.__isset.success) {
      // _return pointer has now been filled
      return;
    }
    if (result.__isset.e) {
      throw result.e;
    }
    throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add failed: unknown result");
  }
  
  void TUniquepairServiceClient::remove(const int32_t uniquepair_id)
  {
    send_remove(uniquepair_id);
    recv_remove();
  }
  
  void TUniquepairServiceClient::send_remove(const int32_t uniquepair_id)
  {
    int32_t cseqid = 0;
    oprot_->writeMessageBegin("remove", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_remove_pargs args;
    args.uniquepair_id = &uniquepair_id;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  }
  
  void TUniquepairServiceClient::recv_remove()
  {
  
    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("remove") != 0) {
      iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      iprot_->readMessageEnd();
      iprot_->getTransport()->readEnd();
    }
    TUniquepairService_remove_presult result;
    result.read(iprot_);
    iprot_->readMessageEnd();
    iprot_->getTransport()->readEnd();
  
    if (result.__isset.e) {
      throw result.e;
    }
    return;
  }
  
  void TUniquepairServiceClient::find(TUniquepair& _return, const std::string& domain, const int32_t first_elem, const int32_t second_elem)
  {
    send_find(domain, first_elem, second_elem);
    recv_find(_return);
  }
  
  void TUniquepairServiceClient::send_find(const std::string& domain, const int32_t first_elem, const int32_t second_elem)
  {
    int32_t cseqid = 0;
    oprot_->writeMessageBegin("find", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_find_pargs args;
    args.domain = &domain;
    args.first_elem = &first_elem;
    args.second_elem = &second_elem;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  }
  
  void TUniquepairServiceClient::recv_find(TUniquepair& _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("find") != 0) {
      iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      iprot_->readMessageEnd();
      iprot_->getTransport()->readEnd();
    }
    TUniquepairService_find_presult result;
    result.success = &_return;
    result.read(iprot_);
    iprot_->readMessageEnd();
    iprot_->getTransport()->readEnd();
  
    if (result.__isset.success) {
      // _return pointer has now been filled
      return;
    }
    if (result.__isset.e) {
      throw result.e;
    }
    throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "find failed: unknown result");
  }
  
  void TUniquepairServiceClient::all(std::vector<TUniquepair> & _return, const std::string& domain)
  {
    send_all(domain);
    recv_all(_return);
  }
  
  void TUniquepairServiceClient::send_all(const std::string& domain)
  {
    int32_t cseqid = 0;
    oprot_->writeMessageBegin("all", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_all_pargs args;
    args.domain = &domain;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  }
  
  void TUniquepairServiceClient::recv_all(std::vector<TUniquepair> & _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("all") != 0) {
      iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      iprot_->readMessageEnd();
      iprot_->getTransport()->readEnd();
    }
    TUniquepairService_all_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, "all failed: unknown result");
  }
  
  void TUniquepairServiceClient::filter_by_first_elem(std::vector<TUniquepair> & _return, const std::string& domain, const int32_t first_elem)
  {
    send_filter_by_first_elem(domain, first_elem);
    recv_filter_by_first_elem(_return);
  }
  
  void TUniquepairServiceClient::send_filter_by_first_elem(const std::string& domain, const int32_t first_elem)
  {
    int32_t cseqid = 0;
    oprot_->writeMessageBegin("filter_by_first_elem", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_filter_by_first_elem_pargs args;
    args.domain = &domain;
    args.first_elem = &first_elem;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  }
  
  void TUniquepairServiceClient::recv_filter_by_first_elem(std::vector<TUniquepair> & _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("filter_by_first_elem") != 0) {
      iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      iprot_->readMessageEnd();
      iprot_->getTransport()->readEnd();
    }
    TUniquepairService_filter_by_first_elem_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, "filter_by_first_elem failed: unknown result");
  }
  
  void TUniquepairServiceClient::filter_by_second_elem(std::vector<TUniquepair> & _return, const std::string& domain, const int32_t second_elem)
  {
    send_filter_by_second_elem(domain, second_elem);
    recv_filter_by_second_elem(_return);
  }
  
  void TUniquepairServiceClient::send_filter_by_second_elem(const std::string& domain, const int32_t second_elem)
  {
    int32_t cseqid = 0;
    oprot_->writeMessageBegin("filter_by_second_elem", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_filter_by_second_elem_pargs args;
    args.domain = &domain;
    args.second_elem = &second_elem;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  }
  
  void TUniquepairServiceClient::recv_filter_by_second_elem(std::vector<TUniquepair> & _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("filter_by_second_elem") != 0) {
      iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      iprot_->readMessageEnd();
      iprot_->getTransport()->readEnd();
    }
    TUniquepairService_filter_by_second_elem_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, "filter_by_second_elem failed: unknown result");
  }
  
  int32_t TUniquepairServiceClient::count_first_elem(const std::string& domain, const int32_t first_elem)
  {
    send_count_first_elem(domain, first_elem);
    return recv_count_first_elem();
  }
  
  void TUniquepairServiceClient::send_count_first_elem(const std::string& domain, const int32_t first_elem)
  {
    int32_t cseqid = 0;
    oprot_->writeMessageBegin("count_first_elem", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_count_first_elem_pargs args;
    args.domain = &domain;
    args.first_elem = &first_elem;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  }
  
  int32_t TUniquepairServiceClient::recv_count_first_elem()
  {
  
    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("count_first_elem") != 0) {
      iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      iprot_->readMessageEnd();
      iprot_->getTransport()->readEnd();
    }
    int32_t _return;
    TUniquepairService_count_first_elem_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, "count_first_elem failed: unknown result");
  }
  
  int32_t TUniquepairServiceClient::count_second_elem(const std::string& domain, const int32_t second_elem)
  {
    send_count_second_elem(domain, second_elem);
    return recv_count_second_elem();
  }
  
  void TUniquepairServiceClient::send_count_second_elem(const std::string& domain, const int32_t second_elem)
  {
    int32_t cseqid = 0;
    oprot_->writeMessageBegin("count_second_elem", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_count_second_elem_pargs args;
    args.domain = &domain;
    args.second_elem = &second_elem;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  }
  
  int32_t TUniquepairServiceClient::recv_count_second_elem()
  {
  
    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("count_second_elem") != 0) {
      iprot_->skip(::apache::thrift::protocol::T_STRUCT);
      iprot_->readMessageEnd();
      iprot_->getTransport()->readEnd();
    }
    int32_t _return;
    TUniquepairService_count_second_elem_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, "count_second_elem failed: unknown result");
  }
  
  bool TUniquepairServiceProcessor::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 TUniquepairServiceProcessor::process_get(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("TUniquepairService.get", callContext);
    }
    ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TUniquepairService.get");
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "TUniquepairService.get");
    }
  
    TUniquepairService_get_args args;
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "TUniquepairService.get", bytes);
    }
  
    TUniquepairService_get_result result;
    try {
      iface_->get(result.success, args.uniquepair_id);
      result.__isset.success = true;
    } catch (TUniquepairNotFoundException &e) {
      result.e = e;
      result.__isset.e = true;
    } catch (const std::exception& e) {
      if (this->eventHandler_.get() != NULL) {
        this->eventHandler_->handlerError(ctx, "TUniquepairService.get");
      }
  
      ::apache::thrift::TApplicationException x(e.what());
      oprot->writeMessageBegin("get", ::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, "TUniquepairService.get");
    }
  
    oprot->writeMessageBegin("get", ::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, "TUniquepairService.get", bytes);
    }
  }
  
  void TUniquepairServiceProcessor::process_add(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("TUniquepairService.add", callContext);
    }
    ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TUniquepairService.add");
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "TUniquepairService.add");
    }
  
    TUniquepairService_add_args args;
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "TUniquepairService.add", bytes);
    }
  
    TUniquepairService_add_result result;
    try {
      iface_->add(result.success, args.domain, args.first_elem, args.second_elem);
      result.__isset.success = true;
    } catch (TUniquepairAlreadyExistsException &e) {
      result.e = e;
      result.__isset.e = true;
    } catch (const std::exception& e) {
      if (this->eventHandler_.get() != NULL) {
        this->eventHandler_->handlerError(ctx, "TUniquepairService.add");
      }
  
      ::apache::thrift::TApplicationException x(e.what());
      oprot->writeMessageBegin("add", ::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, "TUniquepairService.add");
    }
  
    oprot->writeMessageBegin("add", ::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, "TUniquepairService.add", bytes);
    }
  }
  
  void TUniquepairServiceProcessor::process_remove(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("TUniquepairService.remove", callContext);
    }
    ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TUniquepairService.remove");
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "TUniquepairService.remove");
    }
  
    TUniquepairService_remove_args args;
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "TUniquepairService.remove", bytes);
    }
  
    TUniquepairService_remove_result result;
    try {
      iface_->remove(args.uniquepair_id);
    } catch (TUniquepairNotFoundException &e) {
      result.e = e;
      result.__isset.e = true;
    } catch (const std::exception& e) {
      if (this->eventHandler_.get() != NULL) {
        this->eventHandler_->handlerError(ctx, "TUniquepairService.remove");
      }
  
      ::apache::thrift::TApplicationException x(e.what());
      oprot->writeMessageBegin("remove", ::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, "TUniquepairService.remove");
    }
  
    oprot->writeMessageBegin("remove", ::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, "TUniquepairService.remove", bytes);
    }
  }
  
  void TUniquepairServiceProcessor::process_find(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("TUniquepairService.find", callContext);
    }
    ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TUniquepairService.find");
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "TUniquepairService.find");
    }
  
    TUniquepairService_find_args args;
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "TUniquepairService.find", bytes);
    }
  
    TUniquepairService_find_result result;
    try {
      iface_->find(result.success, args.domain, args.first_elem, args.second_elem);
      result.__isset.success = true;
    } catch (TUniquepairNotFoundException &e) {
      result.e = e;
      result.__isset.e = true;
    } catch (const std::exception& e) {
      if (this->eventHandler_.get() != NULL) {
        this->eventHandler_->handlerError(ctx, "TUniquepairService.find");
      }
  
      ::apache::thrift::TApplicationException x(e.what());
      oprot->writeMessageBegin("find", ::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, "TUniquepairService.find");
    }
  
    oprot->writeMessageBegin("find", ::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, "TUniquepairService.find", bytes);
    }
  }
  
  void TUniquepairServiceProcessor::process_all(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("TUniquepairService.all", callContext);
    }
    ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TUniquepairService.all");
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "TUniquepairService.all");
    }
  
    TUniquepairService_all_args args;
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "TUniquepairService.all", bytes);
    }
  
    TUniquepairService_all_result result;
    try {
      iface_->all(result.success, args.domain);
      result.__isset.success = true;
    } catch (const std::exception& e) {
      if (this->eventHandler_.get() != NULL) {
        this->eventHandler_->handlerError(ctx, "TUniquepairService.all");
      }
  
      ::apache::thrift::TApplicationException x(e.what());
      oprot->writeMessageBegin("all", ::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, "TUniquepairService.all");
    }
  
    oprot->writeMessageBegin("all", ::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, "TUniquepairService.all", bytes);
    }
  }
  
  void TUniquepairServiceProcessor::process_filter_by_first_elem(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("TUniquepairService.filter_by_first_elem", callContext);
    }
    ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TUniquepairService.filter_by_first_elem");
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "TUniquepairService.filter_by_first_elem");
    }
  
    TUniquepairService_filter_by_first_elem_args args;
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "TUniquepairService.filter_by_first_elem", bytes);
    }
  
    TUniquepairService_filter_by_first_elem_result result;
    try {
      iface_->filter_by_first_elem(result.success, args.domain, args.first_elem);
      result.__isset.success = true;
    } catch (const std::exception& e) {
      if (this->eventHandler_.get() != NULL) {
        this->eventHandler_->handlerError(ctx, "TUniquepairService.filter_by_first_elem");
      }
  
      ::apache::thrift::TApplicationException x(e.what());
      oprot->writeMessageBegin("filter_by_first_elem", ::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, "TUniquepairService.filter_by_first_elem");
    }
  
    oprot->writeMessageBegin("filter_by_first_elem", ::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, "TUniquepairService.filter_by_first_elem", bytes);
    }
  }
  
  void TUniquepairServiceProcessor::process_filter_by_second_elem(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("TUniquepairService.filter_by_second_elem", callContext);
    }
    ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TUniquepairService.filter_by_second_elem");
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "TUniquepairService.filter_by_second_elem");
    }
  
    TUniquepairService_filter_by_second_elem_args args;
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "TUniquepairService.filter_by_second_elem", bytes);
    }
  
    TUniquepairService_filter_by_second_elem_result result;
    try {
      iface_->filter_by_second_elem(result.success, args.domain, args.second_elem);
      result.__isset.success = true;
    } catch (const std::exception& e) {
      if (this->eventHandler_.get() != NULL) {
        this->eventHandler_->handlerError(ctx, "TUniquepairService.filter_by_second_elem");
      }
  
      ::apache::thrift::TApplicationException x(e.what());
      oprot->writeMessageBegin("filter_by_second_elem", ::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, "TUniquepairService.filter_by_second_elem");
    }
  
    oprot->writeMessageBegin("filter_by_second_elem", ::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, "TUniquepairService.filter_by_second_elem", bytes);
    }
  }
  
  void TUniquepairServiceProcessor::process_count_first_elem(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("TUniquepairService.count_first_elem", callContext);
    }
    ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TUniquepairService.count_first_elem");
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "TUniquepairService.count_first_elem");
    }
  
    TUniquepairService_count_first_elem_args args;
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "TUniquepairService.count_first_elem", bytes);
    }
  
    TUniquepairService_count_first_elem_result result;
    try {
      result.success = iface_->count_first_elem(args.domain, args.first_elem);
      result.__isset.success = true;
    } catch (const std::exception& e) {
      if (this->eventHandler_.get() != NULL) {
        this->eventHandler_->handlerError(ctx, "TUniquepairService.count_first_elem");
      }
  
      ::apache::thrift::TApplicationException x(e.what());
      oprot->writeMessageBegin("count_first_elem", ::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, "TUniquepairService.count_first_elem");
    }
  
    oprot->writeMessageBegin("count_first_elem", ::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, "TUniquepairService.count_first_elem", bytes);
    }
  }
  
  void TUniquepairServiceProcessor::process_count_second_elem(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("TUniquepairService.count_second_elem", callContext);
    }
    ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TUniquepairService.count_second_elem");
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->preRead(ctx, "TUniquepairService.count_second_elem");
    }
  
    TUniquepairService_count_second_elem_args args;
    args.read(iprot);
    iprot->readMessageEnd();
    uint32_t bytes = iprot->getTransport()->readEnd();
  
    if (this->eventHandler_.get() != NULL) {
      this->eventHandler_->postRead(ctx, "TUniquepairService.count_second_elem", bytes);
    }
  
    TUniquepairService_count_second_elem_result result;
    try {
      result.success = iface_->count_second_elem(args.domain, args.second_elem);
      result.__isset.success = true;
    } catch (const std::exception& e) {
      if (this->eventHandler_.get() != NULL) {
        this->eventHandler_->handlerError(ctx, "TUniquepairService.count_second_elem");
      }
  
      ::apache::thrift::TApplicationException x(e.what());
      oprot->writeMessageBegin("count_second_elem", ::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, "TUniquepairService.count_second_elem");
    }
  
    oprot->writeMessageBegin("count_second_elem", ::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, "TUniquepairService.count_second_elem", bytes);
    }
  }
  
  ::std::shared_ptr< ::apache::thrift::TProcessor > TUniquepairServiceProcessorFactory::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) {
    ::apache::thrift::ReleaseHandler< TUniquepairServiceIfFactory > cleanup(handlerFactory_);
    ::std::shared_ptr< TUniquepairServiceIf > handler(handlerFactory_->getHandler(connInfo), cleanup);
    ::std::shared_ptr< ::apache::thrift::TProcessor > processor(new TUniquepairServiceProcessor(handler));
    return processor;
  }
  
  void TUniquepairServiceConcurrentClient::get(TUniquepair& _return, const int32_t uniquepair_id)
  {
    int32_t seqid = send_get(uniquepair_id);
    recv_get(_return, seqid);
  }
  
  int32_t TUniquepairServiceConcurrentClient::send_get(const int32_t uniquepair_id)
  {
    int32_t cseqid = this->sync_->generateSeqId();
    ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
    oprot_->writeMessageBegin("get", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_get_pargs args;
    args.uniquepair_id = &uniquepair_id;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  
    sentry.commit();
    return cseqid;
  }
  
  void TUniquepairServiceConcurrentClient::recv_get(TUniquepair& _return, const int32_t seqid)
  {
  
    int32_t rseqid = 0;
    std::string fname;
    ::apache::thrift::protocol::TMessageType mtype;
  
    // the read mutex gets dropped and reacquired as part of waitForWork()
    // The destructor of this sentry wakes up other clients
    ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);
  
    while(true) {
      if(!this->sync_->getPending(fname, mtype, rseqid)) {
        iprot_->readMessageBegin(fname, mtype, rseqid);
      }
      if(seqid == rseqid) {
        if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
          ::apache::thrift::TApplicationException x;
          x.read(iprot_);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
          sentry.commit();
          throw x;
        }
        if (mtype != ::apache::thrift::protocol::T_REPLY) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
        }
        if (fname.compare("get") != 0) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
  
          // in a bad state, don't commit
          using ::apache::thrift::protocol::TProtocolException;
          throw TProtocolException(TProtocolException::INVALID_DATA);
        }
        TUniquepairService_get_presult result;
        result.success = &_return;
        result.read(iprot_);
        iprot_->readMessageEnd();
        iprot_->getTransport()->readEnd();
  
        if (result.__isset.success) {
          // _return pointer has now been filled
          sentry.commit();
          return;
        }
        if (result.__isset.e) {
          sentry.commit();
          throw result.e;
        }
        // in a bad state, don't commit
        throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "get failed: unknown result");
      }
      // seqid != rseqid
      this->sync_->updatePending(fname, mtype, rseqid);
  
      // this will temporarily unlock the readMutex, and let other clients get work done
      this->sync_->waitForWork(seqid);
    } // end while(true)
  }
  
  void TUniquepairServiceConcurrentClient::add(TUniquepair& _return, const std::string& domain, const int32_t first_elem, const int32_t second_elem)
  {
    int32_t seqid = send_add(domain, first_elem, second_elem);
    recv_add(_return, seqid);
  }
  
  int32_t TUniquepairServiceConcurrentClient::send_add(const std::string& domain, const int32_t first_elem, const int32_t second_elem)
  {
    int32_t cseqid = this->sync_->generateSeqId();
    ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
    oprot_->writeMessageBegin("add", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_add_pargs args;
    args.domain = &domain;
    args.first_elem = &first_elem;
    args.second_elem = &second_elem;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  
    sentry.commit();
    return cseqid;
  }
  
  void TUniquepairServiceConcurrentClient::recv_add(TUniquepair& _return, const int32_t seqid)
  {
  
    int32_t rseqid = 0;
    std::string fname;
    ::apache::thrift::protocol::TMessageType mtype;
  
    // the read mutex gets dropped and reacquired as part of waitForWork()
    // The destructor of this sentry wakes up other clients
    ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);
  
    while(true) {
      if(!this->sync_->getPending(fname, mtype, rseqid)) {
        iprot_->readMessageBegin(fname, mtype, rseqid);
      }
      if(seqid == rseqid) {
        if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
          ::apache::thrift::TApplicationException x;
          x.read(iprot_);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
          sentry.commit();
          throw x;
        }
        if (mtype != ::apache::thrift::protocol::T_REPLY) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
        }
        if (fname.compare("add") != 0) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
  
          // in a bad state, don't commit
          using ::apache::thrift::protocol::TProtocolException;
          throw TProtocolException(TProtocolException::INVALID_DATA);
        }
        TUniquepairService_add_presult result;
        result.success = &_return;
        result.read(iprot_);
        iprot_->readMessageEnd();
        iprot_->getTransport()->readEnd();
  
        if (result.__isset.success) {
          // _return pointer has now been filled
          sentry.commit();
          return;
        }
        if (result.__isset.e) {
          sentry.commit();
          throw result.e;
        }
        // in a bad state, don't commit
        throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "add failed: unknown result");
      }
      // seqid != rseqid
      this->sync_->updatePending(fname, mtype, rseqid);
  
      // this will temporarily unlock the readMutex, and let other clients get work done
      this->sync_->waitForWork(seqid);
    } // end while(true)
  }
  
  void TUniquepairServiceConcurrentClient::remove(const int32_t uniquepair_id)
  {
    int32_t seqid = send_remove(uniquepair_id);
    recv_remove(seqid);
  }
  
  int32_t TUniquepairServiceConcurrentClient::send_remove(const int32_t uniquepair_id)
  {
    int32_t cseqid = this->sync_->generateSeqId();
    ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
    oprot_->writeMessageBegin("remove", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_remove_pargs args;
    args.uniquepair_id = &uniquepair_id;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  
    sentry.commit();
    return cseqid;
  }
  
  void TUniquepairServiceConcurrentClient::recv_remove(const int32_t seqid)
  {
  
    int32_t rseqid = 0;
    std::string fname;
    ::apache::thrift::protocol::TMessageType mtype;
  
    // the read mutex gets dropped and reacquired as part of waitForWork()
    // The destructor of this sentry wakes up other clients
    ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);
  
    while(true) {
      if(!this->sync_->getPending(fname, mtype, rseqid)) {
        iprot_->readMessageBegin(fname, mtype, rseqid);
      }
      if(seqid == rseqid) {
        if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
          ::apache::thrift::TApplicationException x;
          x.read(iprot_);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
          sentry.commit();
          throw x;
        }
        if (mtype != ::apache::thrift::protocol::T_REPLY) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
        }
        if (fname.compare("remove") != 0) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
  
          // in a bad state, don't commit
          using ::apache::thrift::protocol::TProtocolException;
          throw TProtocolException(TProtocolException::INVALID_DATA);
        }
        TUniquepairService_remove_presult result;
        result.read(iprot_);
        iprot_->readMessageEnd();
        iprot_->getTransport()->readEnd();
  
        if (result.__isset.e) {
          sentry.commit();
          throw result.e;
        }
        sentry.commit();
        return;
      }
      // seqid != rseqid
      this->sync_->updatePending(fname, mtype, rseqid);
  
      // this will temporarily unlock the readMutex, and let other clients get work done
      this->sync_->waitForWork(seqid);
    } // end while(true)
  }
  
  void TUniquepairServiceConcurrentClient::find(TUniquepair& _return, const std::string& domain, const int32_t first_elem, const int32_t second_elem)
  {
    int32_t seqid = send_find(domain, first_elem, second_elem);
    recv_find(_return, seqid);
  }
  
  int32_t TUniquepairServiceConcurrentClient::send_find(const std::string& domain, const int32_t first_elem, const int32_t second_elem)
  {
    int32_t cseqid = this->sync_->generateSeqId();
    ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
    oprot_->writeMessageBegin("find", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_find_pargs args;
    args.domain = &domain;
    args.first_elem = &first_elem;
    args.second_elem = &second_elem;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  
    sentry.commit();
    return cseqid;
  }
  
  void TUniquepairServiceConcurrentClient::recv_find(TUniquepair& _return, const int32_t seqid)
  {
  
    int32_t rseqid = 0;
    std::string fname;
    ::apache::thrift::protocol::TMessageType mtype;
  
    // the read mutex gets dropped and reacquired as part of waitForWork()
    // The destructor of this sentry wakes up other clients
    ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);
  
    while(true) {
      if(!this->sync_->getPending(fname, mtype, rseqid)) {
        iprot_->readMessageBegin(fname, mtype, rseqid);
      }
      if(seqid == rseqid) {
        if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
          ::apache::thrift::TApplicationException x;
          x.read(iprot_);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
          sentry.commit();
          throw x;
        }
        if (mtype != ::apache::thrift::protocol::T_REPLY) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
        }
        if (fname.compare("find") != 0) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
  
          // in a bad state, don't commit
          using ::apache::thrift::protocol::TProtocolException;
          throw TProtocolException(TProtocolException::INVALID_DATA);
        }
        TUniquepairService_find_presult result;
        result.success = &_return;
        result.read(iprot_);
        iprot_->readMessageEnd();
        iprot_->getTransport()->readEnd();
  
        if (result.__isset.success) {
          // _return pointer has now been filled
          sentry.commit();
          return;
        }
        if (result.__isset.e) {
          sentry.commit();
          throw result.e;
        }
        // in a bad state, don't commit
        throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "find failed: unknown result");
      }
      // seqid != rseqid
      this->sync_->updatePending(fname, mtype, rseqid);
  
      // this will temporarily unlock the readMutex, and let other clients get work done
      this->sync_->waitForWork(seqid);
    } // end while(true)
  }
  
  void TUniquepairServiceConcurrentClient::all(std::vector<TUniquepair> & _return, const std::string& domain)
  {
    int32_t seqid = send_all(domain);
    recv_all(_return, seqid);
  }
  
  int32_t TUniquepairServiceConcurrentClient::send_all(const std::string& domain)
  {
    int32_t cseqid = this->sync_->generateSeqId();
    ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
    oprot_->writeMessageBegin("all", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_all_pargs args;
    args.domain = &domain;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  
    sentry.commit();
    return cseqid;
  }
  
  void TUniquepairServiceConcurrentClient::recv_all(std::vector<TUniquepair> & _return, const int32_t seqid)
  {
  
    int32_t rseqid = 0;
    std::string fname;
    ::apache::thrift::protocol::TMessageType mtype;
  
    // the read mutex gets dropped and reacquired as part of waitForWork()
    // The destructor of this sentry wakes up other clients
    ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);
  
    while(true) {
      if(!this->sync_->getPending(fname, mtype, rseqid)) {
        iprot_->readMessageBegin(fname, mtype, rseqid);
      }
      if(seqid == rseqid) {
        if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
          ::apache::thrift::TApplicationException x;
          x.read(iprot_);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
          sentry.commit();
          throw x;
        }
        if (mtype != ::apache::thrift::protocol::T_REPLY) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
        }
        if (fname.compare("all") != 0) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
  
          // in a bad state, don't commit
          using ::apache::thrift::protocol::TProtocolException;
          throw TProtocolException(TProtocolException::INVALID_DATA);
        }
        TUniquepairService_all_presult result;
        result.success = &_return;
        result.read(iprot_);
        iprot_->readMessageEnd();
        iprot_->getTransport()->readEnd();
  
        if (result.__isset.success) {
          // _return pointer has now been filled
          sentry.commit();
          return;
        }
        // in a bad state, don't commit
        throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "all failed: unknown result");
      }
      // seqid != rseqid
      this->sync_->updatePending(fname, mtype, rseqid);
  
      // this will temporarily unlock the readMutex, and let other clients get work done
      this->sync_->waitForWork(seqid);
    } // end while(true)
  }
  
  void TUniquepairServiceConcurrentClient::filter_by_first_elem(std::vector<TUniquepair> & _return, const std::string& domain, const int32_t first_elem)
  {
    int32_t seqid = send_filter_by_first_elem(domain, first_elem);
    recv_filter_by_first_elem(_return, seqid);
  }
  
  int32_t TUniquepairServiceConcurrentClient::send_filter_by_first_elem(const std::string& domain, const int32_t first_elem)
  {
    int32_t cseqid = this->sync_->generateSeqId();
    ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
    oprot_->writeMessageBegin("filter_by_first_elem", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_filter_by_first_elem_pargs args;
    args.domain = &domain;
    args.first_elem = &first_elem;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  
    sentry.commit();
    return cseqid;
  }
  
  void TUniquepairServiceConcurrentClient::recv_filter_by_first_elem(std::vector<TUniquepair> & _return, const int32_t seqid)
  {
  
    int32_t rseqid = 0;
    std::string fname;
    ::apache::thrift::protocol::TMessageType mtype;
  
    // the read mutex gets dropped and reacquired as part of waitForWork()
    // The destructor of this sentry wakes up other clients
    ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);
  
    while(true) {
      if(!this->sync_->getPending(fname, mtype, rseqid)) {
        iprot_->readMessageBegin(fname, mtype, rseqid);
      }
      if(seqid == rseqid) {
        if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
          ::apache::thrift::TApplicationException x;
          x.read(iprot_);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
          sentry.commit();
          throw x;
        }
        if (mtype != ::apache::thrift::protocol::T_REPLY) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
        }
        if (fname.compare("filter_by_first_elem") != 0) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
  
          // in a bad state, don't commit
          using ::apache::thrift::protocol::TProtocolException;
          throw TProtocolException(TProtocolException::INVALID_DATA);
        }
        TUniquepairService_filter_by_first_elem_presult result;
        result.success = &_return;
        result.read(iprot_);
        iprot_->readMessageEnd();
        iprot_->getTransport()->readEnd();
  
        if (result.__isset.success) {
          // _return pointer has now been filled
          sentry.commit();
          return;
        }
        // in a bad state, don't commit
        throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "filter_by_first_elem failed: unknown result");
      }
      // seqid != rseqid
      this->sync_->updatePending(fname, mtype, rseqid);
  
      // this will temporarily unlock the readMutex, and let other clients get work done
      this->sync_->waitForWork(seqid);
    } // end while(true)
  }
  
  void TUniquepairServiceConcurrentClient::filter_by_second_elem(std::vector<TUniquepair> & _return, const std::string& domain, const int32_t second_elem)
  {
    int32_t seqid = send_filter_by_second_elem(domain, second_elem);
    recv_filter_by_second_elem(_return, seqid);
  }
  
  int32_t TUniquepairServiceConcurrentClient::send_filter_by_second_elem(const std::string& domain, const int32_t second_elem)
  {
    int32_t cseqid = this->sync_->generateSeqId();
    ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
    oprot_->writeMessageBegin("filter_by_second_elem", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_filter_by_second_elem_pargs args;
    args.domain = &domain;
    args.second_elem = &second_elem;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  
    sentry.commit();
    return cseqid;
  }
  
  void TUniquepairServiceConcurrentClient::recv_filter_by_second_elem(std::vector<TUniquepair> & _return, const int32_t seqid)
  {
  
    int32_t rseqid = 0;
    std::string fname;
    ::apache::thrift::protocol::TMessageType mtype;
  
    // the read mutex gets dropped and reacquired as part of waitForWork()
    // The destructor of this sentry wakes up other clients
    ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);
  
    while(true) {
      if(!this->sync_->getPending(fname, mtype, rseqid)) {
        iprot_->readMessageBegin(fname, mtype, rseqid);
      }
      if(seqid == rseqid) {
        if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
          ::apache::thrift::TApplicationException x;
          x.read(iprot_);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
          sentry.commit();
          throw x;
        }
        if (mtype != ::apache::thrift::protocol::T_REPLY) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
        }
        if (fname.compare("filter_by_second_elem") != 0) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
  
          // in a bad state, don't commit
          using ::apache::thrift::protocol::TProtocolException;
          throw TProtocolException(TProtocolException::INVALID_DATA);
        }
        TUniquepairService_filter_by_second_elem_presult result;
        result.success = &_return;
        result.read(iprot_);
        iprot_->readMessageEnd();
        iprot_->getTransport()->readEnd();
  
        if (result.__isset.success) {
          // _return pointer has now been filled
          sentry.commit();
          return;
        }
        // in a bad state, don't commit
        throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "filter_by_second_elem failed: unknown result");
      }
      // seqid != rseqid
      this->sync_->updatePending(fname, mtype, rseqid);
  
      // this will temporarily unlock the readMutex, and let other clients get work done
      this->sync_->waitForWork(seqid);
    } // end while(true)
  }
  
  int32_t TUniquepairServiceConcurrentClient::count_first_elem(const std::string& domain, const int32_t first_elem)
  {
    int32_t seqid = send_count_first_elem(domain, first_elem);
    return recv_count_first_elem(seqid);
  }
  
  int32_t TUniquepairServiceConcurrentClient::send_count_first_elem(const std::string& domain, const int32_t first_elem)
  {
    int32_t cseqid = this->sync_->generateSeqId();
    ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
    oprot_->writeMessageBegin("count_first_elem", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_count_first_elem_pargs args;
    args.domain = &domain;
    args.first_elem = &first_elem;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  
    sentry.commit();
    return cseqid;
  }
  
  int32_t TUniquepairServiceConcurrentClient::recv_count_first_elem(const int32_t seqid)
  {
  
    int32_t rseqid = 0;
    std::string fname;
    ::apache::thrift::protocol::TMessageType mtype;
  
    // the read mutex gets dropped and reacquired as part of waitForWork()
    // The destructor of this sentry wakes up other clients
    ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);
  
    while(true) {
      if(!this->sync_->getPending(fname, mtype, rseqid)) {
        iprot_->readMessageBegin(fname, mtype, rseqid);
      }
      if(seqid == rseqid) {
        if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
          ::apache::thrift::TApplicationException x;
          x.read(iprot_);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
          sentry.commit();
          throw x;
        }
        if (mtype != ::apache::thrift::protocol::T_REPLY) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
        }
        if (fname.compare("count_first_elem") != 0) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
  
          // in a bad state, don't commit
          using ::apache::thrift::protocol::TProtocolException;
          throw TProtocolException(TProtocolException::INVALID_DATA);
        }
        int32_t _return;
        TUniquepairService_count_first_elem_presult result;
        result.success = &_return;
        result.read(iprot_);
        iprot_->readMessageEnd();
        iprot_->getTransport()->readEnd();
  
        if (result.__isset.success) {
          sentry.commit();
          return _return;
        }
        // in a bad state, don't commit
        throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "count_first_elem failed: unknown result");
      }
      // seqid != rseqid
      this->sync_->updatePending(fname, mtype, rseqid);
  
      // this will temporarily unlock the readMutex, and let other clients get work done
      this->sync_->waitForWork(seqid);
    } // end while(true)
  }
  
  int32_t TUniquepairServiceConcurrentClient::count_second_elem(const std::string& domain, const int32_t second_elem)
  {
    int32_t seqid = send_count_second_elem(domain, second_elem);
    return recv_count_second_elem(seqid);
  }
  
  int32_t TUniquepairServiceConcurrentClient::send_count_second_elem(const std::string& domain, const int32_t second_elem)
  {
    int32_t cseqid = this->sync_->generateSeqId();
    ::apache::thrift::async::TConcurrentSendSentry sentry(this->sync_.get());
    oprot_->writeMessageBegin("count_second_elem", ::apache::thrift::protocol::T_CALL, cseqid);
  
    TUniquepairService_count_second_elem_pargs args;
    args.domain = &domain;
    args.second_elem = &second_elem;
    args.write(oprot_);
  
    oprot_->writeMessageEnd();
    oprot_->getTransport()->writeEnd();
    oprot_->getTransport()->flush();
  
    sentry.commit();
    return cseqid;
  }
  
  int32_t TUniquepairServiceConcurrentClient::recv_count_second_elem(const int32_t seqid)
  {
  
    int32_t rseqid = 0;
    std::string fname;
    ::apache::thrift::protocol::TMessageType mtype;
  
    // the read mutex gets dropped and reacquired as part of waitForWork()
    // The destructor of this sentry wakes up other clients
    ::apache::thrift::async::TConcurrentRecvSentry sentry(this->sync_.get(), seqid);
  
    while(true) {
      if(!this->sync_->getPending(fname, mtype, rseqid)) {
        iprot_->readMessageBegin(fname, mtype, rseqid);
      }
      if(seqid == rseqid) {
        if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
          ::apache::thrift::TApplicationException x;
          x.read(iprot_);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
          sentry.commit();
          throw x;
        }
        if (mtype != ::apache::thrift::protocol::T_REPLY) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
        }
        if (fname.compare("count_second_elem") != 0) {
          iprot_->skip(::apache::thrift::protocol::T_STRUCT);
          iprot_->readMessageEnd();
          iprot_->getTransport()->readEnd();
  
          // in a bad state, don't commit
          using ::apache::thrift::protocol::TProtocolException;
          throw TProtocolException(TProtocolException::INVALID_DATA);
        }
        int32_t _return;
        TUniquepairService_count_second_elem_presult result;
        result.success = &_return;
        result.read(iprot_);
        iprot_->readMessageEnd();
        iprot_->getTransport()->readEnd();
  
        if (result.__isset.success) {
          sentry.commit();
          return _return;
        }
        // in a bad state, don't commit
        throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "count_second_elem failed: unknown result");
      }
      // seqid != rseqid
      this->sync_->updatePending(fname, mtype, rseqid);
  
      // this will temporarily unlock the readMutex, and let other clients get work done
      this->sync_->waitForWork(seqid);
    } // end while(true)
  }
  
  } // namespace
  
  