/* * _KRecord.cpp * * Created on: 2012-9-28 * Author: fasiondog */ #include #include #include "pickle_support.h" using namespace boost::python; using namespace hku; bool (*krecord_eq)(const KRecord&, const KRecord&) = operator==; void export_KReord() { class_("KRecord", init<>()) .def(init()) .def(init()) .def(self_ns::str(self)) .def_readwrite("datetime", &KRecord::datetime) .def_readwrite("openPrice", &KRecord::openPrice) .def_readwrite("highPrice", &KRecord::highPrice) .def_readwrite("lowPrice", &KRecord::lowPrice) .def_readwrite("closePrice", &KRecord::closePrice) .def_readwrite("transAmount", &KRecord::transAmount) .def_readwrite("transCount", &KRecord::transCount) .def("__eq__", krecord_eq) #if HKU_PYTHON_SUPPORT_PICKLE .def_pickle(normal_pickle_suite()) #endif ; KRecordList::const_reference (KRecordList::*KRecordList_at)(KRecordList::size_type) const = &KRecordList::at; class_("KRecordList") .def("__iter__", iterator()) .def("size", &KRecordList::size) .def("__len__", &KRecordList::size) .def("__getitem__", KRecordList_at, return_value_policy()) ; }