18
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
#ifndef DRIZZLED_PLUGIN_QUERY_CACHE_H
22
#define DRIZZLED_PLUGIN_QUERY_CACHE_H
23
#include <drizzled/plugin.h>
24
#include <drizzled/plugin/plugin.h>
24
#include "drizzled/plugin.h"
25
#include "drizzled/plugin/plugin.h"
25
26
#include <drizzled/sql_list.h>
26
#include <drizzled/visibility.h>
32
37
This is the API that a qcache plugin must implement.
35
class DRIZZLED_API QueryCache : public Plugin
40
class QueryCache : public Plugin
45
QueryCache(const QueryCache &);
46
QueryCache& operator=(const QueryCache &);
38
explicit QueryCache(const std::string& name)
39
: Plugin(name, "QueryCache")
50
explicit QueryCache(std::string name_arg)
51
: Plugin(name_arg, "QueryCache")
54
virtual ~QueryCache() {}
42
56
/* these are the Query Cache interface functions */
44
58
/* Lookup the cache and transmit the data back to the client */
45
virtual bool doIsCached(Session*)= 0;
59
virtual bool doIsCached(Session* session)= 0;
46
60
/* Lookup the cache and transmit the data back to the client */
47
virtual bool doSendCachedResultset(Session*)= 0;
61
virtual bool doSendCachedResultset(Session *session)= 0;
48
62
/* Send the current Resultset to the cache */
49
virtual bool doSetResultset(Session*)= 0;
63
virtual bool doSetResultset(Session *session)= 0;
50
64
/* initiate a new Resultset (header) */
51
virtual bool doPrepareResultset(Session*)= 0;
65
virtual bool doPrepareResultset(Session *session)= 0;
52
66
/* push a record to the current Resultset */
53
virtual bool doInsertRecord(Session*, List<Item>&)= 0;
67
virtual bool doInsertRecord(Session *session, List<Item> &item)= 0;
55
static bool addPlugin(QueryCache*);
56
static void removePlugin(QueryCache*);
69
static bool addPlugin(QueryCache *handler);
70
static void removePlugin(QueryCache *handler);
58
72
/* These are the functions called by the rest of the Drizzle server */
59
static bool isCached(Session*);
60
static bool sendCachedResultset(Session*);
61
static bool prepareResultset(Session*);
62
static bool setResultset(Session*);
63
static bool insertRecord(Session*, List<Item>&);
73
static bool isCached(Session *session);
74
static bool sendCachedResultset(Session *session);
75
static bool prepareResultset(Session *session);
76
static bool setResultset(Session *session);
77
static bool insertRecord(Session *session, List<Item> &item);
66
80
} /* namespace plugin */
67
81
} /* namespace drizzled */
83
#endif /* DRIZZLED_PLUGIN_QUERY_CACHE_H */