本文整理汇总了C++中setPCode函数的典型用法代码示例。如果您正苦于以下问题:C++ setPCode函数的具体用法?C++ setPCode怎么用?C++ setPCode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setPCode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: response_lrpop
response_lrpop (LeftOrRight lr)
{
if (lr == IS_LEFT) {
setPCode (TAIR_RESP_LPOP_PACKET);
} else {
setPCode (TAIR_RESP_RPOP_PACKET);
}
config_version = 0;
values.clear ();
}
示例2: request_lrpop
request_lrpop (LeftOrRight lr)
{
if (lr == IS_LEFT)
setPCode (TAIR_REQ_LPOP_PACKET);
else
setPCode (TAIR_REQ_RPOP_PACKET);
server_flag = 0;
area = 0;
version = 0;
expire = 0;
count = 1;
}
示例3: request_sadd_multi
request_sadd_multi() {
setPCode(TAIR_REQ_SADDMULTI_PACKET);
area = 0;
expire = 0;
keys_values_map.clear();
sfree = 1;
}
示例4: response_hmset
response_hmset ()
{
config_version = 0;
setPCode (TAIR_RESP_HMSET_PACKET);
code = 0;
retvalue = 0;
}
示例5: response_hget
response_hget ()
{
config_version = 0;
setPCode (TAIR_RESP_HGET_PACKET);
code = 0;
version = 0;
}
示例6: flow_control_set
flow_control_set() : type(tair::stat::IN),
lower_mb(-1),
upper_mb(-1),
ns(-1),
success(false) {
setPCode(TAIR_FLOW_CONTROL_SET);
}
示例7: request_hvals
request_hvals (request_hvals & packet)
{
setPCode (packet.getPCode ());
server_flag = packet.server_flag;
area = packet.area;
key.clone (packet.key);
}
示例8: request_prefix_incdec
request_prefix_incdec(const request_prefix_incdec &rhs) {
setPCode(TAIR_REQ_PREFIX_INCDEC_PACKET);
server_flag = rhs.server_flag;
area = rhs.area;
key_count = rhs.key_count;
packet_id = rhs.packet_id;
if (rhs.pkey != NULL) {
pkey = new data_entry(*rhs.pkey);
} else {
pkey = NULL;
}
if (rhs.key_counter_map != NULL) {
key_counter_map = new key_counter_map_t;
key_counter_map_t::const_iterator it = rhs.key_counter_map->begin();
while (it != rhs.key_counter_map->end()) {
data_entry *key = new data_entry(*it->first);
counter_wrapper *wrapper = new counter_wrapper(*it->second);
key_counter_map->insert(make_pair(key, wrapper));
++it;
}
} else {
key_counter_map = NULL;
}
}
示例9: clone
void clone(request_mput &packet, bool need_alloc)
{
if (this == &packet) {
return ;
}
clear();
setPCode(TAIR_REQ_MPUT_PACKET);
server_flag = packet.server_flag;
area = packet.area;
count = packet.count;
len = packet.len;
compressed = packet.compressed;
packet_data_len = packet.packet_data_len;
if (need_alloc) {
if (compressed) {
packet_data = new char[packet_data_len];
memcpy(packet_data, packet.packet_data, packet_data_len);
}
alloc = true;
record_vec = new mput_record_vec();
mput_record_vec::iterator it;
for (it = packet.record_vec->begin(); it != packet.record_vec->end(); ++it) {
mput_record* rec = new mput_record(**it);
record_vec->push_back(rec);
}
} else {
alloc = packet.alloc;
record_vec = packet.record_vec;
packet_data = packet.packet_data;
}
packet_id = packet.packet_id;
}
示例10: request_get_items
request_get_items(request_get_items& packet) : request_get(packet)
{
setPCode(TAIR_REQ_GETITEMS_PACKET);
count = packet.count;
offset = packet.offset;
type = packet.type;
}
示例11: request_exists
request_exists(const uint16_t iarea, const data_entry &ikey)
{
setPCode(TAIR_REQ_EXISTS_PACKET);
server_flag = 0;
area = iarea;
key = ikey;
}
示例12: response_lrange
response_lrange ()
{
setPCode (TAIR_RESP_LRANGE_PACKET);
config_version = 0;
values.clear ();
}
示例13: request_lrange
request_lrange (int pcode)
{
setPCode (pcode);
server_flag = 0;
area = 0;
start = 0;
end = 0;
}
示例14: request_put
request_put()
{
setPCode(TAIR_REQ_PUT_PACKET);
server_flag = 0;
area = 0;
version = 0;
expired = 0;
}
示例15: request_mupdate
request_mupdate()
{
setPCode(TAIR_REQ_MUPDATE_PACKET);
server_flag = 0;
count = 0;
len = 8;
key_and_values = NULL;
}