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

Container for storing Credit Default Swap quote conventions. More...

#include <ored/configuration/conventions.hpp>

+ Inheritance diagram for CdsConvention:
+ Collaboration diagram for CdsConvention:

Public Member Functions

Constructors
 CdsConvention ()
 Default constructor. More...
 
 CdsConvention (const string &id, const string &strSettlementDays, const string &strCalendar, const string &strFrequency, const string &strPaymentConvention, const string &strRule, const string &dayCounter, const string &settlesAccrual, const string &paysAtDefaultTime, const string &strUpfrontSettlementDays="", const string &lastPeriodDayCounter="")
 Detailed constructor. More...
 
Inspectors
Natural settlementDays () const
 
const Calendar & calendar () const
 
Frequency frequency () const
 
BusinessDayConvention paymentConvention () const
 
DateGeneration::Rule rule () const
 
const DayCounter & dayCounter () const
 
bool settlesAccrual () const
 
bool paysAtDefaultTime () const
 
Natural upfrontSettlementDays () const
 
const DayCounter & lastPeriodDayCounter () const
 
- Public Member Functions inherited from Convention
virtual ~Convention ()
 Default destructor. More...
 
const string & id () const
 
Type type () 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

Natural settlementDays_
 
Calendar calendar_
 
Frequency frequency_
 
BusinessDayConvention paymentConvention_
 
DateGeneration::Rule rule_
 
DayCounter dayCounter_
 
bool settlesAccrual_
 
bool paysAtDefaultTime_
 
Natural upfrontSettlementDays_
 
DayCounter lastPeriodDayCounter_
 
string strSettlementDays_
 
string strCalendar_
 
string strFrequency_
 
string strPaymentConvention_
 
string strRule_
 
string strDayCounter_
 
string strSettlesAccrual_
 
string strPaysAtDefaultTime_
 
string strUpfrontSettlementDays_
 
string strLastPeriodDayCounter_
 
virtual void fromXML (XMLNode *node0) override
 
virtual XMLNodetoXML (XMLDocument &doc) const override
 
virtual void build () override
 

Additional Inherited Members

- Public Types inherited from Convention
enum class  Type {
  Zero , Deposit , Future , FRA ,
  OIS , Swap , AverageOIS , TenorBasisSwap ,
  TenorBasisTwoSwap , BMABasisSwap , FX , CrossCcyBasis ,
  CrossCcyFixFloat , CDS , IborIndex , OvernightIndex ,
  SwapIndex , ZeroInflationIndex , InflationSwap , SecuritySpread ,
  CMSSpreadOption , CommodityForward , CommodityFuture , FxOption ,
  BondYield
}
 Supported convention types. More...
 
- Protected Member Functions inherited from Convention
 Convention ()
 
 Convention (const string &id, Type type)
 
- Protected Attributes inherited from Convention
Type type_
 
string id_
 

Detailed Description

Container for storing Credit Default Swap quote conventions.

Definition at line 1024 of file conventions.hpp.

Constructor & Destructor Documentation

◆ CdsConvention() [1/2]

Default constructor.

Definition at line 1160 of file conventions.cpp.

1160 : settlementDays_(0), frequency_(Quarterly), paymentConvention_(Following),
1161 rule_(DateGeneration::CDS2015), settlesAccrual_(true), paysAtDefaultTime_(true), upfrontSettlementDays_(3) {}
DateGeneration::Rule rule_
BusinessDayConvention paymentConvention_

◆ CdsConvention() [2/2]

CdsConvention ( const string &  id,
const string &  strSettlementDays,
const string &  strCalendar,
const string &  strFrequency,
const string &  strPaymentConvention,
const string &  strRule,
const string &  dayCounter,
const string &  settlesAccrual,
const string &  paysAtDefaultTime,
const string &  strUpfrontSettlementDays = "",
const string &  lastPeriodDayCounter = "" 
)

Detailed constructor.

Definition at line 1163 of file conventions.cpp.

