Hikyuu
KDataDriver.h
浏览该文件的文档.
1 /*
2  * KDataDriver.h
3  *
4  * Created on: 2012-9-8
5  * Author: fasiondog
6  */
7 
8 #ifndef KDATADRIVER_H_
9 #define KDATADRIVER_H_
10 
11 #include "../utilities/Parameter.h"
12 #include "../KQuery.h"
13 #include "../TimeLineRecord.h"
14 #include "../TransRecord.h"
15 
16 namespace hku {
17 
23 
24 public:
25  KDataDriver();
26  KDataDriver(const string& name);
27  virtual ~KDataDriver() { }
28 
29  const string& name() const;
30 
31  bool init(const Parameter&);
32 
37  virtual bool _init() {
38  return true;
39  }
40 
41 
51  virtual void loadKData(const string& market, const string& code,
52  KQuery::KType kType, size_t start_ix, size_t end_ix,
53  KRecordListPtr out_buffer) ;
54 
62  virtual size_t getCount(const string& market, const string& code,
63  KQuery::KType kType);
64 
74  virtual bool getIndexRangeByDate(const string& market, const string& code,
75  const KQuery& query, size_t& out_start, size_t& out_end);
76 
85  virtual KRecord getKRecord(const string& market, const string& code,
86  size_t pos, KQuery::KType kType);
87 
95  virtual TimeLineList getTimeLineList(const string& market, const string& code,
96  const KQuery& query);
97 
105  virtual TransList getTransList(const string& market, const string& code,
106  const KQuery& query);
107 
108 private:
109  bool checkType();
110 
111 private:
112  string m_name;
113 };
114 
115 
116 typedef shared_ptr<KDataDriver> KDataDriverPtr;
117 
118 
119 HKU_API std::ostream & operator<<(std::ostream&, const KDataDriver&);
120 HKU_API std::ostream & operator<<(std::ostream&, const KDataDriverPtr&);
121 
122 inline const string& KDataDriver::name() const {
123  return m_name;
124 }
125 
126 } /* namespace */
127 
128 #endif /* KDATADRIVER_H_ */
virtual bool _init()
子类初始化私有变量接口
Definition: KDataDriver.h:37
供需要命名参数设定的类使用
Definition: Parameter.h:101
K线数据记录
Definition: KRecord.h:19
shared_ptr< KDataDriver > KDataDriverPtr
Definition: KDataDriver.h:116
按索引方式查询K线数据条件
Definition: KQuery.h:19
const string & name() const
Definition: KDataDriver.h:122
vector< TransRecord > TransList
分时线
Definition: TransRecord.h:44
K线数据驱动基类
Definition: KDataDriver.h:21
vector< TimeLineRecord > TimeLineList
分时线
Definition: TimeLineRecord.h:35
#define HKU_API
Definition: DataType.h:12
HKU_API std::ostream & operator<<(std::ostream &os, const Block &blk)
Definition: Block.cpp:13
string KType
查询K线类型:日线/周线等
Definition: KQuery.h:51
shared_ptr< KRecordList > KRecordListPtr
Definition: KRecord.h:56
virtual ~KDataDriver()
Definition: KDataDriver.h:27
#define PARAMETER_SUPPORT
Definition: Parameter.h:233
Hikyuu核心命名空间,包含股票数据的管理、指标实现、交易系统框架等
Definition: Block.cpp:11