Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
List of all members
DiscountRatioYieldCurveSegment Class Reference

Discount ratio yield curve segment. More...

#include <ored/configuration/yieldcurveconfig.hpp>

+ Inheritance diagram for DiscountRatioYieldCurveSegment:
+ Collaboration diagram for DiscountRatioYieldCurveSegment:

Public Member Functions

Constructors/Destructors
 DiscountRatioYieldCurveSegment ()
 Default constructor. More...
 
 DiscountRatioYieldCurveSegment (const std::string &typeId, const std::string &baseCurveId, const std::string &baseCurveCurrency, const std::string &numeratorCurveId, const std::string &numeratorCurveCurrency, const std::string &denominatorCurveId, const std::string &denominatorCurveCurrency)
 Detailed constructor. More...
 
Serialisation
virtual void fromXML (XMLNode *node) override
 
virtual XMLNodetoXML (XMLDocument &doc) const override
 
Inspectors
const string & baseCurveId () const
 
const string & baseCurveCurrency () const
 
const string & numeratorCurveId () const
 
const string & numeratorCurveCurrency () const
 
const string & denominatorCurveId () const
 
const string & denominatorCurveCurrency () const
 
- Public Member Functions inherited from YieldCurveSegment
virtual ~YieldCurveSegment ()
 Default destructor. More...
 
Type type () const
 
const string & typeID () const
 
const string & conventionsID () const
 
const QuantLib::Pillar::Choice pillarChoice () const
 
Size priority () const
 
Size minDistance () const
 
const vector< pair< string, bool > > & quotes () const
 
virtual void accept (AcyclicVisitor &)
 
- 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...
 

Visitability

std::string baseCurveId_
 
std::string baseCurveCurrency_
 
std::string numeratorCurveId_
 
std::string numeratorCurveCurrency_
 
std::string denominatorCurveId_
 
std::string denominatorCurveCurrency_
 
void accept (QuantLib::AcyclicVisitor &v) override
 

Additional Inherited Members

- Public Types inherited from YieldCurveSegment
enum class  Type {
  Zero , ZeroSpread , Discount , Deposit ,
  FRA , Future , OIS , Swap ,
  AverageOIS , TenorBasis , TenorBasisTwo , BMABasis ,
  FXForward , CrossCcyBasis , CrossCcyFixFloat , DiscountRatio ,
  FittedBond , WeightedAverage , YieldPlusDefault , IborFallback ,
  BondYieldShifted
}
 supported segment types More...
 
- Protected Member Functions inherited from YieldCurveSegment
 YieldCurveSegment ()
 Default constructor. More...
 
 YieldCurveSegment (const string &typeID, const string &conventionsID, const vector< string > &quotes)
 Detailed constructor - assumes all quotes are mandatory. More...
 
pair< string, boolquote (const string &name, bool opt=false)
 Utility to build a quote, optional flag defaults to false. More...
 
- Protected Attributes inherited from YieldCurveSegment
vector< pair< string, bool > > quotes_
 Quote and optional flag pair. More...
 

Detailed Description

Discount ratio yield curve segment.

Used to configure a QuantExt::DiscountRatioModifiedCurve.

Definition at line 473 of file yieldcurveconfig.hpp.

Constructor & Destructor Documentation

◆ DiscountRatioYieldCurveSegment() [1/2]

Default constructor.

Definition at line 478 of file yieldcurveconfig.hpp.

478{}

◆ DiscountRatioYieldCurveSegment() [2/2]

DiscountRatioYieldCurveSegment ( const std::string &  typeId,
const std::string &  baseCurveId,
const std::string &  baseCurveCurrency,
const std::string &  numeratorCurveId,
const std::string &  numeratorCurveCurrency,
const std::string &  denominatorCurveId,
const std::string &  denominatorCurveCurrency 
)

Detailed constructor.

Definition at line 671 of file yieldcurveconfig.cpp.

YieldCurveSegment()
Default constructor.

Member Function Documentation

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Reimplemented from YieldCurveSegment.

Definition at line 678 of file yieldcurveconfig.cpp.

