Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
BondBasketReferenceDatum Class Reference

Bond Basket Reference Data. More...

#include <ored/portfolio/referencedata.hpp>

+ Inheritance diagram for BondBasketReferenceDatum:
+ Collaboration diagram for BondBasketReferenceDatum:

Public Member Functions

 BondBasketReferenceDatum ()
 
 BondBasketReferenceDatum (const std::string &id)
 
 BondBasketReferenceDatum (const std::string &id, const QuantLib::Date &validFrom)
 
 BondBasketReferenceDatum (const std::string &id, const std::vector< BondUnderlying > &underlyingData)
 
 BondBasketReferenceDatum (const std::string &id, const QuantLib::Date &validFrom, const std::vector< BondUnderlying > &underlyingData)
 
void fromXML (XMLNode *node) override
 
XMLNodetoXML (ore::data::XMLDocument &doc) const override
 
const std::vector< BondUnderlying > & underlyingData () const
 
- Public Member Functions inherited from ReferenceDatum
 ReferenceDatum ()
 Default Constructor. More...
 
 ReferenceDatum (const std::string &type, const std::string &id)
 Base class constructor. More...
 
 ReferenceDatum (const std::string &type, const std::string &id, const QuantLib::Date &validFrom)
 Base class constructor. More...
 
void setType (const string &type)
 setters More...
 
void setId (const string &id)
 
void setValidFrom (const QuantLib::Date &validFrom)
 
const std::string & type () const
 getters More...
 
const std::string & id () const
 
const QuantLib::Date & validFrom () const
 
void fromXML (XMLNode *node) override
 
XMLNodetoXML (ore::data::XMLDocument &doc) const override
 
- Public Member Functions inherited from XMLSerializable
virtual ~XMLSerializable ()
 
virtual void fromXML (XMLNode *node)=0
 
virtual XMLNodetoXML (XMLDocument &doc) const =0
 
void fromFile (const std::string &filename)
 
void toFile (const std::string &filename) const
 
void fromXMLString (const std::string &xml)
 Parse from XML string. More...
 
std::string toXMLString () const
 Parse from XML string. More...
 

Static Public Attributes

static constexpr const char * TYPE = "BondBasket"
 

Private Attributes

std::vector< BondUnderlyingunderlyingData_
 

Detailed Description

Bond Basket Reference Data.

Definition at line 505 of file referencedata.hpp.

Constructor & Destructor Documentation

◆ BondBasketReferenceDatum() [1/5]

Definition at line 509 of file referencedata.hpp.

509{ setType(TYPE); }
static constexpr const char * TYPE
void setType(const string &type)
setters
+ Here is the call graph for this function:

◆ BondBasketReferenceDatum() [2/5]

BondBasketReferenceDatum ( const std::string &  id)

Definition at line 511 of file referencedata.hpp.

Base class for reference data.

◆ BondBasketReferenceDatum() [3/5]

BondBasketReferenceDatum ( const std::string &  id,
const QuantLib::Date &  validFrom 
)

Definition at line 513 of file referencedata.hpp.

const QuantLib::Date & validFrom() const

◆ BondBasketReferenceDatum() [4/5]

BondBasketReferenceDatum ( const std::string &  id,
const std::vector< BondUnderlying > &  underlyingData 
)

Definition at line 515 of file referencedata.hpp.

const std::vector< BondUnderlying > & underlyingData() const
std::vector< BondUnderlying > underlyingData_
ReferenceDatum()
Default Constructor.

◆ BondBasketReferenceDatum() [5/5]

BondBasketReferenceDatum ( const std::string &  id,
const QuantLib::Date &  validFrom,
const std::vector< BondUnderlying > &  underlyingData 
)

Definition at line 518 of file referencedata.hpp.

Member Function Documentation

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Reimplemented from ReferenceDatum.

Definition at line 596 of file referencedata.cpp.

596 {
598 XMLNode* b = XMLUtils::getChildNode(node, "BondBasketData");
599 QL_REQUIRE(b, "No BondBasketData node");
600 underlyingData_.clear();
601 auto c = XMLUtils::getChildrenNodes(b, "Underlying");
602 for (auto const n : c) {
603 underlyingData_.push_back(BondUnderlying());
604 underlyingData_.back().fromXML(n);
605 }
606}
void fromXML(XMLNode *node) override
static vector< XMLNode * > getChildrenNodes(XMLNode *node, const string &name)
Returns all the children with a given name.
Definition: xmlutils.cpp:428
static XMLNode * getChildNode(XMLNode *n, const string &name="")
Definition: xmlutils.cpp:387
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( ore::data::XMLDocument doc) const
overridevirtual

Reimplemented from ReferenceDatum.

Definition at line 608 of file referencedata.cpp.

608 {
609 XMLNode* res = ReferenceDatum::toXML(doc);
610 XMLNode* node = doc.allocNode("BondBasketData");
611 XMLUtils::appendNode(res, node);
612 for (auto& u : underlyingData_) {
613 XMLUtils::appendNode(node, u.toXML(doc));
614 }
615 return res;
616}
XMLNode * toXML(ore::data::XMLDocument &doc) const override
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
Definition: xmlutils.cpp:132
static void appendNode(XMLNode *parent, XMLNode *child)
Definition: xmlutils.cpp:406
+ Here is the call graph for this function:

◆ underlyingData()

const std::vector< BondUnderlying > & underlyingData ( ) const

Definition at line 525 of file referencedata.hpp.

525{ return underlyingData_; }

Member Data Documentation

◆ TYPE

constexpr const char* TYPE = "BondBasket"
staticconstexpr

Definition at line 507 of file referencedata.hpp.

◆ underlyingData_

std::vector<BondUnderlying> underlyingData_
private

Definition at line 528 of file referencedata.hpp.