37 {
38
39
40
44
45 if (depr_amount_node != nullptr) {
47 if (!amountStr.empty()) {
50 QL_REQUIRE(depr_ccy_node, "PremiumAmount (" << amount << ") given, but no PremiumCurrency");
51 QL_REQUIRE(depr_date_node, "PremiumAmount (" << amount << ") given, but no PremiumPayDate");
54 QL_REQUIRE(!ccyStr.empty(), "PremiumAmount (" << amount << ") given, but no PremiumCurrency");
55 QL_REQUIRE(!dateStr.empty(), "PremiumAmount (" << amount << ") given, but no PremiumPayDate");
57 }
58 }
59 }
60
61
62
64 QL_REQUIRE(
premiumData_.empty(),
"Single PremiumAmount and Premiums node are not allowed simultaneously. Move "
65 "the single premium to the Premiums node instead.");
67 PremiumDatum d;
72 }
73 }
74}
static vector< XMLNode * > getChildrenNodes(XMLNode *node, const string &name)
Returns all the children with a given name.
static Real getChildValueAsDouble(XMLNode *node, const string &name, bool mandatory=false, double defaultValue=0.0)
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
static XMLNode * getChildNode(XMLNode *n, const string &name="")
static string getNodeValue(XMLNode *node)
Get a node's value.
Date parseDate(const string &s)
Convert std::string to QuantLib::Date.
Real parseReal(const string &s)
Convert text to Real.
Filter close_enough(const RandomVariable &x, const RandomVariable &y)