UGDK
|
00001 #ifndef UGDK_SCRIPT_PYTHON_PYTHONWRAPPER_H_ 00002 #define UGDK_SCRIPT_PYTHON_PYTHONWRAPPER_H_ 00003 00004 #include <vector> 00005 #include <ugdk/script/langwrapper.h> 00006 00007 namespace ugdk { 00008 namespace script { 00009 00010 class VirtualObj; 00011 00012 namespace python { 00013 00014 typedef void (*PyInitFunction)(void); 00015 typedef ugdk::script::Module<PyInitFunction> PythonModule; 00016 typedef ugdk::script::InheritableLangWrapper<PyInitFunction> PythonWrapperBase; 00017 00018 00019 class PythonWrapper : public PythonWrapperBase { 00020 public: 00021 PythonWrapper() : PythonWrapperBase("py", LANG(Python)) {} 00022 virtual ~PythonWrapper() {} 00023 00024 virtual VirtualData::Ptr NewData(); 00025 00026 virtual void ExecuteCode(const std::string& code); 00027 00028 virtual VirtualObj LoadModule(const std::string& name); 00029 00031 virtual bool Initialize(); 00033 virtual void Finalize(); 00034 00035 void PrintPythonExceptionDetails(); 00036 00037 private: 00038 //std::vector<Module> modules_; 00039 }; 00040 00041 } 00042 } 00043 } 00044 00045 #endif /* UGDK_SCRIPT_PYTHON_PYTHONWRAPPER_H_ */