hikyuu2/hikyuu_pywrap/_KData.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

48 lines
1.3 KiB
C++

/*
* _KData.cpp
*
* Created on: 2012-9-28
* Author: fasiondog
*/
#include <boost/python.hpp>
#include <hikyuu/serialization/KData_serialization.h>
#include "pickle_support.h"
using namespace boost::python;
using namespace hku;
void export_KData() {
class_<KData>("KData", init<>())
.def(init<const KData&>())
.def(init<const Stock&, const KQuery&>())
//.def(self_ns::str(self))
.def("__str__", &KData::toString)
.add_property("startPos", &KData::startPos)
.add_property("endPos", &KData::endPos)
.add_property("lastPos", &KData::lastPos)
.def("getDatetimeList", &KData::getDatetimeList)
.def("getKRecord", &KData::getKRecord)
.def("get", &KData::getKRecord)
.def("getKRecordByDate", &KData::getKRecordByDate)
.def("getByDate", &KData::getKRecordByDate)
.def("_getPos", &KData::getPos) //python中需要将Null的情况改写为None
.def("size", &KData::size)
.def("empty", &KData::empty)
.def("getQuery", &KData::getQuery)
.def("getStock", &KData::getStock)
.def("tocsv", &KData::tocsv)
.def("__len__", &KData::size)
#if HKU_PYTHON_SUPPORT_PICKLE
.def_pickle(normal_pickle_suite<KData>())
#endif
;
}