本文整理汇总了C++中VDATA类的典型用法代码示例。如果您正苦于以下问题:C++ VDATA类的具体用法?C++ VDATA怎么用?C++ VDATA使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VDATA类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: sadd
bool xRedisClient::sadd(const RedisDBIdx& dbi, const string& key, const VALUES& vValue, int64_t& count) {
VDATA vCmdData;
vCmdData.push_back("SADD");
vCmdData.push_back(key);
addparam(vCmdData, vValue);
return commandargv_integer(dbi, vCmdData, count);
}
开发者ID:TlcvEthan,项目名称:xredis,代码行数:7,代码来源:xRedisClient_sets.cpp
示例2: srem
bool xRedisClient::srem(const RedisDBIdx& dbi, const KEY& key, const VALUES& vmembers, int64_t& count) {
VDATA vCmdData;
vCmdData.push_back("SREM");
vCmdData.push_back(key);
addparam(vCmdData, vmembers);
return commandargv_integer(dbi, vCmdData, count);
}
开发者ID:TlcvEthan,项目名称:xredis,代码行数:7,代码来源:xRedisClient_sets.cpp
示例3: SetErrString
bool xRedisClient::commandargv_array(const RedisDBIdx& dbi, const VDATA& vDataIn, VALUES& array){
bool bRet = false;
RedisConn *pRedisConn = mRedisPool->GetConnection(dbi.mType, dbi.mIndex, dbi.mIOtype);
if (NULL == pRedisConn) {
SetErrString(dbi, GET_CONNECT_ERROR, ::strlen(GET_CONNECT_ERROR));
return false;
}
std::vector<const char*> argv( vDataIn.size() );
std::vector<size_t> argvlen( vDataIn.size() );
uint32_t j = 0;
for ( VDATA::const_iterator i = vDataIn.begin(); i != vDataIn.end(); ++i, ++j ) {
argv[j] = i->c_str(), argvlen[j] = i->size();
}
redisReply *reply = static_cast<redisReply *>(redisCommandArgv(pRedisConn->getCtx(), argv.size(), &(argv[0]), &(argvlen[0])));
if (RedisPool::CheckReply(reply)) {
for (size_t i = 0; i<reply->elements; i++) {
std::string str(reply->element[i]->str, reply->element[i]->len);
array.push_back(str);
}
bRet = true;
} else {
SetErrInfo(dbi, reply);
}
RedisPool::FreeReply(reply);
mRedisPool->FreeConnection(pRedisConn);
return bRet;
}
开发者ID:0xsky,项目名称:xredis,代码行数:30,代码来源:xRedisClient.cpp
示例4: zadd
bool xRedisClient::zadd(const RedisDBIdx& dbi, const KEY& key, const VALUES& vValues, int64_t& count){
VDATA vCmdData;
vCmdData.push_back("ZADD");
vCmdData.push_back(key);
addparam(vCmdData, vValues);
SETDEFAULTIOTYPE(MASTER);
return commandargv_integer(dbi, vCmdData, count);
}
开发者ID:BoYuanZjq,项目名称:Teameeting-MsgServer,代码行数:8,代码来源:xRedisClient_sortedsets.cpp
示例5: hmget
bool xRedisClient::hmget(const RedisDBIdx& dbi, const string& key, const KEYS& field, ArrayReply& array){
VDATA vCmdData;
vCmdData.push_back("HMGET");
vCmdData.push_back(key);
addparam(vCmdData, field);
SETDEFAULTIOTYPE(SLAVE);
return commandargv_array(dbi, vCmdData, array);
}
开发者ID:DyncKevin,项目名称:xredis,代码行数:8,代码来源:xRedisClient_hashs.cpp
示例6: hmset
bool xRedisClient::hmset(const RedisDBIdx& dbi, const string& key, const VDATA& vData){
VDATA vCmdData;
vCmdData.push_back("HMSET");
vCmdData.push_back(key);
addparam(vCmdData, vData);
SETDEFAULTIOTYPE(MASTER);
return commandargv_status(dbi, vCmdData);
}
开发者ID:DyncKevin,项目名称:xredis,代码行数:8,代码来源:xRedisClient_hashs.cpp
示例7: hdel
bool xRedisClient::hdel(const RedisDBIdx& dbi, const string& key, const KEYS& vfiled, int64_t& count) {
VDATA vCmdData;
vCmdData.push_back("HDEL");
vCmdData.push_back(key);
addparam(vCmdData, vfiled);
SETDEFAULTIOTYPE(MASTER);
return commandargv_integer(dbi, vCmdData, count);
}
开发者ID:DyncKevin,项目名称:xredis,代码行数:8,代码来源:xRedisClient_hashs.cpp
示例8: set
bool xRedisClient::set(const RedisDBIdx& dbi, const string& key, const string& value) {
VDATA vCmdData;
vCmdData.push_back("SET");
vCmdData.push_back(key);
vCmdData.push_back(value);
SETDEFAULTIOTYPE(MASTER);
return commandargv_status(dbi, vCmdData);
}
开发者ID:HelloLittleJoey,项目名称:xredis,代码行数:8,代码来源:xRedisClient_strings.cpp
示例9: SETDEFAULTIOTYPE
bool xRedisClient::hset(const RedisDBIdx& dbi, const string& key, const string& field, const string& value, int64_t& retval){
SETDEFAULTIOTYPE(MASTER);
VDATA vCmdData;
vCmdData.push_back("HSET");
vCmdData.push_back(key);
vCmdData.push_back(field);
vCmdData.push_back(value);
return commandargv_integer(dbi, vCmdData, retval);
//return command_integer(dbi, retval, "HSET %s %s %s", key.c_str(), field.c_str(), value.c_str());
}
开发者ID:DyncKevin,项目名称:xredis,代码行数:10,代码来源:xRedisClient_hashs.cpp
示例10: setex
bool xRedisClient::setex(const RedisDBIdx& dbi, const string& key, int seconds, const string& value) {
VDATA vCmdData;
vCmdData.push_back("SETEX");
vCmdData.push_back(key);
vCmdData.push_back(toString(seconds));
vCmdData.push_back(value);
SETDEFAULTIOTYPE(MASTER);
return commandargv_bool(dbi, vCmdData);
}
开发者ID:HelloLittleJoey,项目名称:xredis,代码行数:10,代码来源:xRedisClient_strings.cpp
示例11: lpush
bool xRedisClient::lpush(const RedisDBIdx& dbi, const string& key, const VALUES& vValue, int64_t& length) {
if (0 == key.length()) {
return false;
}
VDATA vCmdData;
vCmdData.push_back("LPUSH");
vCmdData.push_back(key);
addparam(vCmdData, vValue);
SETDEFAULTIOTYPE(MASTER);
return commandargv_integer(dbi, vCmdData, length);
}
开发者ID:yorickdewid,项目名称:Mavicona,代码行数:11,代码来源:xRedisClient_lists.cpp
示例12: SETDEFAULTIOTYPE
bool xRedisClient::srem(const RedisDBIdx& dbi, const KEY& key, const VALUES& vmembers, int64_t& count) {
if (0 == key.length()) {
return false;
}
SETDEFAULTIOTYPE(MASTER);
VDATA vCmdData;
vCmdData.push_back("SREM");
vCmdData.push_back(key);
addparam(vCmdData, vmembers);
return commandargv_integer(dbi, vCmdData, count);
}
开发者ID:yorickdewid,项目名称:Mavicona,代码行数:11,代码来源:xRedisClient_sets.cpp
示例13: mset
bool xRedisClient::mset(const DBIArray& vdbi, const VDATA& vData) {
DBIArray::const_iterator iter_dbi = vdbi.begin();
VDATA::const_iterator iter_data = vData.begin();
for (; iter_data != vData.end(); iter_dbi++) {
const string &key = (*iter_data++);
const string &value = (*iter_data++);
const RedisDBIdx& dbi = *iter_dbi;
SETDEFAULTIOTYPE(SLAVE);
command_status(dbi, "SET %s %s", key.c_str(), value.c_str());
}
return true;
}
开发者ID:HelloLittleJoey,项目名称:xredis,代码行数:12,代码来源:xRedisClient_strings.cpp
示例14: SETDEFAULTIOTYPE
bool xRedisClient::ScanFun(const char* cmd, const RedisDBIdx& dbi, const std::string *key,
int64_t &cursor, const char* pattern, uint32_t count, ArrayReply& array, xRedisContext& ctx)
{
SETDEFAULTIOTYPE(MASTER);
VDATA vCmdData;
vCmdData.push_back(cmd);
if (NULL != key) {
vCmdData.push_back(*key);
}
vCmdData.push_back(toString(cursor));
if (NULL != pattern) {
vCmdData.push_back("MATCH");
vCmdData.push_back(pattern);
}
if (0 != count) {
vCmdData.push_back("COUNT");
vCmdData.push_back(toString(count));
}
bool bRet = false;
RedisConn *pRedisConn = static_cast<RedisConn *>(ctx.conn);
if (NULL == pRedisConn) {
SetErrString(dbi, GET_CONNECT_ERROR, ::strlen(GET_CONNECT_ERROR));
return false;
}
std::vector<const char*> argv(vCmdData.size());
std::vector<size_t> argvlen(vCmdData.size());
uint32_t j = 0;
for (VDATA::const_iterator i = vCmdData.begin(); i != vCmdData.end(); ++i, ++j) {
argv[j] = i->c_str(), argvlen[j] = i->size();
}
redisReply *reply = static_cast<redisReply *>(redisCommandArgv(pRedisConn->getCtx(), argv.size(), &(argv[0]), &(argvlen[0])));
if (RedisPool::CheckReply(reply)) {
if (0 == reply->elements){
cursor = 0;
} else {
cursor = atoi(reply->element[0]->str);
redisReply **replyData = reply->element[1]->element;
for (size_t i = 0; i < reply->element[1]->elements; i++) {
DataItem item;
item.type = replyData[i]->type;
item.str.assign(replyData[i]->str, replyData[i]->len);
array.push_back(item);
}
}
bRet = true;
} else {
SetErrInfo(dbi, reply);
}
RedisPool::FreeReply(reply);
return bRet;
}
开发者ID:0xsky,项目名称:xredis,代码行数:57,代码来源:xRedisClient.cpp
注:本文中的VDATA类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论