Пример #1
0
bool Command<ReplyT>::isExpectedReply(int typeA, int typeB) {

  if((reply_obj_->type == typeA) || (reply_obj_->type == typeB)) {
    reply_status_ = OK_REPLY;
    return true;
  }

  if(checkErrorReply() || checkNilReply()) return false;

  logger_.error() << cmd() << ": Received reply of type " << reply_obj_->type
      << ", expected type " << typeA << " or " << typeB << ".";
  reply_status_ = WRONG_TYPE;
  return false;
}
Пример #2
0
template <class ReplyT> bool Command<ReplyT>::isExpectedReply(int typeA, int typeB) {

    if ((reply_obj_->type == typeA) || (reply_obj_->type == typeB)) {
        reply_status_ = OK_REPLY;
        return true;
    }

    if (checkErrorReply() || checkNilReply())
        return false;

    stringstream errorMessage;
    errorMessage << "Received reply of type " << reply_obj_->type << ", expected type " << typeA
                 << " or " << typeB << ".";
    last_error_ = errorMessage.str();
    logger_.error() << cmd() << ": " << last_error_;
    reply_status_ = WRONG_TYPE;
    return false;
}