~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/registry.h

Merged in latest plugin-slot-reorg.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef DRIZZLED_PLUGIN_REGISTRY_H
21
21
#define DRIZZLED_PLUGIN_REGISTRY_H
22
22
 
 
23
#include "drizzled/registry.h"
23
24
#include <string>
24
25
#include <vector>
25
26
#include <map>
26
27
 
27
 
#include "drizzled/service/authentication.h"
28
 
#include "drizzled/service/scheduler.h"
29
 
#include "drizzled/service/function.h"
30
 
#include "drizzled/service/listen.h"
31
 
#include "drizzled/service/query_cache.h"
32
 
#include "drizzled/service/logging.h"
33
 
#include "drizzled/service/error_message.h"
34
 
#include "drizzled/service/info_schema.h"
35
 
#include "drizzled/service/command_replicator.h"
36
 
#include "drizzled/service/command_applier.h"
37
 
#include "drizzled/service/storage_engine.h"
38
 
 
39
28
 
40
29
namespace drizzled
41
30
{
83
72
 
84
73
  std::vector<Handle *> get_list(bool active);
85
74
 
86
 
  service::CommandReplicator command_replicator;
87
 
  service::CommandApplier command_applier;
88
 
  service::ErrorMessage error_message;
89
 
  service::Authentication authentication;
90
 
  service::QueryCache query_cache;
91
 
  service::Scheduler scheduler;
92
 
  service::Function function;
93
 
  service::Listen listen;
94
 
  service::Logging logging;
95
 
  service::InfoSchema info_schema;
96
 
  service::StorageEngine storage_engine;
97
 
 
98
 
  void add(CommandReplicator *plugin);
99
 
  void add(CommandApplier *plugin);
100
 
  void add(ErrorMessage *plugin);
101
 
  void add(Authentication *plugin);
102
 
  void add(QueryCache *plugin);
103
 
  void add(SchedulerFactory *plugin);
104
 
  void add(Function *plugin);
105
 
  void add(Listen *plugin);
106
 
  void add(Logging *plugin);
107
 
  void add(InfoSchemaTable *plugin);
108
 
  void add(StorageEngine *plugin);
109
 
 
110
 
  void remove(CommandReplicator *plugin);
111
 
  void remove(CommandApplier *plugin);
112
 
  void remove(ErrorMessage *plugin);
113
 
  void remove(Authentication *plugin);
114
 
  void remove(QueryCache *plugin);
115
 
  void remove(SchedulerFactory *plugin);
116
 
  void remove(Function *plugin);
117
 
  void remove(Listen *plugin);
118
 
  void remove(Logging *plugin);
119
 
  void remove(InfoSchemaTable *plugin);
120
 
  void remove(StorageEngine *plugin);
 
75
  template<class T>
 
76
  void add(T *plugin)
 
77
  {
 
78
    plugin->setHandle(current_handle);
 
79
    plugin_registry.add(plugin);
 
80
    T::add(plugin);
 
81
  }
 
82
 
 
83
  template<class T>
 
84
  void remove(T *plugin)
 
85
  {
 
86
    T::remove(plugin);
 
87
    plugin_registry.remove(plugin);
 
88
  }
121
89
 
122
90
};
123
91