~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/query_cache.h

Merge Monty - Updates to pandora-build to support features of gcc 4.5.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#pragma once
 
21
#ifndef DRIZZLED_PLUGIN_QUERY_CACHE_H
 
22
#define DRIZZLED_PLUGIN_QUERY_CACHE_H
22
23
 
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>
27
 
 
28
 
namespace drizzled {
29
 
namespace plugin {
 
27
 
 
28
namespace drizzled
 
29
{
 
30
class Session;
 
31
class select_result;
 
32
 
 
33
namespace plugin
 
34
{
30
35
 
31
36
/* 
32
37
  This is the API that a qcache plugin must implement.
33
38
*/
34
39
 
35
 
class DRIZZLED_API QueryCache : public Plugin
 
40
class QueryCache : public Plugin
36
41
{
 
42
private:  
 
43
  
 
44
  QueryCache();
 
45
  QueryCache(const QueryCache &);
 
46
  QueryCache& operator=(const QueryCache &);
 
47
 
37
48
public:  
38
 
  explicit QueryCache(const std::string& name)
39
 
    : Plugin(name, "QueryCache")
 
49
 
 
50
  explicit QueryCache(std::string name_arg)
 
51
    : Plugin(name_arg, "QueryCache")
40
52
  {}
41
53
 
 
54
  virtual ~QueryCache() {}
 
55
 
42
56
  /* these are the Query Cache interface functions */
43
57
 
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;
54
68
 
55
 
  static bool addPlugin(QueryCache*);
56
 
  static void removePlugin(QueryCache*);
 
69
  static bool addPlugin(QueryCache *handler);
 
70
  static void removePlugin(QueryCache *handler);
57
71
 
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);
64
78
};
65
79
 
66
80
} /* namespace plugin */
67
81
} /* namespace drizzled */
 
82
 
 
83
#endif /* DRIZZLED_PLUGIN_QUERY_CACHE_H */