2019-02-08 22:41:20 +08:00
|
|
|
|
/*
|
|
|
|
|
* TimeLineRecord.h
|
|
|
|
|
*
|
|
|
|
|
* Created on: 2019-1-27
|
|
|
|
|
* Author: fasiondog
|
|
|
|
|
*/
|
|
|
|
|
|
2019-08-03 21:53:24 +08:00
|
|
|
|
#pragma once
|
2019-02-08 22:41:20 +08:00
|
|
|
|
#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;
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-09 18:25:16 +08:00
|
|
|
|
/**
|
|
|
|
|
* 分时线
|
|
|
|
|
* @ingroup StockManage
|
|
|
|
|
*/
|
2019-02-11 16:33:55 +08:00
|
|
|
|
typedef vector<TimeLineRecord> TimeLineList;
|
2019-02-08 22:41:20 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-02-09 18:25:16 +08:00
|
|
|
|
* 输出TimeLineRecord信息,如:TimeSharingRecord(datetime, price, vol)
|
2019-02-08 22:41:20 +08:00
|
|
|
|
* @ingroup StockManage
|
|
|
|
|
*/
|
2019-11-10 19:45:57 +08:00
|
|
|
|
HKU_API std::ostream& operator<<(std::ostream&, const TimeLineRecord&);
|
2019-02-08 22:41:20 +08:00
|
|
|
|
|
2019-02-09 18:25:16 +08:00
|
|
|
|
/**
|
|
|
|
|
* 输出TimeLine信息
|
|
|
|
|
* @details
|
|
|
|
|
* <pre>
|
|
|
|
|
* TimeLine{
|
|
|
|
|
* size : 738501
|
|
|
|
|
* start: YYYY-MM-DD hh:mm:ss
|
|
|
|
|
* last : YYYY-MM-DD hh:mm:ss
|
|
|
|
|
* }
|
|
|
|
|
* </pre>
|
|
|
|
|
* @ingroup StockManage
|
|
|
|
|
*/
|
2019-11-10 19:45:57 +08:00
|
|
|
|
HKU_API std::ostream& operator<<(std::ostream& os, const TimeLineList&);
|
2019-02-08 22:41:20 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-02-09 18:25:16 +08:00
|
|
|
|
* 比较两个TimeLineRecord是否相等,一般仅测试时使用
|
2019-02-08 22:41:20 +08:00
|
|
|
|
* @ingroup StockManage
|
|
|
|
|
*/
|
2019-11-10 19:45:57 +08:00
|
|
|
|
bool HKU_API operator==(const TimeLineRecord& d1, const TimeLineRecord& d2);
|
2019-02-08 22:41:20 +08:00
|
|
|
|
|
|
|
|
|
} /* namespace hku */
|
|
|
|
|
|
2023-07-28 23:50:26 +08:00
|
|
|
|
#if FMT_VERSION >= 90000
|
|
|
|
|
template <>
|
|
|
|
|
struct fmt::formatter<hku::TimeLineRecord> : ostream_formatter {};
|
|
|
|
|
#endif
|
|
|
|
|
|
2019-02-08 22:41:20 +08:00
|
|
|
|
#endif /* TIMELINERECORD_H_ */
|