TreeFrogFramework  2.8
tcachestore.h
Go to the documentation of this file.
1 #pragma once
2 #include <QByteArray>
3 #include <QMap>
4 #include <QVariant>
5 #include <TGlobal>
6 
7 
9 public:
10  enum DbType {
11  SQL,
12  KVS,
14  };
15 
16  virtual ~TCacheStore() { }
17  virtual QString key() const = 0;
18  virtual DbType dbType() const = 0;
19  virtual void init() {}
20  virtual void cleanup() {}
21  virtual bool open() = 0;
22  virtual void close() = 0;
23  virtual QByteArray get(const QByteArray &key) = 0;
24  virtual bool set(const QByteArray &key, const QByteArray &value, int seconds) = 0;
25  virtual bool remove(const QByteArray &key) = 0;
26  virtual void clear() = 0;
27  virtual void gc() = 0;
28  virtual QMap<QString, QVariant> defaultSettings() const { return QMap<QString, QVariant>(); }
29 };
The TCacheStore class provides a listing of cache store interfaces.
Definition: tcachestore.h:8
virtual bool remove(const QByteArray &key)=0
virtual bool open()=0
virtual bool set(const QByteArray &key, const QByteArray &value, int seconds)=0
virtual void close()=0
virtual QMap< QString, QVariant > defaultSettings() const
Definition: tcachestore.h:28
virtual ~TCacheStore()
Definition: tcachestore.h:16
virtual QString key() const =0
DbType
Definition: tcachestore.h:10
@ Invalid
Definition: tcachestore.h:13
@ SQL
Definition: tcachestore.h:11
@ KVS
Definition: tcachestore.h:12
virtual DbType dbType() const =0
virtual void init()
Definition: tcachestore.h:19
virtual void gc()=0
virtual void clear()=0
virtual void cleanup()
Definition: tcachestore.h:20
virtual QByteArray get(const QByteArray &key)=0
#define T_CORE_EXPORT
Definition: tdeclexport.h:28