Logo
Reference manual - version ored_version
Public Member Functions | List of all members
CommodityFixedLegData Class Reference
+ Inheritance diagram for CommodityFixedLegData:

Public Member Functions

 CommodityFixedLegData ()
 Default constructor.
 
 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="")
 Detailed constructor.
 
Inspectors
const std::vector< QuantLib::Real > & quantities () const
 
const std::vector< std::string > & quantityDates () const
 
const std::vector< QuantLib::Real > & prices () const
 
const std::vector< std::string > & priceDates () const
 
CommodityPayRelativeTo commodityPayRelativeTo () const
 
const std::string & tag () const
 
void setQuantities (const std::vector< QuantLib::Real > &quantities)
 Set the fixed leg data quantities. More...
 
- Public Member Functions inherited from LegAdditionalData
 LegAdditionalData (const string &legType, const string &legNodeName)
 
 LegAdditionalData (const string &legType)
 
const string & legType () const
 
const string & legNodeName () const
 
const std::set< std::string > & indices () const
 
- Public Member Functions inherited from XMLSerializable
void fromFile (const std::string &filename)
 
void toFile (const std::string &filename)
 
void fromXMLString (const std::string &xml)
 Parse from XML string.
 
std::string toXMLString ()
 Parse from XML string.
 

Serialisation

void fromXML (ore::data::XMLNode *node) override
 
ore::data::XMLNodetoXML (ore::data::XMLDocument &doc) override
 

Additional Inherited Members

- Protected Attributes inherited from LegAdditionalData
std::set< std::string > indices_
 

Member Function Documentation

◆ 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.