22#include <drizzled/plugin/query_cache.h>
23#include <drizzled/errmsg_print.h>
25#include <drizzled/gettext.h>
32typedef std::vector<plugin::QueryCache *> QueryCaches;
33QueryCaches all_query_cache;
41 IsCachedIterate(
Session* session_arg) :
42 session(session_arg) { }
46 return handler->doIsCached(session);
50bool plugin::QueryCache::isCached(
Session *session)
53 QueryCaches::iterator iter=
54 std::find_if(all_query_cache.begin(), all_query_cache.end(),
60 return iter != all_query_cache.end();
64class SendCachedResultsetIterate
68 SendCachedResultsetIterate(
Session *session_arg) :
69 session(session_arg) { }
73 return handler->doSendCachedResultset(session);
76bool plugin::QueryCache::sendCachedResultset(
Session *session)
79 QueryCaches::iterator iter=
80 std::find_if(all_query_cache.begin(), all_query_cache.end(),
86 return iter != all_query_cache.end();
89class PrepareResultsetIterate
93 PrepareResultsetIterate(
Session *session_arg) :
94 session(session_arg) { }
98 return handler->doPrepareResultset(session);
101bool plugin::QueryCache::prepareResultset(
Session *session)
104 QueryCaches::iterator iter=
105 std::find_if(all_query_cache.begin(), all_query_cache.end(),
111 return iter != all_query_cache.end();
114class SetResultsetIterate
118 SetResultsetIterate(
Session *session_arg) :
119 session(session_arg) { }
123 return handler->doSetResultset(session);
127bool plugin::QueryCache::setResultset(
Session *session)
130 QueryCaches::iterator iter=
131 std::find_if(all_query_cache.begin(), all_query_cache.end(),
137 return iter != all_query_cache.end();
140class InsertRecordIterate
146 session(session_arg), item(item_arg) { }
150 return handler->doInsertRecord(session, item);
156 QueryCaches::iterator iter=
157 std::find_if(all_query_cache.begin(), all_query_cache.end(),
163 return iter != all_query_cache.end();
168bool plugin::QueryCache::addPlugin(plugin::QueryCache &handler)
170 all_query_cache.push_back(&handler);
174void plugin::QueryCache::removePlugin(plugin::QueryCache &handler)
176 all_query_cache.erase(std::find(all_query_cache.begin(), all_query_cache.end(),
TODO: Rename this file - func.h is stupid.