1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2025-07-17 16:34:10 +00:00

Implement hmget() method and use it.

This commit is contained in:
King_DuckZ 2016-07-12 11:40:44 +01:00
parent 64b87c52bb
commit e02b0a16f5
3 changed files with 24 additions and 8 deletions

View file

@ -26,6 +26,7 @@
#include <vector>
#include <boost/range/iterator_range_core.hpp>
#include <boost/range/empty.hpp>
#include <utility>
namespace redis {
class IncRedis {
@ -63,6 +64,8 @@ namespace redis {
//Hash
opt_string hget ( boost::string_ref parKey, boost::string_ref parField );
template <typename... Args>
opt_string_list hmget ( boost::string_ref parKey, Args&&... parArgs );
int hincrby ( boost::string_ref parKey, boost::string_ref parField, int parInc );
//Set
@ -70,8 +73,15 @@ namespace redis {
opt_string srandmember ( boost::string_ref parKey );
private:
static opt_string_list reply_to_string_list ( const Reply& parReply );
Command m_command;
};
template <typename... Args>
auto IncRedis::hmget (boost::string_ref parKey, Args&&... parArgs) -> opt_string_list {
return reply_to_string_list(m_command.run("HMGET", parKey, std::forward<Args>(parArgs)...));
}
} //namespace redis
#endif