Hikyuu
CostRecord.h
浏览该文件的文档.
1 /*
2  * CostRecord.h
3  *
4  * Created on: 2013-2-13
5  * Author: fasiondog
6  */
7 
8 #ifndef COSTRECORD_H_
9 #define COSTRECORD_H_
10 
11 #include "../DataType.h"
12 #include "../config.h"
13 
14 #if HKU_SUPPORT_SERIALIZATION
15 #include <boost/serialization/nvp.hpp>
16 #endif
17 
18 namespace hku {
19 
28 public:
29  CostRecord();
30  CostRecord(price_t commission, price_t stamptax, price_t transferfee,
31  price_t others, price_t total);
32 
39  string toString() const;
40 
41 #if HKU_SUPPORT_SERIALIZATION
42 private:
43  friend class boost::serialization::access;
44  template<class Archive>
45  void serialize(Archive & ar, const unsigned int version) {
46  ar & BOOST_SERIALIZATION_NVP(commission);
47  ar & BOOST_SERIALIZATION_NVP(stamptax);
48  ar & BOOST_SERIALIZATION_NVP(transferfee);
49  ar & BOOST_SERIALIZATION_NVP(others);
50  ar & BOOST_SERIALIZATION_NVP(total);
51  }
52 #endif /* HKU_SUPPORT_SERIALIZATION */
53 };
54 
59 HKU_API std::ostream& operator <<(std::ostream &os, const CostRecord&);
60 
61 
62 bool HKU_API operator==(const CostRecord& d1, const CostRecord&d2);
63 
64 
65 } /* namespace hku */
66 #endif /* COSTRECORD_H_ */
price_t commission
佣金
Definition: CostRecord.h:33
price_t stamptax
印花税
Definition: CostRecord.h:34
price_t total
总成本
Definition: CostRecord.h:37
#define HKU_API
Definition: DataType.h:12
HKU_API std::ostream & operator<<(std::ostream &os, const Block &blk)
Definition: Block.cpp:13
double price_t
Definition: DataType.h:53
bool operator==(const Datetime &, const Datetime &)
Definition: Datetime.h:201
成本记录
Definition: CostRecord.h:27
price_t others
其他费用
Definition: CostRecord.h:36
Hikyuu核心命名空间,包含股票数据的管理、指标实现、交易系统框架等
Definition: Block.cpp:11
price_t transferfee
过户费
Definition: CostRecord.h:35