hikyuu2/hikyuu_pywrap/_KData.cpp

48 lines
1.3 KiB
C++
Raw Normal View History

2015-01-07 01:26:14 +08:00
/*
* _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() {
2017-09-28 01:59:12 +08:00
2015-01-07 01:26:14 +08:00
class_<KData>("KData", init<>())
.def(init<const KData&>())
.def(init<const Stock&, const KQuery&>())
2016-04-03 00:08:31 +08:00
//.def(self_ns::str(self))
.def("__str__", &KData::toString)
2015-01-07 01:26:14 +08:00
.add_property("startPos", &KData::startPos)
.add_property("endPos", &KData::endPos)
.add_property("lastPos", &KData::lastPos)
.def("getDatetimeList", &KData::getDatetimeList)
.def("getKRecord", &KData::getKRecord)
2016-04-08 13:02:08 +08:00
.def("get", &KData::getKRecord)
2015-01-07 01:26:14 +08:00
.def("getKRecordByDate", &KData::getKRecordByDate)
2016-04-08 13:02:08 +08:00
.def("getByDate", &KData::getKRecordByDate)
2016-04-03 00:08:31 +08:00
.def("_getPos", &KData::getPos) //python中需要将Null的情况改写为None
2015-01-07 01:26:14 +08:00
.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
;
}