コード例 #1
0
bool xRedisClient::spop(const RedisDBIdx& dbi,  const KEY& key, VALUE& member) {
	if (0 == key.length()) {
		return false;
	}
	SETDEFAULTIOTYPE(MASTER);
	return command_string(dbi, member, "SPOP %s", key.c_str());
}
コード例 #2
0
bool xRedisClient::smove(const RedisDBIdx& dbi,  const KEY& srckey, const KEY& deskey,  const VALUE& member) {
	if (0 == srckey.length()) {
		return false;
	}
	SETDEFAULTIOTYPE(MASTER);
	return command_bool(dbi, "SMOVE %s", srckey.c_str(), deskey.c_str(), member.c_str());
}
コード例 #3
0
bool xRedisClient::smembers(const RedisDBIdx& dbi,  const KEY& key, VALUES& vValue) {
	if (0 == key.length()) {
		return false;
	}
	SETDEFAULTIOTYPE(SLAVE);
	return command_list(dbi, vValue, "SMEMBERS %s", key.c_str());
}
コード例 #4
0
bool xRedisClient::srandmember(const RedisDBIdx& dbi,  const KEY& key, VALUES& members, int count) {
	if (0 == key.length()) {
		return false;
	}
	SETDEFAULTIOTYPE(SLAVE);
	if (0 == count) {
		return command_list(dbi, members, "SRANDMEMBER %s", key.c_str());
	}
	return command_list(dbi, members, "SRANDMEMBER %s %d", key.c_str(), count);
}
コード例 #5
0
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);
}
コード例 #6
0
bool xRedisClient::sismember(const RedisDBIdx& dbi,  const KEY& key,   const VALUE& member) {
	if (0 == key.length()) {
		return false;
	}
	return command_bool(dbi, "SISMEMBER %s %s", key.c_str(), member.c_str());
}