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

Container for storing Overnight Index conventions. More...

#include <ored/configuration/conventions.hpp>

+ Inheritance diagram for OvernightIndexConvention:
+ Collaboration diagram for OvernightIndexConvention:

Public Member Functions

 OvernightIndexConvention ()
 
 OvernightIndexConvention (const string &id, const string &fixingCalendar, const string &dayCounter, const Size settlementDays)
 
const string & fixingCalendar () const
 
const string & dayCounter () const
 
const Size settlementDays () const
 
virtual void fromXML (XMLNode *node) override
 
virtual XMLNodetoXML (XMLDocument &doc) const override
 
virtual void build () override
 
- 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...
 

Private Attributes

string strFixingCalendar_
 
string strDayCounter_
 
Size settlementDays_
 

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 Overnight Index conventions.

Definition at line 470 of file conventions.hpp.

Constructor & Destructor Documentation

◆ OvernightIndexConvention() [1/2]

Definition at line 472 of file conventions.hpp.

472{}

◆ OvernightIndexConvention() [2/2]

OvernightIndexConvention ( const string &  id,
const string &  fixingCalendar,
const string &  dayCounter,
const Size  settlementDays 
)

Definition at line 410 of file conventions.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ fixingCalendar()

const string & fixingCalendar ( ) const

Definition at line 476 of file conventions.hpp.

476{ return strFixingCalendar_; }

◆ dayCounter()

const string & dayCounter ( ) const

Definition at line 477 of file conventions.hpp.

477{ return strDayCounter_; }

◆ settlementDays()

const Size settlementDays ( ) const

Definition at line 478 of file conventions.hpp.

478{ return settlementDays_; }

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 417 of file conventions.cpp.

417 {
418 XMLUtils::checkNode(node, "OvernightIndex");
420 id_ = XMLUtils::getChildValue(node, "Id", true);
421 strFixingCalendar_ = XMLUtils::getChildValue(node, "FixingCalendar", true);
422 strDayCounter_ = XMLUtils::getChildValue(node, "DayCounter", true);
423 settlementDays_ = XMLUtils::getChildValueAsInt(node, "SettlementDays", true);
424 build();
425}
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:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 427 of file conventions.cpp.

427 {
428 XMLNode* node = doc.allocNode("OvernightIndex");
429 XMLUtils::addChild(doc, node, "Id", id_);
430 XMLUtils::addChild(doc, node, "FixingCalendar", strFixingCalendar_);
431 XMLUtils::addChild(doc, node, "DayCounter", strDayCounter_);
432 XMLUtils::addChild(doc, node, "SettlementDays", static_cast<int>(settlementDays_));
433 return node;
434}
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 436 of file conventions.cpp.

436 {
437 // just a check really that the id is consistent with the ibor index name rules
438 vector<string> tokens;
439 split(tokens, id_, boost::is_any_of("-"));
440 QL_REQUIRE(tokens.size() == 2, "Two tokens required in OvernightIndexConvention " << id_ << ": CCY-INDEX");
441}
+ Here is the caller graph for this function:

Member Data Documentation

◆ strFixingCalendar_

string strFixingCalendar_
private

Definition at line 485 of file conventions.hpp.

◆ strDayCounter_

string strDayCounter_
private

Definition at line 486 of file conventions.hpp.

◆ settlementDays_

Size settlementDays_
private

Definition at line 487 of file conventions.hpp.