text: /**
   * Autogenerated by Thrift Compiler (0.11.0)
   *
   * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
   *  @generated
   */
  #include "protocol_types.h"
  
  #include <algorithm>
  #include <ostream>
  
  #include <thrift/TToString.h>
  
  namespace similarity {
  
  
  ReplyEntry::~ReplyEntry() throw() {
  }
  
  
  void ReplyEntry::__set_id(const int32_t val) {
    this->id = val;
  }
  
  void ReplyEntry::__set_dist(const double val) {
    this->dist = val;
  }
  
  void ReplyEntry::__set_externId(const std::string& val) {
    this->externId = val;
  __isset.externId = true;
  }
  
  void ReplyEntry::__set_obj(const std::string& val) {
    this->obj = val;
  __isset.obj = true;
  }
  std::ostream& operator<<(std::ostream& out, const ReplyEntry& obj)
  {
    obj.printTo(out);
    return out;
  }
  
  
  uint32_t ReplyEntry::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;
  
    bool isset_id = false;
    bool isset_dist = false;
  
    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->id);
            isset_id = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 2:
          if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
            xfer += iprot->readDouble(this->dist);
            isset_dist = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 3:
          if (ftype == ::apache::thrift::protocol::T_STRING) {
            xfer += iprot->readString(this->externId);
            this->__isset.externId = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        case 4:
          if (ftype == ::apache::thrift::protocol::T_STRING) {
            xfer += iprot->readBinary(this->obj);
            this->__isset.obj = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    if (!isset_id)
      throw TProtocolException(TProtocolException::INVALID_DATA);
    if (!isset_dist)
      throw TProtocolException(TProtocolException::INVALID_DATA);
    return xfer;
  }
  
  uint32_t ReplyEntry::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("ReplyEntry");
  
    xfer += oprot->writeFieldBegin("id", ::apache::thrift::protocol::T_I32, 1);
    xfer += oprot->writeI32(this->id);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldBegin("dist", ::apache::thrift::protocol::T_DOUBLE, 2);
    xfer += oprot->writeDouble(this->dist);
    xfer += oprot->writeFieldEnd();
  
    if (this->__isset.externId) {
      xfer += oprot->writeFieldBegin("externId", ::apache::thrift::protocol::T_STRING, 3);
      xfer += oprot->writeString(this->externId);
      xfer += oprot->writeFieldEnd();
    }
    if (this->__isset.obj) {
      xfer += oprot->writeFieldBegin("obj", ::apache::thrift::protocol::T_STRING, 4);
      xfer += oprot->writeBinary(this->obj);
      xfer += oprot->writeFieldEnd();
    }
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  void swap(ReplyEntry &a, ReplyEntry &b) {
    using ::std::swap;
    swap(a.id, b.id);
    swap(a.dist, b.dist);
    swap(a.externId, b.externId);
    swap(a.obj, b.obj);
    swap(a.__isset, b.__isset);
  }
  
  ReplyEntry::ReplyEntry(const ReplyEntry& other0) {
    id = other0.id;
    dist = other0.dist;
    externId = other0.externId;
    obj = other0.obj;
    __isset = other0.__isset;
  }
  ReplyEntry& ReplyEntry::operator=(const ReplyEntry& other1) {
    id = other1.id;
    dist = other1.dist;
    externId = other1.externId;
    obj = other1.obj;
    __isset = other1.__isset;
    return *this;
  }
  void ReplyEntry::printTo(std::ostream& out) const {
    using ::apache::thrift::to_string;
    out << "ReplyEntry(";
    out << "id=" << to_string(id);
    out << ", " << "dist=" << to_string(dist);
    out << ", " << "externId="; (__isset.externId ? (out << to_string(externId)) : (out << "<null>"));
    out << ", " << "obj="; (__isset.obj ? (out << to_string(obj)) : (out << "<null>"));
    out << ")";
  }
  
  
  QueryException::~QueryException() throw() {
  }
  
  
  void QueryException::__set_message(const std::string& val) {
    this->message = val;
  }
  std::ostream& operator<<(std::ostream& out, const QueryException& obj)
  {
    obj.printTo(out);
    return out;
  }
  
  
  uint32_t QueryException::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->message);
            this->__isset.message = true;
          } else {
            xfer += iprot->skip(ftype);
          }
          break;
        default:
          xfer += iprot->skip(ftype);
          break;
      }
      xfer += iprot->readFieldEnd();
    }
  
    xfer += iprot->readStructEnd();
  
    return xfer;
  }
  
  uint32_t QueryException::write(::apache::thrift::protocol::TProtocol* oprot) const {
    uint32_t xfer = 0;
    ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
    xfer += oprot->writeStructBegin("QueryException");
  
    xfer += oprot->writeFieldBegin("message", ::apache::thrift::protocol::T_STRING, 1);
    xfer += oprot->writeString(this->message);
    xfer += oprot->writeFieldEnd();
  
    xfer += oprot->writeFieldStop();
    xfer += oprot->writeStructEnd();
    return xfer;
  }
  
  void swap(QueryException &a, QueryException &b) {
    using ::std::swap;
    swap(a.message, b.message);
    swap(a.__isset, b.__isset);
  }
  
  QueryException::QueryException(const QueryException& other2) : TException() {
    message = other2.message;
    __isset = other2.__isset;
  }
  QueryException& QueryException::operator=(const QueryException& other3) {
    message = other3.message;
    __isset = other3.__isset;
    return *this;
  }
  void QueryException::printTo(std::ostream& out) const {
    using ::apache::thrift::to_string;
    out << "QueryException(";
    out << "message=" << to_string(message);
    out << ")";
  }
  
  const char* QueryException::what() const throw() {
    try {
      std::stringstream ss;
      ss << "TException - service has thrown: " << *this;
      this->thriftTExceptionMessageHolder_ = ss.str();
      return this->thriftTExceptionMessageHolder_.c_str();
    } catch (const std::exception&) {
      return "TException - service has thrown: QueryException";
    }
  }
  
  } // namespace
  