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

FittedBond yield curve segment. More...

#include <ored/configuration/yieldcurveconfig.hpp>

+ Inheritance diagram for FittedBondYieldCurveSegment:
+ Collaboration diagram for FittedBondYieldCurveSegment:

Public Member Functions

Constructors/Destructors
 FittedBondYieldCurveSegment ()
 Default constructor. More...
 
 FittedBondYieldCurveSegment (const string &typeID, const vector< string > &quotes, const map< string, string > &iborIndexCurves, const bool extrapolateFlat)
 Detailed constructor. More...
 
Serialisation
virtual void fromXML (XMLNode *node) override
 
virtual XMLNodetoXML (XMLDocument &doc) const override
 
Inspectors
const map< string, string > & iborIndexCurves () const
 
const bool extrapolateFlat () 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
 
- 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

map< string, string > iborIndexCurves_
 
bool extrapolateFlat_
 
virtual void accept (AcyclicVisitor &) 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

FittedBond yield curve segment.

A bond segment is used to build a yield curve from liquid bond quotes.

Definition at line 522 of file yieldcurveconfig.hpp.

Constructor & Destructor Documentation

◆ FittedBondYieldCurveSegment() [1/2]

Default constructor.

Definition at line 527 of file yieldcurveconfig.hpp.

527{}

◆ FittedBondYieldCurveSegment() [2/2]

FittedBondYieldCurveSegment ( const string &  typeID,
const vector< string > &  quotes,
const map< string, string > &  iborIndexCurves,
const bool  extrapolateFlat 
)

Detailed constructor.

Definition at line 724 of file yieldcurveconfig.cpp.

Member Function Documentation

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Reimplemented from YieldCurveSegment.

Definition at line 729 of file yieldcurveconfig.cpp.

729 {
730 XMLUtils::checkNode(node, "FittedBond");
732
733 vector<string> iborIndexNames;
735 node, "IborIndexCurves", "IborIndexCurve", "iborIndex", iborIndexNames, false);
736 for (Size i = 0; i < iborIndexNames.size(); ++i) {
737 iborIndexCurves_[iborIndexNames[i]] = iborIndexCurves[i];
738 }
739
740 if (auto n = XMLUtils::getChildNode(node, "ExtrapolateFlat")) {
742 } else {
743 extrapolateFlat_ = false;
744 }
745}
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
static vector< string > getChildrenValuesWithAttributes(XMLNode *node, const string &names, const string &name, const string &attrName, vector< string > &attrs, bool mandatory=false)
Definition: xmlutils.cpp:563
virtual void fromXML(XMLNode *node) override
bool parseBool(const string &s)
Convert text to bool.
Definition: parsers.cpp:144
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Reimplemented from YieldCurveSegment.

Definition at line 747 of file yieldcurveconfig.cpp.

747 {
749 XMLUtils::setNodeName(doc, node, "FittedBond");
750
751 vector<string> iborIndexNames;
752 vector<string> iborIndexCurves;
753 for (auto const& c : iborIndexCurves_) {
754 iborIndexNames.push_back(c.first);
755 iborIndexCurves.push_back(c.second);
756 }
757 XMLUtils::addChildrenWithAttributes(doc, node, "IborIndexCurves", "IborIndexCurve", iborIndexCurves, "iborIndex",
758 iborIndexNames);
759
760 XMLUtils::addChild(doc, node, "ExtrapolateFlat", extrapolateFlat_);
761 return node;
762}
static void addChildrenWithAttributes(XMLDocument &doc, XMLNode *n, const string &names, const string &name, const vector< T > &values, const string &attrName, const vector< string > &attrs)
Definition: xmlutils.cpp:510
static void setNodeName(XMLDocument &doc, XMLNode *node, const string &name)
Definition: xmlutils.cpp:478
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
virtual XMLNode * toXML(XMLDocument &doc) const override
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
+ Here is the call graph for this function:

◆ iborIndexCurves()

const map< string, string > & iborIndexCurves ( ) const

Definition at line 540 of file yieldcurveconfig.hpp.

540{ return iborIndexCurves_; }
+ Here is the caller graph for this function:

◆ extrapolateFlat()

const bool extrapolateFlat ( ) const

Definition at line 541 of file yieldcurveconfig.hpp.

541{ return extrapolateFlat_; }

◆ accept()

void accept ( AcyclicVisitor &  v)
overridevirtual

Reimplemented from YieldCurveSegment.

Definition at line 764 of file yieldcurveconfig.cpp.

764 {
765 Visitor<FittedBondYieldCurveSegment>* v1 = dynamic_cast<Visitor<FittedBondYieldCurveSegment>*>(&v);
766 if (v1 != 0)
767 v1->visit(*this);
768 else
770}
virtual void accept(AcyclicVisitor &)
+ Here is the call graph for this function:

Member Data Documentation

◆ iborIndexCurves_

map<string, string> iborIndexCurves_
private

Definition at line 550 of file yieldcurveconfig.hpp.

◆ extrapolateFlat_

bool extrapolateFlat_
private

Definition at line 551 of file yieldcurveconfig.hpp.