1168 : Convention(id, Type::CDS), strSettlementDays_(strSettlementDays), strCalendar_(strCalendar),
1169 strFrequency_(strFrequency), strPaymentConvention_(strPaymentConvention), strRule_(strRule),
1170 strDayCounter_(strDayCounter), strSettlesAccrual_(strSettlesAccrual),
1171 strPaysAtDefaultTime_(strPaysAtDefaultTime), strUpfrontSettlementDays_(strUpfrontSettlementDays),
1173 build();
1174}
const DayCounter & lastPeriodDayCounter() const
virtual void build() override
+ Here is the call graph for this function:

Member Function Documentation

◆ settlementDays()

Natural settlementDays ( ) const

Definition at line 1040 of file conventions.hpp.

1040{ return settlementDays_; }

◆ calendar()

const Calendar & calendar ( ) const

Definition at line 1041 of file conventions.hpp.

1041{ return calendar_; }

◆ frequency()

Frequency frequency ( ) const

Definition at line 1042 of file conventions.hpp.

1042{ return frequency_; }

◆ paymentConvention()

BusinessDayConvention paymentConvention ( ) const

Definition at line 1043 of file conventions.hpp.

1043{ return paymentConvention_; }

◆ rule()

DateGeneration::Rule rule ( ) const

Definition at line 1044 of file conventions.hpp.

1044{ return rule_; }

◆ dayCounter()

const DayCounter & dayCounter ( ) const

Definition at line 1045 of file conventions.hpp.

1045{ return dayCounter_; }

◆ settlesAccrual()

bool settlesAccrual ( ) const

Definition at line 1046 of file conventions.hpp.

1046{ return settlesAccrual_; }

◆ paysAtDefaultTime()

bool paysAtDefaultTime ( ) const

Definition at line 1047 of file conventions.hpp.

1047{ return paysAtDefaultTime_; }

◆ upfrontSettlementDays()

Natural upfrontSettlementDays ( ) const

Definition at line 1048 of file conventions.hpp.

1048{ return upfrontSettlementDays_; }

◆ lastPeriodDayCounter()

const DayCounter & lastPeriodDayCounter ( ) const

Definition at line 1049 of file conventions.hpp.

1049{ return lastPeriodDayCounter_; }

◆ fromXML()

void fromXML ( XMLNode node0)
overridevirtual

Implements XMLSerializable.

Definition at line 1195 of file conventions.cpp.

1195 {
1196
1197 XMLUtils::checkNode(node, "CDS");
1198 type_ = Type::CDS;
1199 id_ = XMLUtils::getChildValue(node, "Id", true);
1200
1201 // Get string values from xml
1202 strSettlementDays_ = XMLUtils::getChildValue(node, "SettlementDays", true);
1203 strCalendar_ = XMLUtils::getChildValue(node, "Calendar", true);
1204 strFrequency_ = XMLUtils::getChildValue(node, "Frequency", true);
1205 strPaymentConvention_ = XMLUtils::getChildValue(node, "PaymentConvention", true);
1206 strRule_ = XMLUtils::getChildValue(node, "Rule", true);
1207 strDayCounter_ = XMLUtils::getChildValue(node, "DayCounter", true);
1208 strSettlesAccrual_ = XMLUtils::getChildValue(node, "SettlesAccrual", true);
1209 strPaysAtDefaultTime_ = XMLUtils::getChildValue(node, "PaysAtDefaultTime", true);
1210 strUpfrontSettlementDays_ = XMLUtils::getChildValue(node, "UpfrontSettlementDays", false);
1211 strLastPeriodDayCounter_ = XMLUtils::getChildValue(node, "LastPeriodDayCounter", false);
1212
1213 build();
1214}
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
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 1216 of file conventions.cpp.

1216 {
1217
1218 XMLNode* node = doc.allocNode("CDS");
1219 XMLUtils::addChild(doc, node, "Id", id_);
1220 XMLUtils::addChild(doc, node, "SettlementDays", strSettlementDays_);
1221 XMLUtils::addChild(doc, node, "Calendar", strCalendar_);
1222 XMLUtils::addChild(doc, node, "Frequency", strFrequency_);
1223 XMLUtils::addChild(doc, node, "PaymentConvention", strPaymentConvention_);
1224 XMLUtils::addChild(doc, node, "Rule", strRule_);
1225 XMLUtils::addChild(doc, node, "DayCounter", strDayCounter_);
1226 XMLUtils::addChild(doc, node, "SettlesAccrual", strSettlesAccrual_);
1227 XMLUtils::addChild(doc, node, "PaysAtDefaultTime", strPaysAtDefaultTime_);
1228 if (!strUpfrontSettlementDays_.empty())
1229 XMLUtils::addChild(doc, node, "UpfrontSettlementDays", strUpfrontSettlementDays_);
1230 if (!strLastPeriodDayCounter_.empty())
1231 XMLUtils::addChild(doc, node, "LastPeriodDayCounter", strLastPeriodDayCounter_);
1232 return node;
1233}
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:

