hikyuu2/hikyuu_cpp/hikyuu/trade_manage/TradeCostBase.cpp
2019-11-10 23:31:41 +08:00

39 lines
797 B
C++

/*
* TradeCostBase.cpp
*
* Created on: 2013-2-13
* Author: fasiondog
*/
#include "TradeCostBase.h"
namespace hku {
HKU_API std::ostream& operator<<(std::ostream& os, const TradeCostBase& tc) {
os << "TradeCostFunc(" << tc.name() << ", " << tc.getParameter() << ")";
return os;
}
HKU_API std::ostream& operator<<(std::ostream& os, const TradeCostPtr& tc) {
if (tc) {
os << *tc;
} else {
os << "TradeCostFunc(NULL)";
}
return os;
}
TradeCostBase::TradeCostBase(const string& name) : m_name(name) {}
TradeCostBase::~TradeCostBase() {}
TradeCostPtr TradeCostBase::clone() {
TradeCostPtr result = _clone();
TradeCostBase* p = result.get();
p->m_params = m_params;
p->m_name = m_name;
return result;
}
} /* namespace hku */