00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
#ifndef OMF_PYTHON_HPP
00026
#define OMF_PYTHON_HPP
00027
00028
00029
#include <boost/python.hpp>
00030
00031
00032
#include <string>
00033
#include <map>
00034
00035
namespace OMF
00036 {
00037
00038
class ModelObject;
00039
00053 namespace Python
00054 {
00062 typedef std::pair<unsigned, PyObject *> (*FactoryMethod)(
ModelObject *);
00063
00069 struct FactoryMap
00070 {
00071
FactoryMap();
00072
~FactoryMap();
00073
00075
static FactoryMap &
instance();
00076
00078
void add(
const std::string &name,
FactoryMethod fact);
00079
00081 PyObject *
create(
const std::string &name);
00082
00084 PyObject *
wrap(
const std::string &name,
ModelObject *obj);
00085
00086
private:
00087
typedef std::map<std::string, FactoryMethod> Map;
00088 Map _fact;
00089 };
00090 }
00091 }
00092
00093
#endif