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

Container for storing Deposit conventions. More...

#include <ored/configuration/conventions.hpp>

+ Inheritance diagram for DepositConvention:
+ Collaboration diagram for DepositConvention:

Public Member Functions

Constructors
 DepositConvention ()
 Default constructor. More...
 
 DepositConvention (const string &id, const string &index)
 Index based constructor. More...
 
 DepositConvention (const string &id, const string &calendar, const string &convention, const string &eom, const string &dayCounter, const string &settlementDays)
 Detailed constructor. More...
 
Inspectors
const string & index () const
 
const Calendar & calendar () const
 
BusinessDayConvention convention () const
 
bool eom ()
 
const DayCounter & dayCounter () const
 
const Size settlementDays () const
 
bool indexBased ()
 
- 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

string index_
 
Calendar calendar_
 
BusinessDayConvention convention_
 
bool eom_
 
DayCounter dayCounter_
 
Size settlementDays_
 
bool indexBased_
 
string strCalendar_
 
string strConvention_
 
string strEom_
 
string strDayCounter_
 
string strSettlementDays_
 
virtual void fromXML (XMLNode *node) 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 Deposit conventions.

Definition at line 252 of file conventions.hpp.

Constructor & Destructor Documentation

◆ DepositConvention() [1/3]

Default constructor.

Definition at line 257 of file conventions.hpp.

257{}

◆ DepositConvention() [2/3]

DepositConvention ( const string &  id,
const string &  index 
)

Index based constructor.

Definition at line 168 of file conventions.cpp.

◆ DepositConvention() [3/3]

DepositConvention ( const string &  id,
const string &  calendar,
const string &  convention,
const string &  eom,
const string &  dayCounter,
const string &  settlementDays 
)

Detailed constructor.

Definition at line 171 of file conventions.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ index()

const string & index ( ) const

Definition at line 267 of file conventions.hpp.

267{ return index_; }

◆ calendar()

const Calendar & calendar ( ) const

Definition at line 268 of file conventions.hpp.

268{ return calendar_; }

◆ convention()

BusinessDayConvention convention ( ) const

Definition at line 269 of file conventions.hpp.

269{ return convention_; }
BusinessDayConvention convention_

◆ eom()

bool eom ( )

Definition at line 270 of file conventions.hpp.

270{ return eom_; }

◆ dayCounter()

const DayCounter & dayCounter ( ) const

Definition at line 271 of file conventions.hpp.

271{ return dayCounter_; }

◆ settlementDays()

const Size settlementDays ( ) const

Definition at line 272 of file conventions.hpp.

◆ indexBased()

bool indexBased ( )

Definition at line 273 of file conventions.hpp.

273{ return indexBased_; }

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 186 of file conventions.cpp.

186 {
187
188 XMLUtils::checkNode(node, "Deposit");
190 id_ = XMLUtils::getChildValue(node, "Id", true);
191 indexBased_ = XMLUtils::getChildValueAsBool(node, "IndexBased", true);
192
193 // Get string values from xml
194 if (indexBased_) {
195 index_ = XMLUtils::getChildValue(node, "Index", true);
196 } else {
197 strCalendar_ = XMLUtils::getChildValue(node, "Calendar", true);
198 strConvention_ = XMLUtils::getChildValue(node, "Convention", true);
199 strEom_ = XMLUtils::getChildValue(node, "EOM", true);
200 strDayCounter_ = XMLUtils::getChildValue(node, "DayCounter", true);
201 strSettlementDays_ = XMLUtils::getChildValue(node, "SettlementDays", true);
202 build();
203 }
204}
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 bool getChildValueAsBool(XMLNode *node, const string &name, bool mandatory=false, bool defaultValue=true)
Definition: xmlutils.cpp:296
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 206 of file conventions.cpp.

206 {
207
208 XMLNode* node = doc.allocNode("Deposit");
209 XMLUtils::addChild(doc, node, "Id", id_);
210 XMLUtils::addChild(doc, node, "IndexBased", indexBased_);
211 if (indexBased_) {
212 XMLUtils::addChild(doc, node, "Index", index_);
213 } else {
214 XMLUtils::addChild(doc, node, "Calendar", strCalendar_);
215 XMLUtils::addChild(doc, node, "Convention", strConvention_);
216 XMLUtils::addChild(doc, node, "EOM", strEom_);
217 XMLUtils::addChild(doc, node, "DayCounter", strDayCounter_);
218 XMLUtils::addChild(doc, node, "SettlementDays", strSettlementDays_);
219 }
220
221 return node;
222}
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 178 of file conventions.cpp.

178 {
184}
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
bool parseBool(const string &s)
Convert text to bool.
Definition: parsers.cpp:144
Integer parseInteger(const string &s)
Convert text to QuantLib::Integer.
Definition: parsers.cpp:136
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

◆ index_

string index_
private

Definition at line 284 of file conventions.hpp.

◆ calendar_

Calendar calendar_
private

Definition at line 285 of file conventions.hpp.

◆ convention_

BusinessDayConvention convention_
private

Definition at line 286 of file conventions.hpp.

◆ eom_

bool eom_
private

Definition at line 287 of file conventions.hpp.

◆ dayCounter_

DayCounter dayCounter_
private

Definition at line 288 of file conventions.hpp.

◆ settlementDays_

Size settlementDays_
private

Definition at line 289 of file conventions.hpp.

◆ indexBased_

bool indexBased_
private

Definition at line 290 of file conventions.hpp.

◆ strCalendar_

string strCalendar_
private

Definition at line 293 of file conventions.hpp.

◆ strConvention_

string strConvention_
private

Definition at line 294 of file conventions.hpp.

◆ strEom_

string strEom_
private

Definition at line 295 of file conventions.hpp.

◆ strDayCounter_

string strDayCounter_
private

Definition at line 296 of file conventions.hpp.

◆ strSettlementDays_

string strSettlementDays_
private

Definition at line 297 of file conventions.hpp.