32 : rulesBased_(false), lag_(0), convention_(Following), relativeTo_(
RelativeTo::
Expiry) {}
35 : strDates_(dates), rulesBased_(false), lag_(0), convention_(Following), relativeTo_(
RelativeTo::
Expiry) {
40 const string& relativeTo)
41 : strLag_(lag), strCalendar_(
calendar), strConvention_(convention), strRelativeTo_(relativeTo), rulesBased_(true),
60 QL_FAIL(
"Expected that PaymentData node has a PaymentDates or PaymentRules child node.");
89 QL_REQUIRE(
strDates_.size() > 0,
"Expected at least 1 option payment date.");
103 QL_FAIL(
"Could not convert string " <<
strRelativeTo_ <<
" to a valid RelativeTo value.");
108 switch (relativeTo) {
110 return out <<
"Expiry";
112 return out <<
"Exercise";
114 QL_FAIL(
"Could not convert the relativeTo enum value to string.");
void init()
Initialisation.
void populateRelativeTo()
Populate the value of relativeTo_ member from string.
std::vector< QuantLib::Date > dates_
virtual void fromXML(XMLNode *node) override
std::string strRelativeTo_
virtual XMLNode * toXML(XMLDocument &doc) const override
QuantLib::Calendar calendar_
OptionPaymentData()
Default constructor.
RelativeTo
When we have payment rules, specifies what date the payment is relative to.
QuantLib::BusinessDayConvention convention_
std::vector< std::string > strDates_
std::string strConvention_
Small XML Document wrapper class.
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
static void addChildren(XMLDocument &doc, XMLNode *n, const string &names, const string &name, const vector< T > &values)
static void checkNode(XMLNode *n, const string &expectedName)
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.
static vector< string > getChildrenValues(XMLNode *node, const string &names, const string &name, bool mandatory=false)
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
static void appendNode(XMLNode *parent, XMLNode *child)
Calendar parseCalendar(const string &s)
Convert text to QuantLib::Calendar.
Date parseDate(const string &s)
Convert std::string to QuantLib::Date.
BusinessDayConvention parseBusinessDayConvention(const string &s)
Convert text to QuantLib::BusinessDayConvention.
Integer parseInteger(const string &s)
Convert text to QuantLib::Integer.
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
Serializable Credit Default Swap.
option payment data model and serialization
Map text representations to QuantLib/QuantExt types.