~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/qcache.cc

  • Committer: Monty Taylor
  • Date: 2009-04-10 18:17:59 UTC
  • mto: (992.1.1 mordred)
  • mto: This revision was merged to the branch mainline in revision 990.
  • Revision ID: mordred@inaugust.com-20090410181759-wr58on1xxc9lwzut
Made plugin registration go through Plugin_registry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <drizzled/server_includes.h>
21
21
#include <drizzled/qcache.h>
22
22
#include <drizzled/gettext.h>
 
23
#include "drizzled/plugin_registry.h"
23
24
#include <vector>
24
25
 
25
26
using namespace std;
26
27
 
27
28
static vector<QueryCache *> all_query_cache;
28
29
 
29
 
static void add_query_cache(QueryCache *handler)
 
30
void add_query_cache(QueryCache *handler)
30
31
{
31
32
  all_query_cache.push_back(handler);
32
33
}
33
34
 
34
 
static void remove_query_cache(QueryCache *handler)
 
35
void remove_query_cache(QueryCache *handler)
35
36
{
36
37
  all_query_cache.erase(find(all_query_cache.begin(), all_query_cache.end(),
37
38
                        handler));
39
40
 
40
41
int qcache_initializer(st_plugin_int *plugin)
41
42
{
42
 
  QueryCache *p;
 
43
  QueryCache *p= NULL;
43
44
 
44
45
 
45
46
  if (plugin->plugin->init)
52
53
    }
53
54
  }
54
55
 
55
 
  add_query_cache(p);
 
56
  Plugin_registry &registry= Plugin_registry::get_plugin_registry();
 
57
  if (p != NULL)
 
58
    registry.registerPlugin(p);
56
59
  plugin->data= p;
57
60
 
58
61
  return 0;