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

Container for storing Ibor Index conventions. More...

#include <ored/configuration/conventions.hpp>

+ Inheritance diagram for IborIndexConvention:
+ Collaboration diagram for IborIndexConvention:

Public Member Functions

 IborIndexConvention ()
 
 IborIndexConvention (const string &id, const string &fixingCalendar, const string &dayCounter, const Size settlementDays, const string &businessDayConvention, const bool endOfMonth)
 
const string & fixingCalendar () const
 
const string & dayCounter () const
 
const Size settlementDays () const
 
const string & businessDayConvention () const
 
const bool endOfMonth () 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 localId_
 
string strFixingCalendar_
 
string strDayCounter_
 
Size settlementDays_
 
string strBusinessDayConvention_
 
bool endOfMonth_
 

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

Definition at line 441 of file conventions.hpp.

Constructor & Destructor Documentation

◆ IborIndexConvention() [1/2]

Definition at line 443 of file conventions.hpp.

443{}

◆ IborIndexConvention() [2/2]

IborIndexConvention ( const string &  id,
const string &  fixingCalendar,
const string &  dayCounter,
const Size  settlementDays,
const string &  businessDayConvention,
const bool  endOfMonth 
)

Definition at line 367 of file conventions.cpp.

372 build();
373}
const string & businessDayConvention() const
const string & fixingCalendar() const
const bool endOfMonth() const
const Size settlementDays() const
virtual void build() override
const string & dayCounter() const
+ Here is the call graph for this function:

Member Function Documentation

◆ fixingCalendar()

const string & fixingCalendar ( ) const

Definition at line 447 of file conventions.hpp.

447{ return strFixingCalendar_; }

◆ dayCounter()

const string & dayCounter ( ) const

Definition at line 448 of file conventions.hpp.

448{ return strDayCounter_; }

◆ settlementDays()

const Size settlementDays ( ) const

Definition at line 449 of file conventions.hpp.

449{ return settlementDays_; }

◆ businessDayConvention()

const string & businessDayConvention ( ) const

Definition at line 450 of file conventions.hpp.

◆ endOfMonth()

const bool endOfMonth ( ) const

Definition at line 451 of file conventions.hpp.

451{ return endOfMonth_; }

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 375 of file conventions.cpp.

375 {
376 XMLUtils::checkNode(node, "IborIndex");
378 localId_ = XMLUtils::getChildValue(node, "Id", true);
379 strFixingCalendar_ = XMLUtils::getChildValue(node, "FixingCalendar", true);
380 strDayCounter_ = XMLUtils::getChildValue(node, "DayCounter", true);
381 settlementDays_ = XMLUtils::getChildValueAsInt(node, "SettlementDays", true);
382 strBusinessDayConvention_ = XMLUtils::getChildValue(node, "BusinessDayConvention", true);
383 endOfMonth_ = XMLUtils::getChildValueAsBool(node, "EndOfMonth", true);
384 build();
385}
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
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 387 of file conventions.cpp.

387 {
388 XMLNode* node = doc.allocNode("IborIndex");
389 XMLUtils::addChild(doc, node, "Id", localId_);
390 XMLUtils::addChild(doc, node, "FixingCalendar", strFixingCalendar_);
391 XMLUtils::addChild(doc, node, "DayCounter", strDayCounter_);
392 XMLUtils::addChild(doc, node, "SettlementDays", static_cast<int>(settlementDays_));
393 XMLUtils::addChild(doc, node, "BusinessDayConvention", strBusinessDayConvention_);
394 XMLUtils::addChild(doc, node, "EndOfMonth", endOfMonth_);
395 return node;
396}
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 398 of file conventions.cpp.

398 {
399 // just a check really that the id is consistent with the ibor index name rules
400 vector<string> tokens;
401 split(tokens, localId_, boost::is_any_of("-"));
402 QL_REQUIRE(tokens.size() == 2 || tokens.size() == 3,
403 "Two or three tokens required in IborIndexConvention " << localId_ << ": CCY-INDEX or CCY-INDEX-TERM");
404
405 // set the Id - this converts the local id term from "7D" to "1W", "28D" to "1M" etc, so if can be picked
406 // up by searches
407 id_ = (tokens.size() == 3) ? (tokens[0] + "-" + tokens[1] + "-" + to_string(parsePeriod(tokens[2]))) : localId_;
408}
Period parsePeriod(const string &s)
Convert text to QuantLib::Period.
Definition: parsers.cpp:171
std::string to_string(const LocationInfo &l)
Definition: ast.cpp:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ localId_

string localId_
private

Definition at line 458 of file conventions.hpp.

◆ strFixingCalendar_

string strFixingCalendar_
private

Definition at line 459 of file conventions.hpp.

◆ strDayCounter_

string strDayCounter_
private

Definition at line 460 of file conventions.hpp.

◆ settlementDays_

Size settlementDays_
private

Definition at line 461 of file conventions.hpp.

◆ strBusinessDayConvention_

string strBusinessDayConvention_
private

Definition at line 462 of file conventions.hpp.

◆ endOfMonth_

bool endOfMonth_
private

Definition at line 463 of file conventions.hpp.