本文整理汇总了C++中ZIterator::skip方法的典型用法代码示例。如果您正苦于以下问题:C++ ZIterator::skip方法的具体用法?C++ ZIterator::skip怎么用?C++ ZIterator::skip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZIterator
的用法示例。
在下文中一共展示了ZIterator::skip方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: proc_zrscan
int proc_zrscan(NetworkServer *net, Link *link, const Request &req, Response *resp){
SSDBServer *serv = (SSDBServer *)net->data;
CHECK_NUM_PARAMS(6);
uint64_t limit = req[5].Uint64();
uint64_t offset = 0;
if(req.size() > 6){
offset = limit;
limit = offset + req[6].Uint64();
}
ZIterator *it = serv->ssdb->zrscan(req[1], req[2], req[3], req[4], limit);
if(offset > 0){
it->skip(offset);
}
resp->push_back("ok");
uint64_t size = 0;
while(it->next()){
size += it->key.size() + it->score.size();
CHECK_SCAN_OUTPUT_LIMIT(size);
resp->push_back(it->key);
resp->push_back(it->score);
}
delete it;
return 0;
}
示例2: zrrange
ZIterator* SSDB::zrrange(const Bytes &name, uint64_t offset, uint64_t limit){
if(offset + limit > limit){
limit = offset + limit;
}
ZIterator *it = ziterator(this, name, "", "", "", limit, Iterator::BACKWARD);
it->skip(offset);
return it;
}
示例3: proc_zrscan
static int proc_zrscan(Server *serv, Link *link, const Request &req, Response *resp){
if(req.size() < 6){
resp->push_back("client_error");
}else{
uint64_t limit = req[5].Uint64();
uint64_t offset = 0;
if(req.size() > 6){
offset = limit;
limit = offset + req[6].Uint64();
}
ZIterator *it = serv->ssdb->zrscan(req[1], req[2], req[3], req[4], limit);
if(offset > 0){
it->skip(offset);
}
resp->push_back("ok");
while(it->next()){
resp->push_back(it->key);
resp->push_back(it->score);
}
delete it;
}
return 0;
}