UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
pythonwrapper.h
Go to the documentation of this file.
1 #ifndef UGDK_SCRIPT_PYTHON_PYTHONWRAPPER_H_
2 #define UGDK_SCRIPT_PYTHON_PYTHONWRAPPER_H_
3 
4 #include <vector>
6 
7 namespace ugdk {
8 namespace script {
9 
10 class VirtualObj;
11 
12 namespace python {
13 
14 typedef void (*PyInitFunction)(void);
18 
19 #define PYTHON_INIT_FUNCTION_NAME(name) init_##name
20 #define PYTHON_INIT_FUNCTION_SIGNATURE(name) void PYTHON_INIT_FUNCTION_NAME(name)(void)
21 #define PYTHON_MODULE_NAME(name) "_" #name
22 #define PYTHON_NAMESPACE ::ugdk::script::python
23 
24 class PythonWrapper : public PythonWrapperBase {
25  public:
26  PythonWrapper() : PythonWrapperBase("py", LANG(Python), "Python") {}
27  virtual ~PythonWrapper() {}
28 
29  virtual VirtualData::Ptr NewData();
30 
31  virtual void ExecuteCode(const std::string& code);
32 
33  virtual VirtualObj LoadModule(const std::string& name);
34 
36  virtual bool Initialize();
38  virtual void Finalize();
39 
41 
42  private:
43  //std::vector<Module> modules_;
44 };
45 
46 }
47 }
48 }
49 
50 #endif /* UGDK_SCRIPT_PYTHON_PYTHONWRAPPER_H_ */
ugdk::script::Module< PyInitFunction > PythonModule
Definition: pythonwrapper.h:15
virtual VirtualData::Ptr NewData()
Definition: pythonwrapper.h:24
Definition: animation.h:11
std::shared_ptr< VirtualData > Ptr
Definition: virtualdata.h:46
Definition: script.h:18
virtual void Finalize()
Finalizes the LangWrapper, finalizing any language specific stuff.
PythonWrapper()
Definition: pythonwrapper.h:26
void(* PyInitFunction)(void)
Definition: pythonwrapper.h:14
virtual VirtualObj LoadModule(const std::string &name)
virtual void ExecuteCode(const std::string &code)
#define LANG(name)
Here are the common definitions of the script system.
Definition: defs.h:7
A proxy class wich represents virtual objects from scripting languages.
Definition: virtualobj.h:30
ugdk::script::InheritableLangWrapper< PyInitFunction > PythonWrapperBase
Definition: pythonwrapper.h:16
virtual bool Initialize()
Initializes the LangWrapper (that is, the language's API. Returns bool telling if (true=) no problems...
virtual ~PythonWrapper()
Definition: pythonwrapper.h:27
Wraps a scripting language.
Definition: script.h:15
ugdk::script::python::PyInitFunction inittype
Definition: pythonwrapper.h:17