acl
3.5.3.0
|
#include <redis_hash.hpp>
Public 成员函数 | |
redis_hash (void) | |
redis_hash (redis_client *conn) | |
redis_hash (redis_client_cluster *cluster) | |
ACL_CPP_DEPRECATED | redis_hash (redis_client_cluster *cluster, size_t max_conns) |
redis_hash (redis_client_pipeline *pipeline) | |
virtual | ~redis_hash (void) |
bool | hmset (const char *key, const std::map< string, string > &attrs) |
bool | hmset (const char *key, size_t klen, const std::map< string, string > &attrs) |
bool | hmset (const char *key, const std::map< string, const char * > &attrs) |
bool | hmset (const char *key, const std::vector< string > &names, const std::vector< string > &values) |
bool | hmset (const char *key, size_t klen, const std::vector< string > &names, const std::vector< string > &values) |
bool | hmset (const char *key, const std::vector< const char * > &names, const std::vector< const char * > &values) |
bool | hmset (const char *key, const char *names[], const char *values[], size_t argc) |
bool | hmset (const char *key, const char *names[], const size_t names_len[], const char *values[], const size_t values_len[], size_t argc) |
bool | hmset (const char *key, size_t klen, const char *names[], const size_t names_len[], const char *values[], const size_t values_len[], size_t argc) |
bool | hmget (const char *key, const std::vector< string > &names, std::vector< string > *result=NULL) |
bool | hmget (const char *key, size_t klen, const std::vector< string > &names, std::vector< string > *result=NULL) |
bool | hmget (const char *key, const std::vector< const char * > &names, std::vector< string > *result=NULL) |
bool | hmget (const char *key, const char *names[], size_t argc, std::vector< string > *result=NULL) |
bool | hmget (const char *key, const char *names[], const size_t lens[], size_t argc, std::vector< string > *result=NULL) |
bool | hmget (const char *key, size_t klen, const char *names[], const size_t lens[], size_t argc, std::vector< string > *result=NULL) |
int | hset (const char *key, const char *name, const char *value) |
int | hset (const char *key, const char *name, const char *value, size_t value_len) |
int | hset (const char *key, const char *name, size_t name_len, const char *value, size_t value_len) |
int | hset (const char *key, size_t klen, const char *name, size_t name_len, const char *value, size_t value_len) |
int | hsetnx (const char *key, const char *name, const char *value) |
int | hsetnx (const char *key, const char *name, const char *value, size_t value_len) |
int | hsetnx (const char *key, const char *name, size_t name_len, const char *value, size_t value_len) |
int | hsetnx (const char *key, size_t klen, const char *name, size_t name_len, const char *value, size_t value_len) |
bool | hget (const char *key, const char *name, string &result) |
bool | hget (const char *key, const char *name, size_t name_len, string &result) |
bool | hget (const char *key, size_t klen, const char *name, size_t name_len, string &result) |
bool | hgetall (const char *key, std::map< string, string > &result) |
bool | hgetall (const char *key, size_t klen, std::map< string, string > &result) |
bool | hgetall (const char *key, std::vector< string > &names, std::vector< string > &values) |
bool | hgetall (const char *key, size_t klen, std::vector< string > &names, std::vector< string > &values) |
bool | hgetall (const char *key, std::vector< const char * > &names, std::vector< const char * > &values) |
int | hdel (const char *key, const char *first_name) |
int | hdel (const char *key, const char *names[], size_t argc) |
int | hdel (const char *key, const char *names[], const size_t names_len[], size_t argc) |
int | hdel (const char *key, size_t klen, const char *names[], const size_t names_len[], size_t argc) |
int | hdel (const char *key, const std::vector< string > &names) |
int | hdel (const char *key, size_t klen, const std::vector< string > &names) |
int | hdel (const char *key, const std::vector< const char * > &names) |
int | hdel_fields (const char *key, const char *names[], size_t argc) |
int | hdel_fields (const char *key, const char *names[], const size_t names_len[], size_t argc) |
int | hdel_fields (const char *key, size_t klen, const char *names[], const size_t names_len[], size_t argc) |
int | hdel_fields (const char *key, const std::vector< string > &names) |
int | hdel_fields (const char *key, size_t klen, const std::vector< string > &names) |
int | hdel_fields (const char *key, const std::vector< const char * > &names) |
int | hdel_fields (const char *key, const char *first_name,...) |
bool | hincrby (const char *key, const char *name, long long int inc, long long int *result=NULL) |
bool | hincrbyfloat (const char *key, const char *name, double inc, double *result=NULL) |
bool | hkeys (const char *key, std::vector< string > &names) |
bool | hkeys (const char *key, size_t klen, std::vector< string > &names) |
bool | hexists (const char *key, const char *name) |
bool | hexists (const char *key, const char *name, size_t name_len) |
bool | hexists (const char *key, size_t klen, const char *name, size_t name_len) |
bool | hvals (const char *key, std::vector< string > &values) |
bool | hvals (const char *key, size_t klen, std::vector< string > &values) |
int | hlen (const char *key) |
int | hlen (const char *key, size_t klen) |
int | hstrlen (const char *key, const char *name, size_t name_len) |
int | hstrlen (const char *key, size_t klen, const char *name, size_t name_len) |
int | hstrlen (const char *key, const char *name) |
int | hscan (const char *key, int cursor, std::map< string, string > &out, const char *pattern=NULL, const size_t *count=NULL) |
int | hscan (const char *key, size_t klen, int cursor, std::map< string, string > &out, const char *pattern=NULL, const size_t *count=NULL) |
Public 成员函数 继承自 acl::redis_command | |
redis_command (void) | |
redis_command (redis_client *conn) | |
redis_command (redis_client_cluster *cluster) | |
ACL_CPP_DEPRECATED | redis_command (redis_client_cluster *cluster, size_t max_conns) |
redis_command (redis_client_pipeline *pipeline) | |
virtual | ~redis_command (void) |
void | set_check_addr (bool on) |
void | clear (bool save_slot=false) |
void | reset (bool save_slot=false) |
void | set_client (redis_client *conn) |
redis_client * | get_client (void) const |
const char * | get_client_addr (void) const |
void | set_cluster (redis_client_cluster *cluster) |
ACL_CPP_DEPRECATED void | set_cluster (redis_client_cluster *cluster, size_t max_conns) |
redis_client_cluster * | get_cluster (void) const |
void | set_pipeline (redis_client_pipeline *pipeline, bool use_mbox=true) |
redis_client_pipeline * | get_pipeline (void) const |
dbuf_pool * | get_dbuf (void) const |
redis_result_t | result_type (void) const |
const char * | result_status (void) const |
const char * | result_error (void) const |
size_t | result_size (void) const |
int | result_number (bool *success=NULL) const |
long long int | result_number64 (bool *success=NULL) const |
const char * | get_result (size_t i, size_t *len=NULL) const |
bool | eof (void) const |
const redis_result * | get_result (void) const |
const redis_result * | result_child (size_t i) const |
const char * | result_value (size_t i, size_t *len=NULL) const |
void | set_slice_request (bool on) |
void | set_slice_respond (bool on) |
const redis_result * | request (size_t argc, const char *argv[], size_t lens[], size_t nchild=0) |
const redis_result * | request (const std::vector< string > &args, size_t nchild=0) |
const string * | request_buf (void) const |
void | build_request (size_t argc, const char *argv[], size_t lens[]) |
void | hash_slot (const char *key) |
void | hash_slot (const char *key, size_t len) |
int | get_slot (void) const |
bool | is_check_addr (void) const |
const char * | get_addr (const char *info) |
void | set_client_addr (const char *addr) |
void | set_client_addr (redis_client &conn) |
redis_request * | get_request_obj (void) const |
string * | get_request_buf (void) const |
bool | is_slice_req (void) const |
redis_pipeline_message & | get_pipeline_message (void) |
额外继承的成员函数 | |
静态 Public 成员函数 继承自 acl::redis_command | |
static void | build_request (size_t argc, const char *argv[], size_t lens[], string &out) |
Protected 成员函数 继承自 acl::redis_command | |
const redis_result * | run (size_t nchild=0, int *timeout=NULL) |
void | clear_request (void) |
const redis_result ** | scan_keys (const char *cmd, const char *key, int &cursor, size_t &size, const char *pattern, const size_t *count) |
const redis_result ** | scan_keys (const char *cmd, const char *key, size_t klen, int &cursor, size_t &size, const char *pattern, const size_t *count) |
void | build (const char *cmd, const char *key, const std::map< string, string > &attrs) |
void | build (const char *cmd, const char *key, size_t klen, const std::map< string, string > &attrs) |
void | build (const char *cmd, const char *key, const std::map< string, const char * > &attrs) |
void | build (const char *cmd, const char *key, const std::vector< string > &names, const std::vector< string > &values) |
void | build (const char *cmd, const char *key, size_t klen, const std::vector< string > &names, const std::vector< string > &values) |
void | build (const char *cmd, const char *key, const std::vector< const char * > &names, const std::vector< const char * > &values) |
void | build (const char *cmd, const char *key, const char *names[], const char *values[], size_t argc) |
void | build (const char *cmd, const char *key, const int names[], const char *values[], size_t argc) |
void | build (const char *cmd, const char *key, const char *names[], const size_t names_len[], const char *values[], const size_t values_len[], size_t argc) |
void | build (const char *cmd, const char *key, size_t klen, const char *names[], const size_t names_len[], const char *values[], const size_t values_len[], size_t argc) |
void | build (const char *cmd, const char *key, const std::vector< string > &names) |
void | build (const char *cmd, const char *key, size_t klen, const std::vector< string > &names) |
void | build (const char *cmd, const char *key, const std::vector< const char * > &names) |
void | build (const char *cmd, const char *key, const std::vector< int > &names) |
void | build (const char *cmd, const char *key, const char *names[], size_t argc) |
void | build (const char *cmd, const char *key, const char *names[], const size_t lens[], size_t argc) |
void | build (const char *cmd, const char *key, size_t klen, const char *names[], const size_t lens[], size_t argc) |
void | build (const char *cmd, const char *key, const int names[], size_t argc) |
int | get_number (bool *success=NULL) |
long long int | get_number64 (bool *success=NULL) |
int | get_number (std::vector< int > &out) |
int | get_number64 (std::vector< long long int > &out) |
bool | check_status (const char *success="OK") |
int | get_status (std::vector< bool > &out) |
const char * | get_status (void) |
int | get_string (string &buf) |
int | get_string (string *buf) |
int | get_string (char *buf, size_t size) |
int | get_strings (std::vector< string > &result) |
int | get_strings (std::vector< string > *result) |
int | get_strings (std::list< string > &result) |
int | get_strings (std::list< string > *result) |
int | get_strings (std::map< string, string > &result) |
int | get_strings (std::vector< string > &names, std::vector< string > &values) |
int | get_strings (std::vector< const char * > &names, std::vector< const char * > &values) |
void | argv_space (size_t n) |
void | build_request1 (size_t argc, const char *argv[], size_t lens[]) |
void | build_request2 (size_t argc, const char *argv[], size_t lens[]) |
void | logger_result (const redis_result *result) |
Protected 成员函数 继承自 acl::acl::noncopyable | |
noncopyable () | |
~noncopyable () | |
Protected 属性 继承自 acl::redis_command | |
dbuf_pool * | dbuf_ |
bool | check_addr_ |
char | addr_ [32] |
redis_client * | conn_ |
redis_client_cluster * | cluster_ |
redis_client_pipeline * | pipeline_ |
bool | pipe_use_mbox_ |
int | slot_ |
int | redirect_max_ |
int | redirect_sleep_ |
bool | slice_req_ |
string * | request_buf_ |
redis_request * | request_obj_ |
size_t | argv_size_ |
const char ** | argv_ |
size_t * | argv_lens_ |
size_t | argc_ |
bool | slice_res_ |
redis_pipeline_message * | pipe_msg_ |
const redis_result * | result_ |
redis Hash(哈希表) 类,本类的实现的主要命令: redis Hash class, include commands as below: HDEL/HEXISTS/HGET/HGETALL/HINCRBY/HINCRBYFLOAT/HKEYS/HLEN/HMGET/HMSET HSET/HSETNX/HVALS/HSCAN
在文件 redis_hash.hpp 第 19 行定义.
acl::redis_hash::redis_hash | ( | void | ) |
acl::redis_hash::redis_hash | ( | redis_client * | conn | ) |
acl::redis_hash::redis_hash | ( | redis_client_cluster * | cluster | ) |
ACL_CPP_DEPRECATED acl::redis_hash::redis_hash | ( | redis_client_cluster * | cluster, |
size_t | max_conns | ||
) |
acl::redis_hash::redis_hash | ( | redis_client_pipeline * | pipeline | ) |
|
virtual |
int acl::redis_hash::hdel | ( | const char * | key, |
const char * | first_name | ||
) |
从 redis 哈希表中删除某个 key 对象的某些域字段 remove one or more fields from hash stored at key
key | {const char*} key 键值 the hash key |
first_name | {const char*} 第一个域字段名,最后一个字段必须是 NULL the first field of the fields list, the last field must be NULL indicating the end of vary parameters |
int acl::redis_hash::hdel | ( | const char * | key, |
const char * | names[], | ||
size_t | argc | ||
) |
int acl::redis_hash::hdel | ( | const char * | key, |
const char * | names[], | ||
const size_t | names_len[], | ||
size_t | argc | ||
) |
int acl::redis_hash::hdel | ( | const char * | key, |
size_t | klen, | ||
const char * | names[], | ||
const size_t | names_len[], | ||
size_t | argc | ||
) |
int acl::redis_hash::hdel | ( | const char * | key, |
const std::vector< string > & | names | ||
) |
int acl::redis_hash::hdel | ( | const char * | key, |
size_t | klen, | ||
const std::vector< string > & | names | ||
) |
int acl::redis_hash::hdel | ( | const char * | key, |
const std::vector< const char * > & | names | ||
) |
int acl::redis_hash::hdel_fields | ( | const char * | key, |
const char * | names[], | ||
size_t | argc | ||
) |
int acl::redis_hash::hdel_fields | ( | const char * | key, |
const char * | names[], | ||
const size_t | names_len[], | ||
size_t | argc | ||
) |
int acl::redis_hash::hdel_fields | ( | const char * | key, |
size_t | klen, | ||
const char * | names[], | ||
const size_t | names_len[], | ||
size_t | argc | ||
) |
int acl::redis_hash::hdel_fields | ( | const char * | key, |
const std::vector< string > & | names | ||
) |
int acl::redis_hash::hdel_fields | ( | const char * | key, |
size_t | klen, | ||
const std::vector< string > & | names | ||
) |
int acl::redis_hash::hdel_fields | ( | const char * | key, |
const std::vector< const char * > & | names | ||
) |
int acl::redis_hash::hdel_fields | ( | const char * | key, |
const char * | first_name, | ||
... | |||
) |
bool acl::redis_hash::hexists | ( | const char * | key, |
const char * | name | ||
) |
检查 key 对象中某个域字段是否存在 check if the field exists in hash stored at key
key | {const char*} key 键值 the hash key |
name | {const char*} key 对象的域字段名称 the filed's name of the key |
bool acl::redis_hash::hexists | ( | const char * | key, |
const char * | name, | ||
size_t | name_len | ||
) |
bool acl::redis_hash::hexists | ( | const char * | key, |
size_t | klen, | ||
const char * | name, | ||
size_t | name_len | ||
) |
bool acl::redis_hash::hget | ( | const char * | key, |
const char * | name, | ||
string & | result | ||
) |
从 redis 哈希表中获取某个 key 对象的某个域的值 get the value assosiated with field in the hash stored at key
key | {const char*} key 键值 the hash key |
name | {const char*} key 对象的域字段名称 the field's name |
result | {acl::string&} 存储查询结果值(内部对该 string 进行内容追加) store the value result of the given field |
bool acl::redis_hash::hget | ( | const char * | key, |
const char * | name, | ||
size_t | name_len, | ||
string & | result | ||
) |
bool acl::redis_hash::hget | ( | const char * | key, |
size_t | klen, | ||
const char * | name, | ||
size_t | name_len, | ||
string & | result | ||
) |
从 redis 哈希表中获取某个 key 对象的所有域字段的值 get all the fields and values in hash stored at key
key | {const char*} key 键值 the hash key |
result | {std::map<string, string>&} 存储域字段名-值查询结果集 store the result of all the fileds and values |
bool acl::redis_hash::hgetall | ( | const char * | key, |
size_t | klen, | ||
std::map< string, string > & | result | ||
) |
bool acl::redis_hash::hgetall | ( | const char * | key, |
std::vector< string > & | names, | ||
std::vector< string > & | values | ||
) |
bool acl::redis_hash::hgetall | ( | const char * | key, |
size_t | klen, | ||
std::vector< string > & | names, | ||
std::vector< string > & | values | ||
) |
bool acl::redis_hash::hgetall | ( | const char * | key, |
std::vector< const char * > & | names, | ||
std::vector< const char * > & | values | ||
) |
bool acl::redis_hash::hincrby | ( | const char * | key, |
const char * | name, | ||
long long int | inc, | ||
long long int * | result = NULL |
||
) |
当某个 key 对象中的某个域字段为整数时,对其进行加减操作 inc(+n) or dec(-n) on a integer filed in hash stored at key
key | {const char*} key 键值 the hash key |
name | {const char*} key 对象的域字段名称 the filed name of integer type |
inc | {long long int} 增加的值,可以为负值 the integer value to be inc or dec on the field's value |
result | {long long int*} 非 NULL 时存储结果值 store the result if non-NULL |
bool acl::redis_hash::hincrbyfloat | ( | const char * | key, |
const char * | name, | ||
double | inc, | ||
double * | result = NULL |
||
) |
当某个 key 对象中的某个域字段为浮点数时,对其进行加减操作 inc(+n) or dec(-n) on a float filed in hash stored at key
key | {const char*} key 键值 the hash key |
name | {const char*} key 对象的域字段名称 the filed name of float type |
inc | {double} 增加的值,可以为负值 the float value to be inc or dec on the field's value |
result | {double*} 非 NULL 时存储结果值 store the result if non-NULL |
bool acl::redis_hash::hkeys | ( | const char * | key, |
std::vector< string > & | names | ||
) |
返回 key 对象中所有域字段名称 get all the fields in hash stored at key
key | {const char*} key 键值 the hash key |
names | {std::vector<string>&} 存储该 key 对象所有域字段名称 store all the names of all fileds |
bool acl::redis_hash::hkeys | ( | const char * | key, |
size_t | klen, | ||
std::vector< string > & | names | ||
) |
int acl::redis_hash::hlen | ( | const char * | key | ) |
获得某个 key 对象中所有域字段的数量 get the count of fields in hash stored at key
key | {const char*} key 键值 the hash key |
int acl::redis_hash::hlen | ( | const char * | key, |
size_t | klen | ||
) |
bool acl::redis_hash::hmget | ( | const char * | key, |
const std::vector< string > & | names, | ||
std::vector< string > * | result = NULL |
||
) |
根据 KEY 值将多个"域-值"对从哈希表中取出 get the values associated with the specified fields in the hash stored at key
key | {const char*} 哈希表 key 值 the hash key |
names | 对应 key 的域值对 the given hash fileds |
result | {std::vector<acl::string>*} 当该对象指针非空时存储查询结果; 如果该参数为 NULL 时,则可以通过基类 result_/get_ 获得数据 store the result of the given hash files if not NULL. If NULL, the base class's method like result_/get can be used to get the values |
1、在调用方法中传入非空的存储结果对象的地址 input the no-NULL result parameter when call hmget, when success, the result will store the values of the given fileds
2、基类方法 result_value 获得指定下标的元素数据 call redis_command::result_value with the specified subscript
3、基类方法 result_child 获得指定下标的元素对象(redis_result),然后再通过 redis_result::argv_to_string 方法获得元素数据 call redis_command::result_child with specified subscript to get redis_result object, then call redis_result::argv_to_string with above result to get the values of the give fileds
4、基类方法 get_result 方法取得总结果集对象 redis_result,然后再通过 redis_result::get_child 获得一个元素对象,然后再通过方式 2 中指定 的方法获得该元素的数据 call redis_command::get_result with the specified subscript to get redis_result object, and use redis_result::get_child to get one result object, then call redis_result::argv_to_string to get the value of one filed.
5、基类方法 get_children 获得结果元素数组对象,再通过 redis_result 中 的方法 argv_to_string 从每一个元素对象中获得元素数据 use redis_command::get_children to get the redis_result array, then use redis_result::argv_to_string to get every value of the given fileds
bool acl::redis_hash::hmget | ( | const char * | key, |
size_t | klen, | ||
const std::vector< string > & | names, | ||
std::vector< string > * | result = NULL |
||
) |
bool acl::redis_hash::hmget | ( | const char * | key, |
const std::vector< const char * > & | names, | ||
std::vector< string > * | result = NULL |
||
) |
bool acl::redis_hash::hmget | ( | const char * | key, |
const char * | names[], | ||
size_t | argc, | ||
std::vector< string > * | result = NULL |
||
) |
bool acl::redis_hash::hmget | ( | const char * | key, |
const char * | names[], | ||
const size_t | lens[], | ||
size_t | argc, | ||
std::vector< string > * | result = NULL |
||
) |
bool acl::redis_hash::hmget | ( | const char * | key, |
size_t | klen, | ||
const char * | names[], | ||
const size_t | lens[], | ||
size_t | argc, | ||
std::vector< string > * | result = NULL |
||
) |
将多个"域-值"对添加至 KEY 对应的哈希表中 HMSET: set the key's multiple fileds in redis-server
key | {const char*} 哈希表 key 值 the hash key for Hash class |
attrs | {const std::map<acl::string, ...>&} the fileds in map |
bool acl::redis_hash::hmset | ( | const char * | key, |
size_t | klen, | ||
const std::map< string, string > & | attrs | ||
) |
bool acl::redis_hash::hmset | ( | const char * | key, |
const std::map< string, const char * > & | attrs | ||
) |
bool acl::redis_hash::hmset | ( | const char * | key, |
const std::vector< string > & | names, | ||
const std::vector< string > & | values | ||
) |
bool acl::redis_hash::hmset | ( | const char * | key, |
size_t | klen, | ||
const std::vector< string > & | names, | ||
const std::vector< string > & | values | ||
) |
bool acl::redis_hash::hmset | ( | const char * | key, |
const std::vector< const char * > & | names, | ||
const std::vector< const char * > & | values | ||
) |
bool acl::redis_hash::hmset | ( | const char * | key, |
const char * | names[], | ||
const char * | values[], | ||
size_t | argc | ||
) |
bool acl::redis_hash::hmset | ( | const char * | key, |
const char * | names[], | ||
const size_t | names_len[], | ||
const char * | values[], | ||
const size_t | values_len[], | ||
size_t | argc | ||
) |
bool acl::redis_hash::hmset | ( | const char * | key, |
size_t | klen, | ||
const char * | names[], | ||
const size_t | names_len[], | ||
const char * | values[], | ||
const size_t | values_len[], | ||
size_t | argc | ||
) |
int acl::redis_hash::hscan | ( | const char * | key, |
int | cursor, | ||
std::map< string, string > & | out, | ||
const char * | pattern = NULL , |
||
const size_t * | count = NULL |
||
) |
命令用于迭代哈希键中的键值对 scan the name and value of all fields in hash stored at key
key | {const char*} 哈希键值 the hash key |
cursor | {int} 游标值,开始遍历时该值写 0 the cursor value, which is 0 at begin |
out | {std::map<acl::string>&} 存储结果集,内部以追加方式将本次 遍历结果添加进该对象中,为防止因总结果集过大导致该数组溢出,用户可在 调用本函数前后清理该对象 store scaning result in appending mode |
pattern | {const char*} 匹配模式,glob 风格,非空时有效 match pattern, effective only on no-NULL |
count | {const size_t*} 限定的结果集数量,非空指针时有效 the max count of one scan process, effective only on no-NULL |
int acl::redis_hash::hscan | ( | const char * | key, |
size_t | klen, | ||
int | cursor, | ||
std::map< string, string > & | out, | ||
const char * | pattern = NULL , |
||
const size_t * | count = NULL |
||
) |
int acl::redis_hash::hset | ( | const char * | key, |
const char * | name, | ||
const char * | value | ||
) |
设置 key 对象中某个域字段的值 set one field's value in the hash stored at key.
key | {const char*} key 键值 the hash key |
name | {const char*} key 对象的域名称 the filed name of the hash key |
value | {const char*} key 对象的域值 the filed value of the hash key |
int acl::redis_hash::hset | ( | const char * | key, |
const char * | name, | ||
const char * | value, | ||
size_t | value_len | ||
) |
int acl::redis_hash::hset | ( | const char * | key, |
const char * | name, | ||
size_t | name_len, | ||
const char * | value, | ||
size_t | value_len | ||
) |
int acl::redis_hash::hset | ( | const char * | key, |
size_t | klen, | ||
const char * | name, | ||
size_t | name_len, | ||
const char * | value, | ||
size_t | value_len | ||
) |
int acl::redis_hash::hsetnx | ( | const char * | key, |
const char * | name, | ||
const char * | value | ||
) |
当且仅当 key 对象中的某个域字段不存在时才更新该域字段值 set one new field of one key in hash only when the filed isn't existing.
key | {const char*} key 键值 the hash key |
name | {const char*} key 对象的域名称 the field name |
value | {const char*} key 对象的域值 the field value |
return int value as below: 1 – this is a new filed and set ok 0 – thie is a old filed and not set -1 – error happend or the key is not a Hash type
int acl::redis_hash::hsetnx | ( | const char * | key, |
const char * | name, | ||
const char * | value, | ||
size_t | value_len | ||
) |
int acl::redis_hash::hsetnx | ( | const char * | key, |
const char * | name, | ||
size_t | name_len, | ||
const char * | value, | ||
size_t | value_len | ||
) |
int acl::redis_hash::hsetnx | ( | const char * | key, |
size_t | klen, | ||
const char * | name, | ||
size_t | name_len, | ||
const char * | value, | ||
size_t | value_len | ||
) |
int acl::redis_hash::hstrlen | ( | const char * | key, |
const char * | name, | ||
size_t | name_len | ||
) |
获得某个 key 中的指定域的数据长度 Returns the string length of the value associated with field in the hash stored at key
key | {const char*} key 键值 the hash key |
name | {const char*} key 对象的域字段名称 the field's name |
int acl::redis_hash::hstrlen | ( | const char * | key, |
size_t | klen, | ||
const char * | name, | ||
size_t | name_len | ||
) |
int acl::redis_hash::hstrlen | ( | const char * | key, |
const char * | name | ||
) |
bool acl::redis_hash::hvals | ( | const char * | key, |
std::vector< string > & | values | ||
) |
获得指定 key 的所有字段值 get all fields' values with the specified key
key | {const char*} key 键值 the hash key |
values | {std::vector<string>&} 存储结果 store the results |
bool acl::redis_hash::hvals | ( | const char * | key, |
size_t | klen, | ||
std::vector< string > & | values | ||
) |