/* * _Portfolio.cpp * * Created on: 2016年3月29日 * Author: fasiondog */ #include #include #include "../_Parameter.h" #include "../pickle_support.h" using namespace boost::python; using namespace hku; BOOST_PYTHON_FUNCTION_OVERLOADS(PF_Simple_overload, PF_Simple, 0, 3); void (Portfolio::*pf_set_name)(const string&) = &Portfolio::name; string (Portfolio::*pf_get_name)() const= &Portfolio::name; void export_Portfolio() { class_("Portfolio", init<>()) .def(init()) .def(init()) .def(self_ns::str(self)) .def("getParam", &Portfolio::getParam) .def("setParam", &Portfolio::setParam) .def("haveParam", &Portfolio::haveParam) .add_property("name", pf_get_name, pf_set_name) .add_property("tm", &Portfolio::getTM, &Portfolio::setTM) .add_property("se", &Portfolio::getSE, &Portfolio::setSE) .def("run", &Portfolio::run) #if HKU_PYTHON_SUPPORT_PICKLE .def_pickle(name_init_pickle_suite()) #endif ; register_ptr_to_python(); def("PF_Simple", PF_Simple, PF_Simple_overload()); }