Drizzled Public API Documentation

context.h
1 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3  *
4  * Copyright (C) 2010 Monty Taylor
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #pragma once
21 
37 #include <boost/noncopyable.hpp>
38 #include <drizzled/module/registry.h>
39 #include <drizzled/visibility.h>
40 
41 namespace drizzled {
42 namespace module {
43 
44 class DRIZZLED_API Context : boost::noncopyable
45 {
46 public:
47 
48  Context(module::Registry &registry_arg,
49  module::Module *module_arg) :
50  registry(registry_arg),
51  module(module_arg)
52  { }
53 
54  template<class T>
55  void add(T *plugin)
56  {
57  plugin->setModule(module);
58  registry.add(plugin);
59  }
60 
61  template<class T>
62  void remove(T *plugin)
63  {
64  registry.remove(plugin);
65  }
66 
67  void registerVariable(sys_var *var);
68 
69  option_map getOptions();
70 
71  static std::string prepend_name(std::string module_name,
72  const std::string &var_name);
73 private:
74  module::Registry &registry;
75  module::Module *module;
76 };
77 
78 
79 } /* namespace module */
80 } /* namespace drizzled */
81 
TODO: Rename this file - func.h is stupid.
#define DRIZZLED_API
Definition: visibility.h:62
Visibility Control Macros.
Definition: engine.cc:41