Graphite  Version 3
An experimental 3D geometry processing program
module.h
Go to the documentation of this file.
1 /*
2  * OGF/Graphite: Geometry and Graphics Programming Library + Utilities
3  * Copyright (C) 2000 Bruno Levy
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
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., 675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  * If you modify this software, you should include a notice giving the
20  * name of the person performing the modification, the date of modification,
21  * and the reason for such modification.
22  *
23  * Contact: Bruno Levy
24  *
25  * levy@loria.fr
26  *
27  * ISA Project
28  * LORIA, INRIA Lorraine,
29  * Campus Scientifique, BP 239
30  * 54506 VANDOEUVRE LES NANCY CEDEX
31  * FRANCE
32  *
33  * Note that the GNU General Public License does not permit incorporating
34  * the Software into proprietary programs.
35  */
36 
37 #ifndef H_OGF_BASIC_MODULES_MODULE_H
38 #define H_OGF_BASIC_MODULES_MODULE_H
39 
47 #include <string>
48 
49 //____________________________________________________________________________
50 
51 namespace OGF {
52 
57  class BASIC_API Module : public Counted {
58 
59  public:
63  Module();
64 
68  virtual ~Module();
69 
75  const std::string& name() {
76  return name_;
77  }
78 
86  void set_name(const std::string& name_in) {
87  name_ = name_in;
88  }
89 
96  const std::string& vendor() {
97  return vendor_;
98  }
99 
107  void set_vendor(const std::string& vendor_in) {
108  vendor_ = vendor_in;
109  }
110 
115  const std::string& version() {
116  return version_;
117  }
118 
127  void set_version(const std::string& version_in) {
128  version_ = version_in;
129  }
130 
137  bool is_dynamic() const {
138  return is_dynamic_;
139  }
140 
149  void set_is_dynamic(bool b) {
150  is_dynamic_ = b;
151  }
152 
159  bool is_system() const {
160  return is_system_;
161  }
162 
171  void set_is_system(bool x) {
172  is_system_ = x;
173  }
174 
180  const std::string& info() {
181  return info_;
182  }
183 
192  void set_info(const std::string& info_in) {
193  info_ = info_in;
194  }
195 
206  static bool bind_module(
207  const std::string& module_name, Module* module
208  );
209 
217  static bool unbind_module(const std::string& module_name);
218 
225  static Module* resolve_module(const std::string& module_name);
226 
227  private:
228  std::string name_;
229  std::string vendor_;
230  std::string version_;
231  bool is_dynamic_;
232  bool is_system_;
233  std::string info_;
234  };
235 
240 
241 //____________________________________________________________________________
242 
243 }
244 
245 #endif
Base class for reference-counted objects.
Definition: counted.h:71
A smart pointer with reference-counted copy semantics.
Definition: smart_pointer.h:76
Represents information associated with a module (i.e. a plugin).
Definition: module.h:57
virtual ~Module()
Module destructor.
bool is_system() const
Tests whether this module belongs to the Graphite base system.
Definition: module.h:159
bool is_dynamic() const
Tests whether this module is dynamic.
Definition: module.h:137
void set_version(const std::string &version_in)
Sets the version of the module.
Definition: module.h:127
Module()
Module constructor.
void set_is_dynamic(bool b)
Sets the is_dynamic flag of this module.
Definition: module.h:149
static Module * resolve_module(const std::string &module_name)
Retreives a Module object by name.
static bool bind_module(const std::string &module_name, Module *module)
Declares a Module object to the ModuleManager.
const std::string & version()
Gets the version string.
Definition: module.h:115
const std::string & name()
Gets the name of the module.
Definition: module.h:75
void set_name(const std::string &name_in)
Sets the name of the module.
Definition: module.h:86
void set_vendor(const std::string &vendor_in)
Sets the vendor of the module.
Definition: module.h:107
void set_info(const std::string &info_in)
Sets the information string associated with this module.
Definition: module.h:192
void set_is_system(bool x)
Sets the is_system flag of this module.
Definition: module.h:171
static bool unbind_module(const std::string &module_name)
Removes a Module object from the ModuleManager.
const std::string & info()
Gets the information string.
Definition: module.h:180
const std::string & vendor()
Gets the vendor of this module.
Definition: module.h:96
Global Graphite namespace.
Definition: common.h:76
SmartPointer< Module > Module_var
An automatic reference-counted pointer to a Module object.
Definition: module.h:239
Definitions common to all include files in the basic library.