00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #pragma once
00022
00023 #include <drizzled/plugin.h>
00024 #include <drizzled/plugin/plugin.h>
00025 #include <drizzled/sql_list.h>
00026
00027 #include <drizzled/visibility.h>
00028
00029 namespace drizzled
00030 {
00031 class Session;
00032 class select_result;
00033
00034 namespace plugin
00035 {
00036
00037
00038
00039
00040
00041 class DRIZZLED_API QueryCache : public Plugin
00042 {
00043 private:
00044
00045 QueryCache();
00046 QueryCache(const QueryCache &);
00047 QueryCache& operator=(const QueryCache &);
00048
00049 public:
00050
00051 explicit QueryCache(std::string name_arg)
00052 : Plugin(name_arg, "QueryCache")
00053 {}
00054
00055 virtual ~QueryCache() {}
00056
00057
00058
00059
00060 virtual bool doIsCached(Session* session)= 0;
00061
00062 virtual bool doSendCachedResultset(Session *session)= 0;
00063
00064 virtual bool doSetResultset(Session *session)= 0;
00065
00066 virtual bool doPrepareResultset(Session *session)= 0;
00067
00068 virtual bool doInsertRecord(Session *session, List<Item> &item)= 0;
00069
00070 static bool addPlugin(QueryCache *handler);
00071 static void removePlugin(QueryCache *handler);
00072
00073
00074 static bool isCached(Session *session);
00075 static bool sendCachedResultset(Session *session);
00076 static bool prepareResultset(Session *session);
00077 static bool setResultset(Session *session);
00078 static bool insertRecord(Session *session, List<Item> &item);
00079 };
00080
00081 }
00082 }
00083