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; }
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; }
void Command<redisReply*>::parseReplyObject() { if(!checkErrorReply()) reply_status_ = OK_REPLY; reply_val_ = reply_obj_; }