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

#include <ored/configuration/conventions.hpp>

+ Inheritance diagram for ZeroInflationIndexConvention:
+ Collaboration diagram for ZeroInflationIndexConvention:

Public Member Functions

 ZeroInflationIndexConvention ()
 Constructor. More...
 
 ZeroInflationIndexConvention (const std::string &id, const std::string &regionName, const std::string &regionCode, bool revised, const std::string &frequency, const std::string &availabilityLag, const std::string &currency)
 Detailed constructor. More...
 
QuantLib::Region region () const
 
bool revised () const
 
QuantLib::Frequency frequency () const
 
const QuantLib::Period & availabilityLag () const
 
const QuantLib::Currency & currency () const
 
void fromXML (XMLNode *node) override
 
XMLNodetoXML (XMLDocument &doc) const override
 
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

std::string regionName_
 
std::string regionCode_
 
bool revised_
 
std::string strFrequency_
 
std::string strAvailabilityLag_
 
std::string strCurrency_
 
QuantLib::Frequency frequency_
 
QuantLib::Period availabilityLag_
 
QuantLib::Currency currency_
 

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 zero inflation index conventions

Definition at line 1748 of file conventions.hpp.

Constructor & Destructor Documentation

◆ ZeroInflationIndexConvention() [1/2]

Constructor.

Definition at line 2431 of file conventions.cpp.

◆ ZeroInflationIndexConvention() [2/2]

ZeroInflationIndexConvention ( const std::string &  id,
const std::string &  regionName,
const std::string &  regionCode,
bool  revised,
const std::string &  frequency,
const std::string &  availabilityLag,
const std::string &  currency 
)

Detailed constructor.

Definition at line 2434 of file conventions.cpp.

2443 regionName_(regionName),
2444 regionCode_(regionCode),
2449 frequency_(Monthly) {
2450 build();
2451}
QuantLib::Frequency frequency() const
const QuantLib::Period & availabilityLag() const
const QuantLib::Currency & currency() const
+ Here is the call graph for this function:

Member Function Documentation

◆ region()

QuantLib::Region region ( ) const

Definition at line 2453 of file conventions.cpp.

2453 {
2454 return QuantLib::CustomRegion(regionName_, regionCode_);
2455}

◆ revised()

bool revised ( ) const

Definition at line 1763 of file conventions.hpp.

1763{ return revised_; }

◆ frequency()

QuantLib::Frequency frequency ( ) const

Definition at line 1764 of file conventions.hpp.

1764{ return frequency_; }

◆ availabilityLag()

const QuantLib::Period & availabilityLag ( ) const

Definition at line 1765 of file conventions.hpp.

1765{ return availabilityLag_; }

◆ currency()

const QuantLib::Currency & currency ( ) const

Definition at line 1766 of file conventions.hpp.

1766{ return currency_; }

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Implements XMLSerializable.

Definition at line 2463 of file conventions.cpp.

2463 {
2464
2465 XMLUtils::checkNode(node, "ZeroInflationIndex");
2467 id_ = XMLUtils::getChildValue(node, "Id", true);
2468
2469 regionName_ = XMLUtils::getChildValue(node, "RegionName", true);
2470 regionCode_ = XMLUtils::getChildValue(node, "RegionCode", true);
2471 revised_ = parseBool(XMLUtils::getChildValue(node, "Revised", true));
2472 strFrequency_ = XMLUtils::getChildValue(node, "Frequency", true);
2473 strAvailabilityLag_ = XMLUtils::getChildValue(node, "AvailabilityLag", true);
2474 strCurrency_ = XMLUtils::getChildValue(node, "Currency", true);
2475
2476 build();
2477}
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
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

Implements XMLSerializable.

Definition at line 2479 of file conventions.cpp.

2479 {
2480
2481 XMLNode* node = doc.allocNode("ZeroInflationIndex");
2482 XMLUtils::addChild(doc, node, "Id", id_);
2483 XMLUtils::addChild(doc, node, "RegionName", regionName_);
2484 XMLUtils::addChild(doc, node, "RegionCode", regionCode_);
2485 XMLUtils::addChild(doc, node, "Revised", revised_);
2486 XMLUtils::addChild(doc, node, "Frequency", strFrequency_);
2487 XMLUtils::addChild(doc, node, "AvailabilityLag", strAvailabilityLag_);
2488 XMLUtils::addChild(doc, node, "Currency", strCurrency_);
2489
2490 return node;
2491}
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 2457 of file conventions.cpp.

2457 {
2461}
Currency parseCurrency(const string &s)
Convert text to QuantLib::Currency.
Definition: parsers.cpp:290
Period parsePeriod(const string &s)
Convert text to QuantLib::Period.
Definition: parsers.cpp:171
Frequency parseFrequency(const string &s)
Convert text to QuantLib::Frequency.
Definition: parsers.cpp:348
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ regionName_

std::string regionName_
private

Definition at line 1773 of file conventions.hpp.

◆ regionCode_

std::string regionCode_
private

Definition at line 1774 of file conventions.hpp.

◆ revised_

bool revised_
private

Definition at line 1775 of file conventions.hpp.

◆ strFrequency_

std::string strFrequency_
private

Definition at line 1776 of file conventions.hpp.

◆ strAvailabilityLag_

std::string strAvailabilityLag_
private

Definition at line 1777 of file conventions.hpp.

◆ strCurrency_

std::string strCurrency_
private

Definition at line 1778 of file conventions.hpp.

◆ frequency_

QuantLib::Frequency frequency_
private

Definition at line 1780 of file conventions.hpp.

◆ availabilityLag_

QuantLib::Period availabilityLag_
private

Definition at line 1781 of file conventions.hpp.

◆ currency_

QuantLib::Currency currency_
private

Definition at line 1782 of file conventions.hpp.