hikyuu2/hikyuu_pywrap/_MarketInfo.cpp
fasiondog bc3a875a2c 1. Fix: VS2017 can't use Boost.python's docstring
2. Support C++17
3. Clear "tes_data/tmp"
2018-08-26 18:47:06 +08:00

32 lines
1.1 KiB
C++

/*
* _MarketInfo.cpp
*
* Created on: 2012-9-27
* Author: fasiondog
*/
#include <boost/python.hpp>
#include <hikyuu/serialization/MarketInfo_serialization.h>
#include "pickle_support.h"
using namespace boost::python;
using namespace hku;
void export_MarketInfo() {
class_<MarketInfo>("MarketInfo", init<>())
.def(init<const string&, const string&, const string&, const string&, const Datetime&>())
//.def(self_ns::str(self))
.def("__str__", &MarketInfo::toString)
.add_property("market", make_function(&MarketInfo::market, return_value_policy<copy_const_reference>()))
.add_property("name", make_function(&MarketInfo::name, return_value_policy<copy_const_reference>()))
.add_property("description", make_function(&MarketInfo::description, return_value_policy<copy_const_reference>()))
.add_property("code", make_function(&MarketInfo::code, return_value_policy<copy_const_reference>()))
.add_property("lastDate", &MarketInfo::lastDate)
#if HKU_PYTHON_SUPPORT_PICKLE
.def_pickle(normal_pickle_suite<MarketInfo>())
#endif
;
}