/
TimeLineRecord.h
69 lines (56 loc) · 1.28 KB
/
TimeLineRecord.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* TimeLineRecord.h
*
* Created on: 2019-1-27
* Author: fasiondog
*/
#pragma once
#ifndef TIMELINERECORD_H_
#define TIMELINERECORD_H_
#include "DataType.h"
namespace hku {
/**
* 分时线记录
* @ingroup StockManage
*/
class HKU_API TimeLineRecord {
public:
Datetime datetime;
price_t price;
price_t vol;
TimeLineRecord();
TimeLineRecord(const Datetime& datetime, price_t price, price_t vol);
bool isValid() const;
};
/**
* 分时线
* @ingroup StockManage
*/
typedef vector<TimeLineRecord> TimeLineList;
/** @ingroup StockManage */
typedef shared_ptr<TimeLineList> TimeLineListPtr;
/**
* 输出TimeLineRecord信息,如:TimeSharingRecord(datetime, price, vol)
* @ingroup StockManage
*/
HKU_API std::ostream& operator<<(std::ostream&, const TimeLineRecord&);
/**
* 输出TimeLine信息
* @details
* <pre>
* TimeLine{
* size : 738501
* start: YYYY-MM-DD hh:mm:ss
* last : YYYY-MM-DD hh:mm:ss
* }
* </pre>
* @ingroup StockManage
*/
HKU_API std::ostream& operator<<(std::ostream& os, const TimeLineList&);
/**
* 比较两个TimeLineRecord是否相等,一般仅测试时使用
* @ingroup StockManage
*/
bool HKU_API operator==(const TimeLineRecord& d1, const TimeLineRecord& d2);
} /* namespace hku */
#endif /* TIMELINERECORD_H_ */