hikyuu2/hikyuu_cpp/hikyuu/StockWeight.cpp
2019-11-10 19:45:57 +08:00

58 lines
1.5 KiB
C++

/*
* 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