678 {
679 XMLUtils::checkNode(node, "DiscountRatio");
681
682 XMLNode* aNode = XMLUtils::getChildNode(node, "BaseCurve");
683 QL_REQUIRE(aNode, "Discount ratio segment needs a BaseCurve node");
685 baseCurveCurrency_ = XMLUtils::getAttribute(aNode, "currency");
686
687 aNode = XMLUtils::getChildNode(node, "NumeratorCurve");
688 QL_REQUIRE(aNode, "Discount ratio segment needs a NumeratorCurve node");
691
692 aNode = XMLUtils::getChildNode(node, "DenominatorCurve");
693 QL_REQUIRE(aNode, "Discount ratio segment needs a DenominatorCurve node");
696}
static string getAttribute(XMLNode *node, const string &attrName)
Definition: xmlutils.cpp:419
static void checkNode(XMLNode *n, const string &expectedName)
Definition: xmlutils.cpp:175
static XMLNode * getChildNode(XMLNode *n, const string &name="")
Definition: xmlutils.cpp:387
static string getNodeValue(XMLNode *node)
Get a node's value.
Definition: xmlutils.cpp:489
virtual void fromXML(XMLNode *node) override
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Reimplemented from YieldCurveSegment.

Definition at line 698 of file yieldcurveconfig.cpp.

698 {
700 XMLUtils::setNodeName(doc, node, "DiscountRatio");
701
702 XMLNode* baseCurveNode = doc.allocNode("BaseCurve", baseCurveId_);
703 XMLUtils::appendNode(node, baseCurveNode);
704 XMLUtils::addAttribute(doc, baseCurveNode, "currency", baseCurveCurrency_);
705
706 XMLNode* numCurveNode = doc.allocNode("NumeratorCurve", numeratorCurveId_);
707 XMLUtils::appendNode(node, numCurveNode);
708 XMLUtils::addAttribute(doc, numCurveNode, "currency", numeratorCurveCurrency_);
709
710 XMLNode* denCurveNode = doc.allocNode("DenominatorCurve", denominatorCurveId_);
711 XMLUtils::appendNode(node, denCurveNode);
712 XMLUtils::addAttribute(doc, denCurveNode, "currency", denominatorCurveCurrency_);
713
714 return node;
715}
static void addAttribute(XMLDocument &doc, XMLNode *node, const string &attrName, const string &attrValue)
Definition: xmlutils.cpp:412
static void setNodeName(XMLDocument &doc, XMLNode *node, const string &name)
Definition: xmlutils.cpp:478
static void appendNode(XMLNode *parent, XMLNode *child)
Definition: xmlutils.cpp:406
virtual XMLNode * toXML(XMLDocument &doc) const override
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ baseCurveId()

const string & baseCurveId ( ) const

Definition at line 494 of file yieldcurveconfig.hpp.

494{ return baseCurveId_; }
+ Here is the caller graph for this function:

◆ baseCurveCurrency()

const string & baseCurveCurrency ( ) const

Definition at line 495 of file yieldcurveconfig.hpp.

495{ return baseCurveCurrency_; }
+ Here is the caller graph for this function:

◆ numeratorCurveId()

const string & numeratorCurveId ( ) const

Definition at line 496 of file yieldcurveconfig.hpp.

496{ return numeratorCurveId_; }
+ Here is the caller graph for this function:

◆ numeratorCurveCurrency()

const string & numeratorCurveCurrency ( ) const

Definition at line 497 of file yieldcurveconfig.hpp.

497{ return numeratorCurveCurrency_; }
+ Here is the caller graph for this function:

◆ denominatorCurveId()

const string & denominatorCurveId ( ) const

Definition at line 498 of file yieldcurveconfig.hpp.

498{ return denominatorCurveId_; }
+ Here is the caller graph for this function:

◆ denominatorCurveCurrency()

const string & denominatorCurveCurrency ( ) const

Definition at line 499 of file yieldcurveconfig.hpp.

+ Here is the caller graph for this function:

◆ accept()

void accept ( QuantLib::AcyclicVisitor &  v)
override

Definition at line 717 of file yieldcurveconfig.cpp.

717 {
718 if (Visitor<DiscountRatioYieldCurveSegment>* v1 = dynamic_cast<Visitor<DiscountRatioYieldCurveSegment>*>(&v))
719 v1->visit(*this);
720 else
722}
virtual void accept(AcyclicVisitor &)
+ Here is the call graph for this function:

Member Data Documentation

◆ baseCurveId_

std::string baseCurveId_
private

Definition at line 508 of file yieldcurveconfig.hpp.

◆ baseCurveCurrency_

std::string baseCurveCurrency_
private

Definition at line 509 of file yieldcurveconfig.hpp.

◆ numeratorCurveId_

std::string numeratorCurveId_
private

Definition at line 510 of file yieldcurveconfig.hpp.

◆ numeratorCurveCurrency_

std::string numeratorCurveCurrency_
private

Definition at line 511 of file yieldcurveconfig.hpp.

◆ denominatorCurveId_

std::string denominatorCurveId_
private

Definition at line 512 of file yieldcurveconfig.hpp.

◆ denominatorCurveCurrency_

std::string denominatorCurveCurrency_
private

Definition at line 513 of file yieldcurveconfig.hpp.