22 #include <drizzled/plugin/query_cache.h>
23 #include <drizzled/errmsg_print.h>
25 #include <drizzled/gettext.h>
32 typedef std::vector<plugin::QueryCache *> QueryCaches;
33 QueryCaches all_query_cache;
38 :
public std::unary_function<plugin::QueryCache *, bool>
43 std::unary_function<plugin::QueryCache *, bool>(),
44 session(session_arg) { }
46 inline result_type operator()(argument_type handler)
48 return handler->doIsCached(session);
52 bool plugin::QueryCache::isCached(
Session *session)
55 QueryCaches::iterator iter=
56 std::find_if(all_query_cache.begin(), all_query_cache.end(),
62 return iter != all_query_cache.end();
67 :
public std::unary_function<plugin::QueryCache *, bool>
72 std::unary_function<plugin::QueryCache *, bool>(),
73 session(session_arg) { }
75 inline result_type operator()(argument_type handler)
77 return handler->doSendCachedResultset(session);
80 bool plugin::QueryCache::sendCachedResultset(
Session *session)
83 QueryCaches::iterator iter=
84 std::find_if(all_query_cache.begin(), all_query_cache.end(),
90 return iter != all_query_cache.end();
98 std::unary_function<plugin::QueryCache *, bool>(),
99 session(session_arg) { }
101 inline result_type operator()(argument_type handler)
103 return handler->doPrepareResultset(session);
106 bool plugin::QueryCache::prepareResultset(
Session *session)
109 QueryCaches::iterator iter=
110 std::find_if(all_query_cache.begin(), all_query_cache.end(),
116 return iter != all_query_cache.end();
124 std::unary_function<plugin::QueryCache *, bool>(),
125 session(session_arg) { }
127 inline result_type operator()(argument_type handler)
129 return handler->doSetResultset(session);
133 bool plugin::QueryCache::setResultset(
Session *session)
136 QueryCaches::iterator iter=
137 std::find_if(all_query_cache.begin(), all_query_cache.end(),
143 return iter != all_query_cache.end();
147 :
public std::unary_function<plugin::QueryCache *, bool>
153 std::unary_function<plugin::QueryCache *, bool>(),
154 session(session_arg), item(item_arg) { }
156 inline result_type operator()(argument_type handler)
158 return handler->doInsertRecord(session, item);
164 QueryCaches::iterator iter=
165 std::find_if(all_query_cache.begin(), all_query_cache.end(),
171 return iter != all_query_cache.end();
176 bool plugin::QueryCache::addPlugin(plugin::QueryCache *handler)
178 all_query_cache.push_back(handler);
182 void plugin::QueryCache::removePlugin(plugin::QueryCache *handler)
184 all_query_cache.erase(std::find(all_query_cache.begin(), all_query_cache.end(),
TODO: Rename this file - func.h is stupid.