00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #pragma once
00021
00037 #include <boost/noncopyable.hpp>
00038 #include <drizzled/module/registry.h>
00039 #include <drizzled/visibility.h>
00040
00041 namespace drizzled {
00042
00043 class sys_var;
00044
00045 namespace module {
00046
00047 class Module;
00048 class option_map;
00049
00050 class DRIZZLED_API Context : boost::noncopyable
00051 {
00052 public:
00053
00054 Context(module::Registry ®istry_arg,
00055 module::Module *module_arg) :
00056 registry(registry_arg),
00057 module(module_arg)
00058 { }
00059
00060 template<class T>
00061 void add(T *plugin)
00062 {
00063 plugin->setModule(module);
00064 registry.add(plugin);
00065 }
00066
00067 template<class T>
00068 void remove(T *plugin)
00069 {
00070 registry.remove(plugin);
00071 }
00072
00073 void registerVariable(sys_var *var);
00074
00075 option_map getOptions();
00076
00077 static std::string prepend_name(std::string module_name,
00078 const std::string &var_name);
00079 private:
00080 module::Registry ®istry;
00081 module::Module *module;
00082 };
00083
00084
00085 }
00086 }
00087