/
StockWeight.cpp
57 lines (49 loc) · 1.48 KB
/
StockWeight.cpp
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
/*
* StockWeight.cpp
*
* Created on: 2011-12-9
* Author: fasiondog
*/
#include "StockWeight.h"
namespace hku {
HKU_API std::ostream& operator<<(std::ostream& os, const StockWeight& record) {
if (Null<StockWeight>() == record) {
os << "Weight(Null)";
return os;
}
os << "Weight(" << record.datetime() << ", " << record.countAsGift() << ", "
<< record.countForSell() << ", " << record.priceForSell() << ", " << record.bonus() << ", "
<< record.increasement() << ", " << record.totalCount() << ", " << record.freeCount() << ")";
os.precision(6);
return os;
}
StockWeight::StockWeight()
: m_datetime(Null<Datetime>()),
m_countAsGift(0),
m_countForSell(0),
m_priceForSell(0),
m_bonus(0),
m_increasement(0),
m_totalCount(0),
m_freeCount(0) {}
StockWeight::StockWeight(const Datetime& datetime)
: m_datetime(datetime),
m_countAsGift(0),
m_countForSell(0),
m_priceForSell(0),
m_bonus(0),
m_increasement(0),
m_totalCount(0),
m_freeCount(0) {}
StockWeight::StockWeight(const Datetime& datetime, price_t countAsGift, price_t countForSell,
price_t priceForSell, price_t bonus, price_t increasement,
price_t totalCount, price_t freeCount)
: m_datetime(datetime),
m_countAsGift(countAsGift),
m_countForSell(countForSell),
m_priceForSell(priceForSell),
m_bonus(bonus),
m_increasement(increasement),
m_totalCount(totalCount),
m_freeCount(freeCount) {}
} // namespace hku