mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-02 20:08:26 +08:00
bc3a875a2c
2. Support C++17 3. Clear "tes_data/tmp"
48 lines
1.3 KiB
C++
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
|
|
;
|
|
|
|
}
|
|
|
|
|