#include <ored/portfolio/commoditylegdata.hpp>
Definition at line 50 of file commoditylegdata.hpp.
◆ CommodityFixedLegData() [1/2]
Default constructor.
Definition at line 120 of file commoditylegdata.cpp.
CommodityPayRelativeTo commodityPayRelativeTo_
Serializable Additional Leg Data.
@ CalculationPeriodEndDate
◆ CommodityFixedLegData() [2/2]
CommodityFixedLegData |
( |
const std::vector< QuantLib::Real > & |
quantities, |
|
|
const std::vector< std::string > & |
quantityDates, |
|
|
const std::vector< QuantLib::Real > & |
prices, |
|
|
const std::vector< std::string > & |
priceDates, |
|
|
CommodityPayRelativeTo |
commodityPayRelativeTo, |
|
|
const std::string & |
tag = "" |
|
) |
| |
◆ quantities()
const std::vector< QuantLib::Real > & quantities |
( |
| ) |
const |
◆ quantityDates()
const std::vector< std::string > & quantityDates |
( |
| ) |
const |
◆ prices()
const std::vector< QuantLib::Real > & prices |
( |
| ) |
const |
◆ priceDates()
const std::vector< std::string > & priceDates |
( |
| ) |
const |
◆ commodityPayRelativeTo()
◆ tag()
const std::string & tag |
( |
| ) |
const |
◆ setQuantities()
void setQuantities |
( |
const std::vector< QuantLib::Real > & |
quantities | ) |
|
Set the fixed leg data quantities.
For commodity swaps, there can be a number of conventions provided with the floating leg data quantities that when taken together can be used to calculate the commodity quantity for the full calculation period. Instead of duplicating that data here, we allow the fixed leg data quantities to be set using this method before being passed to the commodity fixed leg builder. The idea is that the quantities will be set by referencing the quantities from the corresponding floating leg of the swap after that leg has been built.
Definition at line 130 of file commoditylegdata.cpp.
130 {
131
134}
const std::vector< QuantLib::Real > & quantities() const
◆ fromXML()
Implements XMLSerializable.
Definition at line 136 of file commoditylegdata.cpp.
136 {
138
141 quantities_ = XMLUtils::getChildrenValuesWithAttributes<Real>(node,
"Quantities",
"Quantity",
143 }
144
145 prices_ = XMLUtils::getChildrenValuesWithAttributes<Real>(node,
"Prices",
"Price",
"startDate",
priceDates_,
146 &parseReal, true);
147
151 }
153}
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.
rapidxml::xml_node< char > XMLNode
CommodityPayRelativeTo parseCommodityPayRelativeTo(const string &s)
◆ toXML()
Implements XMLSerializable.
Definition at line 155 of file commoditylegdata.cpp.
155 {
157
161 }
162
167
168 return node;
169}
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
static void addChildrenWithOptionalAttributes(XMLDocument &doc, XMLNode *n, const string &names, const string &name, const vector< T > &values, const string &attrName, const vector< string > &attrs)
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
std::string to_string(const LocationInfo &l)
◆ quantities_
std::vector<QuantLib::Real> quantities_ |
|
private |
◆ quantityDates_
std::vector<std::string> quantityDates_ |
|
private |
◆ prices_
std::vector<QuantLib::Real> prices_ |
|
private |
◆ priceDates_
std::vector<std::string> priceDates_ |
|
private |
◆ commodityPayRelativeTo_
◆ tag_