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

Serializable Tranche for use in Balance Guaranteed Swaps. More...

#include <ored/portfolio/balanceguaranteedswap.hpp>

+ Inheritance diagram for BGSTrancheData:
+ Collaboration diagram for BGSTrancheData:

Public Member Functions

 BGSTrancheData ()
 
 BGSTrancheData (const std::string &description, const std::string &securityId, const int seniority, const std::vector< QuantLib::Real > &notionals, const std::vector< std::string > &notionalDates)
 
Inspectors
const std::string & description () const
 
const std::string & securityId () const
 
int seniority () const
 
const std::vector< QuantLib::Real > & notionals () const
 
const std::vector< std::string > & notionalDates () const
 
- 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...
 

Serialisation

std::string description_
 
std::string securityId_
 
int seniority_
 
std::vector< QuantLib::Real > notionals_
 
std::vector< std::string > notionalDates_
 
virtual void fromXML (ore::data::XMLNode *node) override
 
virtual ore::data::XMLNodetoXML (ore::data::XMLDocument &doc) const override
 

Detailed Description

Serializable Tranche for use in Balance Guaranteed Swaps.

Definition at line 36 of file balanceguaranteedswap.hpp.

Constructor & Destructor Documentation

◆ BGSTrancheData() [1/2]

Definition at line 38 of file balanceguaranteedswap.hpp.

38{}

◆ BGSTrancheData() [2/2]

BGSTrancheData ( const std::string &  description,
const std::string &  securityId,
const int  seniority,
const std::vector< QuantLib::Real > &  notionals,
const std::vector< std::string > &  notionalDates 
)

Definition at line 39 of file balanceguaranteedswap.hpp.

const std::vector< QuantLib::Real > & notionals() const
std::vector< std::string > notionalDates_
std::vector< QuantLib::Real > notionals_
const std::vector< std::string > & notionalDates() const
const std::string & description() const
const std::string & securityId() const

Member Function Documentation

◆ description()

const std::string & description ( ) const

Definition at line 46 of file balanceguaranteedswap.hpp.

46{ return description_; }

◆ securityId()

const std::string & securityId ( ) const

Definition at line 47 of file balanceguaranteedswap.hpp.

47{ return securityId_; }

◆ seniority()

int seniority ( ) const

Definition at line 48 of file balanceguaranteedswap.hpp.

48{ return seniority_; }

◆ notionals()

const std::vector< QuantLib::Real > & notionals ( ) const

Definition at line 49 of file balanceguaranteedswap.hpp.

49{ return notionals_; }

◆ notionalDates()

const std::vector< std::string > & notionalDates ( ) const

Definition at line 50 of file balanceguaranteedswap.hpp.

50{ return notionalDates_; }

◆ fromXML()

void fromXML ( ore::data::XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 36 of file balanceguaranteedswap.cpp.

36 {
37 XMLUtils::checkNode(node, "Tranche");
38 description_ = XMLUtils::getChildValue(node, "Description", false);
39 securityId_ = XMLUtils::getChildValue(node, "SecurityId", true);
40 seniority_ = XMLUtils::getChildValueAsInt(node, "Seniority", true);
41 notionals_ = XMLUtils::getChildrenValuesWithAttributes<Real>(node, "Notionals", "Notional", "startDate",
42 notionalDates_, &parseReal, true);
43}
static void checkNode(XMLNode *n, const string &expectedName)
Definition: xmlutils.cpp:175
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
Definition: xmlutils.cpp:277
static int getChildValueAsInt(XMLNode *node, const string &name, bool mandatory=false, int defaultValue=0)
Definition: xmlutils.cpp:291
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toXML()

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

Implements XMLSerializable.

Definition at line 45 of file balanceguaranteedswap.cpp.

45 {
46 XMLNode* node = doc.allocNode("Tranche");
47 XMLUtils::addChild(doc, node, "Description", description_);
48 XMLUtils::addChild(doc, node, "SecurityId", securityId_);
49 XMLUtils::addChildrenWithOptionalAttributes(doc, node, "Notionals", "Notional", notionals_, "startDate",
51 return node;
52}
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
Definition: xmlutils.cpp:132
static void addChildrenWithOptionalAttributes(XMLDocument &doc, XMLNode *n, const string &names, const string &name, const vector< T > &values, const string &attrName, const vector< string > &attrs)
Definition: xmlutils.cpp:542
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:

Member Data Documentation

◆ description_

std::string description_
private

Definition at line 60 of file balanceguaranteedswap.hpp.

◆ securityId_

std::string securityId_
private

Definition at line 61 of file balanceguaranteedswap.hpp.

◆ seniority_

int seniority_
private

Definition at line 62 of file balanceguaranteedswap.hpp.

◆ notionals_

std::vector<QuantLib::Real> notionals_
private

Definition at line 63 of file balanceguaranteedswap.hpp.

◆ notionalDates_

std::vector<std::string> notionalDates_
private

Definition at line 64 of file balanceguaranteedswap.hpp.