Add boost python, and predictor wrapper
[trackerpp.git] / include / PredictorWrapper.h
1 #ifndef _PREDICTOR_H_
2 #define _PREDICTOR_H_
3
4 #include "SharedPtr.h"
5 #include <boost/python.hpp>
6
7 namespace suanzi {
8
9     TK_DECLARE_PTR(PredictorWrapper);
10
11     typedef boost::python::object PY_FUN;
12
13     class PredictorWrapper
14     {
15     public:
16         static PredictorWrapperPtr create(const std::string& fname);
17         ~PredictorWrapper(){}
18         void dump() { this->dump_func(); }
19         void predict() { this->predict_func();}
20
21     private:
22         PredictorWrapper(const std::string& fname);
23         static PredictorWrapperWPtr instance;
24
25         PY_FUN dump_func;
26         PY_FUN predict_func;
27
28     };
29
30 }
31
32 #endif // _PREDICTOR_H_