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 namespace module {
00043
00044 class DRIZZLED_API Context : boost::noncopyable
00045 {
00046 public:
00047
00048 Context(module::Registry ®istry_arg,
00049 module::Module *module_arg) :
00050 registry(registry_arg),
00051 module(module_arg)
00052 { }
00053
00054 template<class T>
00055 void add(T *plugin)
00056 {
00057 plugin->setModule(module);
00058 registry.add(plugin);
00059 }
00060
00061 template<class T>
00062 void remove(T *plugin)
00063 {
00064 registry.remove(plugin);
00065 }
00066
00067 void registerVariable(sys_var *var);
00068
00069 option_map getOptions();
00070
00071 static std::string prepend_name(std::string module_name,
00072 const std::string &var_name);
00073 private:
00074 module::Registry ®istry;
00075 module::Module *module;
00076 };
00077
00078
00079 }
00080 }
00081