7 #include <lht_errors.h> 8 #include "lht_redis_i.h" 9 #include "lht_redis_core.h" 13 class ctkPluginContext;
14 class LHLoggerInterface;
15 class LHSettingsInterface;
27 Q_INTERFACES(LHRedisInterface)
32 virtual int Init(
const LHParameters &Parameters);
34 virtual int CreateInstance(QVariant &varInstance,
const LHParameters &Parameters);
35 virtual int DestroyInstance(
const QVariant &varInstance);
36 virtual void Upgrade()
48 int key_del(QString key,
bool *error = NULL);
56 QString key_dump(QString key,
bool *error = NULL);
64 bool key_exists(QString key,
bool *error = NULL);
73 bool key_expire(QString key,
int seconds,
bool *error = NULL);
82 bool key_expireat(QString key, qint64 timestamp,
bool *error = NULL);
90 QStringList keys(QString pattern,
bool *error = NULL);
98 int key_pttl(QString key,
bool *error = NULL);
106 int key_ttl(QString key,
bool *error = NULL);
114 bool key_rename(QString key, QString newkey,
bool *error = NULL);
122 QString key_type(QString key,
bool *error = NULL);
132 bool string_set(QString key, QString value,
bool *error = NULL);
140 QString string_get(QString key,
bool *error = NULL);
150 QString string_getrange(QString key,
int start,
int stop,
bool *error = NULL);
158 QStringList string_mget(QStringList keys,
bool *error = NULL);
166 bool string_mset(QMap<QString, QVariant> map,
bool *error = NULL);
174 int string_incr(QString key,
bool *error = NULL);
183 int string_incrby(QString key,
int interval,
bool *error = NULL);
191 int string_decr(QString key,
bool *error = NULL);
200 int string_decrby(QString key,
int interval,
bool *error = NULL);
209 int string_append(QString key, QString value,
bool *error = NULL);
219 QStringList list_blpop(QString key,
int timeout,
bool *error = NULL);
228 QStringList list_brpop(QString key,
int timeout,
bool *error = NULL);
238 QStringList list_brpoplpush(QString source, QString destination,
int timeout,
bool *error = NULL);
247 QString list_index(QString key,
int index,
bool *error = NULL);
259 int list_insert(QString key, QString position, QString pivot, QString value,
bool *error = NULL);
267 int list_len(QString key,
bool *error = NULL);
275 QString list_lpop(QString key,
bool *error = NULL);
284 int list_lpush(QString key, QString value,
bool *error = NULL);
293 int list_lpush(QString key, QStringList values,
bool *error = NULL);
302 int list_lpushx(QString key, QStringList values,
bool *error = NULL);
313 QStringList list_range(QString key,
int start,
int end,
bool *error = NULL);
327 int list_rem(QString key,
int count, QString value,
bool *error = NULL);
338 int list_set(QString key,
int index, QString value,
bool *error = NULL);
350 bool list_trim(QString key,
int start,
int stop,
bool *error = NULL);
358 QString list_rpop(QString key,
bool *error = NULL);
367 QString list_rpoplpush(QString source, QString destination,
bool *error = NULL);
376 int list_rpush(QString key, QString value,
bool *error = NULL);
385 int list_rpush(QString key, QStringList values,
bool *error = NULL);
394 int list_rpushx(QString key, QStringList values,
bool *error = NULL);
406 int set_add(QString key, QString member,
bool *error = NULL);
417 int set_add(QString key, QStringList members,
bool *error = NULL);
425 int set_card(QString key,
bool *error = NULL);
433 QStringList set_diff(QStringList keys,
bool *error = NULL);
442 int set_diffstore(QString destination, QStringList keys,
bool *error = NULL);
450 QStringList set_inter(QStringList keys,
bool *error = NULL);
459 int set_interstore(QString destination, QStringList keys,
bool *error = NULL);
468 bool set_ismember(QString key, QString member,
bool *error = NULL);
476 QStringList set_members(QString key,
bool *error = NULL);
490 bool set_move(QString source, QString destination, QString member,
bool *error = NULL);
498 QString set_pop(QString key,
bool *error = NULL);
507 virtual QStringList set_randmember(QString key,
bool *error = NULL) = 0;
519 QStringList set_randmember(QString key,
bool *error = NULL);
528 int set_rem(QString key, QString member,
bool *error = NULL);
537 int set_rem(QString key, QStringList members,
bool *error = NULL);
545 QStringList set_union(QStringList keys,
bool *error = NULL);
554 int set_unionstore(QString destination, QStringList keys,
bool *error = NULL);
564 int hash_del(QString key, QString field,
bool *error = NULL);
573 int hash_del(QString key, QStringList fields,
bool *error = NULL);
582 bool hash_exists(QString key, QString field,
bool *error = NULL);
591 QString hash_get(QString key, QString field,
bool *error = NULL);
599 QVariantMap hash_getall(QString key,
bool *error = NULL);
614 int hash_incrby(QString key, QString field,
int increment,
bool *error = NULL);
624 float hash_incrbyfloat(QString key, QString field,
float increment,
bool *error = NULL);
632 QStringList hash_keys(QString key,
bool *error = NULL);
640 int hash_len(QString key,
bool *error = NULL);
649 QStringList hash_mget(QString key, QStringList fields,
bool *error = NULL);
658 bool hash_mset(QString key, QMap<QString,QVariant> map,
bool *error = NULL);
668 bool hash_set(QString key, QString field, QString value,
bool *error = NULL);
681 bool hash_setnx(QString key, QString field, QString value,
bool *error = NULL);
689 QStringList hash_values(QString key,
bool *error = NULL);
697 void publish(QString channel, QString message,
bool *error = NULL);
704 void subscribe(QString channel,
bool *error = NULL);
711 void unsubscribe(QString channel,
bool *error = NULL);
719 void psubscribe(QString channel,
bool *error = NULL);
726 void punsubscribe(QString channel,
bool *error = NULL);
821 LHRedisCore *getRedisInstance();
822 bool validKey(QString &key, QString funcName,
bool *error);
823 bool validKeys(QStringList &key, QString funcName,
bool *error);
824 void setLastError(
int error);
825 QVariant dealwithCmd(FuncType type, QVariantList &data,
bool *error);
826 QVariant excuteCmd(FuncType type, LHRedisCore* redis, QVariantList &data);
832 int m_nSettingsInstance;
836 int m_redisCmdTimeout;
838 QMap<void *, ThreadRedis> m_redis;
840 LHSettingsInterface *m_Settings;
841 LHLoggerInterface *m_Log4qt;
842 ctkPluginContext *m_PluginContext;
847 #endif // LHT_REDIS_H Definition: lht_redis.h:24
Definition: lht_redis.h:17