27 : secondaryCosts_(
std::move(secondaryCosts)) {}
38 const std::string& error,
39 const std::string& detail)
const {
46 std::string currencyCode;
49 out <<
"secondary costs" << std::endl;
50 for (
const auto& secondaryCostAmount : secondaryCostAmounts) {
51 Real amount = secondaryCostAmount.second.value();
52 if (currencyCode.empty())
53 currencyCode = secondaryCostAmount.second.currency().code();
54 totalAmount += amount;
55 out << std::setw(28) << std::left << secondaryCostAmount.first << std::setw(12)
56 << std::right << std::fixed << std::setprecision(2) << amount <<
" " << currencyCode
59 out << std::setw(28) << std::left <<
"total"
60 << std::setw(12) << std::right << std::fixed
61 << std::setprecision(2) << totalAmount <<
" " << currencyCode
84 out <<
": " << error.
detail;
89 if (!errors.empty()) {
90 out <<
"*** pricing errors" << std::endl;
91 for (
const auto& error : errors)
92 out << error << std::endl;
const PricingErrors & pricingErrors() const
const SecondaryCostAmounts & secondaryCostAmounts() const
Commodity(ext::shared_ptr< SecondaryCosts > secondaryCosts)
void addPricingError(PricingError::Level errorLevel, const std::string &error, const std::string &detail="") const
SecondaryCostAmounts secondaryCostAmounts_
PricingErrors pricingErrors_
std::vector< PricingError > PricingErrors
std::ostream & operator<<(std::ostream &out, GFunctionFactory::YieldCurveModel type)
std::map< std::string, Money > SecondaryCostAmounts