◆ build()

void build ( )
overridevirtual

Implements Convention.

Definition at line 1176 of file conventions.cpp.

1176 {
1177 settlementDays_ = lexical_cast<Natural>(strSettlementDays_);
1185
1187 if (!strUpfrontSettlementDays_.empty())
1188 upfrontSettlementDays_ = lexical_cast<Natural>(strUpfrontSettlementDays_);
1189
1190 lastPeriodDayCounter_ = DayCounter();
1191 if (!strLastPeriodDayCounter_.empty())
1193}
DateGeneration::Rule parseDateGenerationRule(const string &s)
Convert text to QuantLib::DateGeneration::Rule.
Definition: parsers.cpp:328
Calendar parseCalendar(const string &s)
Convert text to QuantLib::Calendar.
Definition: parsers.cpp:157
BusinessDayConvention parseBusinessDayConvention(const string &s)
Convert text to QuantLib::BusinessDayConvention.
Definition: parsers.cpp:173
Frequency parseFrequency(const string &s)
Convert text to QuantLib::Frequency.
Definition: parsers.cpp:348
bool parseBool(const string &s)
Convert text to bool.
Definition: parsers.cpp:144
DayCounter parseDayCounter(const string &s)
Convert text to QuantLib::DayCounter.
Definition: parsers.cpp:209
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ settlementDays_

Natural settlementDays_
private

Definition at line 1059 of file conventions.hpp.

◆ calendar_

Calendar calendar_
private

Definition at line 1060 of file conventions.hpp.

◆ frequency_

Frequency frequency_
private

Definition at line 1061 of file conventions.hpp.

◆ paymentConvention_

BusinessDayConvention paymentConvention_
private

Definition at line 1062 of file conventions.hpp.

◆ rule_

DateGeneration::Rule rule_
private

Definition at line 1063 of file conventions.hpp.

◆ dayCounter_

DayCounter dayCounter_
private

Definition at line 1064 of file conventions.hpp.

◆ settlesAccrual_

bool settlesAccrual_
private

Definition at line 1065 of file conventions.hpp.

◆ paysAtDefaultTime_

bool paysAtDefaultTime_
private

Definition at line 1066 of file conventions.hpp.

◆ upfrontSettlementDays_

Natural upfrontSettlementDays_
private

Definition at line 1067 of file conventions.hpp.

◆ lastPeriodDayCounter_

DayCounter lastPeriodDayCounter_
private

Definition at line 1068 of file conventions.hpp.

◆ strSettlementDays_

string strSettlementDays_
private

Definition at line 1071 of file conventions.hpp.

◆ strCalendar_

string strCalendar_
private

Definition at line 1072 of file conventions.hpp.

◆ strFrequency_

string strFrequency_
private

Definition at line 1073 of file conventions.hpp.

◆ strPaymentConvention_

string strPaymentConvention_
private

Definition at line 1074 of file conventions.hpp.

◆ strRule_

string strRule_
private

Definition at line 1075 of file conventions.hpp.

◆ strDayCounter_

string strDayCounter_
private

Definition at line 1076 of file conventions.hpp.

◆ strSettlesAccrual_

string strSettlesAccrual_
private

Definition at line 1077 of file conventions.hpp.

◆ strPaysAtDefaultTime_

string strPaysAtDefaultTime_
private

Definition at line 1078 of file conventions.hpp.

◆ strUpfrontSettlementDays_

string strUpfrontSettlementDays_
private

Definition at line 1079 of file conventions.hpp.

◆ strLastPeriodDayCounter_

string strLastPeriodDayCounter_
private

Definition at line 1080 of file conventions.hpp.