Fix nan issue in features
[trackerpp.git] / include / PyWrapper.h
1 #ifndef _PY_WRAPPER_H_
2 #define _PY_WRAPPER_H_
3
4 #include <boost/python.hpp>
5 #include "SharedPtr.h"
6 #include <string>
7
8 namespace suanzi {
9
10 TK_DECLARE_PTR(PyWrapper);
11 class PyWrapper 
12 {
13 public:
14     static PyWrapperPtr getInstance(const std::string& pydir); // get Python Interprete
15     virtual ~PyWrapper();
16     boost::python::object import(const std::string& module);
17     void exec(const std::string& cmd);
18     static std::string parse_python_exception();
19
20 private:
21     PyWrapper(const std::string& python_dir);
22     boost::python::object main_namespace;
23     boost::python::object main_module;
24 };
25
26 }
27
28
29 #endif // _PY_WRAPPER_H_