Graphite  Version 3
An experimental 3D geometry processing program
meta_constructor.h
Go to the documentation of this file.
1 /*
2  * GXML/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_META_MEMBERS_META_CONSTRUCTOR_H
38 #define H_OGF_META_MEMBERS_META_CONSTRUCTOR_H
39 
40 #include <OGF/gom/common/common.h>
43 
49 namespace OGF {
50 
54  gom_class GOM_API MetaConstructor : public MetaMethod {
55  public:
64  explicit MetaConstructor(MetaClass* mclass);
65 
69  virtual ~MetaConstructor();
70 
77  Factory* factory() const {
78  return factory_;
79  }
80 
88  void set_factory(Factory* f) {
89  factory_ = f;
90  }
91 
92  protected:
106  Object* target,
107  const std::string& method_name, const ArgList& args,
108  Any& ret_val
109  );
110 
111  private:
112  Factory_var factory_;
113  };
114 }
115 
116 #endif
A class that stores a variable of arbitrary type.
Definition: any.h:62
Represents a list of name-value pairs.
Definition: arg_list.h:65
Creates instances of a specific class.
Definition: factory.h:61
The representation of a class in the Meta repository.
Definition: meta_class.h:64
The representation of a constructor in the Meta repository.
static bool constructor_method_adapter(Object *target, const std::string &method_name, const ArgList &args, Any &ret_val)
The method adapter used for constructor.
virtual ~MetaConstructor()
MetaConstructor destructor.
Factory * factory() const
Gets the factory associated with this MetaConstructor.
void set_factory(Factory *f)
Sets the factory associated with this MetaConstructor.
MetaConstructor(MetaClass *mclass)
Constructs a new MetaConstructor.
The representation of a method in the Meta repository.
Definition: meta_method.h:72
Base class for all objects in the GOM system.
Definition: object.h:65
Meta-information attached to class methods.
Global Graphite namespace.
Definition: common.h:76
Definitions common to all include files in the gom library.
Classes to create objects from type name and argument list.