TreeFrogFramework: src/tmemcached.h Source File

12public:

15

16 bool isOpen() const;

17 QByteArray get(const QByteArray &key, uint *flags = nullptr);

18 int64_t getNumber(const QByteArray &key, bool *ok = nullptr, uint *flags = nullptr);

19 bool set(const QByteArray &key, const QByteArray &value, int seconds, uint flags = 0);

20 bool set(const QByteArray &key, int64_t value, int seconds, uint flags = 0);

21 bool add(const QByteArray &key, const QByteArray &value, int seconds, uint flags = 0);

22 bool add(const QByteArray &key, int64_t value, int seconds, uint flags = 0);

23 bool replace(const QByteArray &key, const QByteArray &value, int seconds, uint flags = 0);

24 bool replace(const QByteArray &key, int64_t value, int seconds, uint flags = 0);

25 bool append(const QByteArray &key, const QByteArray &value, int seconds, uint flags = 0);

26 bool prepend(const QByteArray &key, const QByteArray &value, int seconds, uint flags = 0);

27 bool remove(const QByteArray &key);

28 uint64_t incr(const QByteArray &key, uint64_t value, bool *ok = nullptr);

29 uint64_t decr(const QByteArray &key, uint64_t value, bool *ok = nullptr);

30 bool flushAll();

31 QByteArray version();

32

33private:

34 QByteArray request(const QByteArray &command, const QByteArray &key, const QByteArray &value, uint flags, int exptime, bool noreply);

35 QByteArray requestLine(const QByteArray &command, const QByteArray &key, const QByteArray &value, bool noreply);

36

38 TMemcachedDriver *driver();

39 const TMemcachedDriver *driver() const;

40

41 TKvsDatabase _database;

42

43 friend class TCacheMemcachedStore;

46};