Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Types | List of all members
FutureConvention Class Reference

Container for storing Money Market Futures conventions. More...

#include <ored/configuration/conventions.hpp>

+ Inheritance diagram for FutureConvention:
+ Collaboration diagram for FutureConvention:

Public Types

enum class  DateGenerationRule { IMM , FirstDayOfMonth }
 
- 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...
 

Public Member Functions

Constructors
 FutureConvention ()
 Default constructor. More...
 
 FutureConvention (const string &id, const string &index)
 Index based constructor. More...
 
 FutureConvention (const string &id, const string &index, const QuantLib::RateAveraging::Type overnightIndexFutureNettingType, const DateGenerationRule dateGeneration)
 Index based constructor taking in addition a netting type for ON indices and a date generation rule. More...
 
- 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...
 

Inspectors

string strIndex_
 
QuantLib::RateAveraging::Type overnightIndexFutureNettingType_
 
DateGenerationRule dateGenerationRule_
 
QuantLib::ext::shared_ptr< IborIndexindex () const
 
QuantLib::RateAveraging::Type overnightIndexFutureNettingType () const
 
DateGenerationRule dateGenerationRule () const
 
virtual void fromXML (XMLNode *node) override
 Serialisation. More...
 
virtual XMLNodetoXML (XMLDocument &doc) const override
 
virtual void build () override
 

Additional Inherited Members

- 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 Money Market Futures conventions.

Definition at line 304 of file conventions.hpp.

Member Enumeration Documentation

◆ DateGenerationRule

enum class DateGenerationRule
strong

Constructor & Destructor Documentation

◆ FutureConvention() [1/3]

Default constructor.

Definition at line 310 of file conventions.hpp.

310{}

◆ FutureConvention() [2/3]

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

Index based constructor.

Definition at line 224 of file conventions.cpp.

225 : FutureConvention(id, index, QuantLib::RateAveraging::Type::Compound, DateGenerationRule::IMM) {}
FutureConvention()
Default constructor.
QuantLib::ext::shared_ptr< IborIndex > index() const

◆ FutureConvention() [3/3]

FutureConvention ( const string &  id,
const string &  index,
const QuantLib::RateAveraging::Type  overnightIndexFutureNettingType,
const DateGenerationRule  dateGeneration 
)

Index based constructor taking in addition a netting type for ON indices and a date generation rule.

Definition at line 227 of file conventions.cpp.

233}
QuantLib::RateAveraging::Type overnightIndexFutureNettingType_
QuantLib::RateAveraging::Type overnightIndexFutureNettingType() const
QuantLib::ext::shared_ptr< IborIndex > parseIborIndex(const string &s, const Handle< YieldTermStructure > &h)
Convert std::string to QuantLib::IborIndex.
+ Here is the call graph for this function:

Member Function Documentation

◆ index()

QuantLib::ext::shared_ptr< IborIndex > index ( ) const

Definition at line 259 of file conventions.cpp.

259{ return parseIborIndex(strIndex_); }
+ Here is the call graph for this function:

◆ overnightIndexFutureNettingType()

QuantLib::RateAveraging::Type overnightIndexFutureNettingType ( ) const

Definition at line 321 of file conventions.hpp.

◆ dateGenerationRule()

DateGenerationRule dateGenerationRule ( ) const

Definition at line 322 of file conventions.hpp.

322{ return dateGenerationRule_; }
DateGenerationRule dateGenerationRule_

◆ fromXML()

void fromXML ( XMLNode node)
overridevirtual

Serialisation.

Implements XMLSerializable.

Definition at line 235 of file conventions.cpp.

235 {
236 XMLUtils::checkNode(node, "Future");
238 id_ = XMLUtils::getChildValue(node, "Id", true);
239 strIndex_ = XMLUtils::getChildValue(node, "Index", true);
241 string nettingTypeStr = XMLUtils::getChildValue(node, "OvernightIndexFutureNettingType", false);
243 nettingTypeStr.empty() ? RateAveraging::Type::Compound : parseOvernightIndexFutureNettingType(nettingTypeStr);
244 string dateGenerationStr = XMLUtils::getChildValue(node, "DateGenerationRule", false);
246 dateGenerationStr.empty() ? DateGenerationRule::IMM : parseFutureDateGenerationRule(dateGenerationStr);
247}
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
FutureConvention::DateGenerationRule parseFutureDateGenerationRule(const std::string &s)
Convert text to FutureConvention::DateGeneration.
Definition: parsers.cpp:991
QuantLib::RateAveraging::Type parseOvernightIndexFutureNettingType(const std::string &s)
Convert text to QuantLib::RateAveraging::Type.
Definition: parsers.cpp:970
+ Here is the call graph for this function:

◆ toXML()

XMLNode * toXML ( XMLDocument doc) const
overridevirtual

Implements XMLSerializable.

Definition at line 249 of file conventions.cpp.

249 {
250
251 XMLNode* node = doc.allocNode("Future");
252 XMLUtils::addChild(doc, node, "Id", id_);
253 XMLUtils::addChild(doc, node, "Index", strIndex_);
254 XMLUtils::addChild(doc, node, "OvernightIndexFutureNettingType", ore::data::to_string(overnightIndexFutureNettingType_));
255 XMLUtils::addChild(doc, node, "DateGenerationRule", ore::data::to_string(dateGenerationRule_));
256 return node;
257}
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
Definition: xmlutils.cpp:181
rapidxml::xml_node< char > XMLNode
Definition: xmlutils.hpp:60
std::string to_string(const LocationInfo &l)
Definition: ast.cpp:28
+ Here is the call graph for this function:

◆ build()

virtual void build ( )
overridevirtual

Implements Convention.

Definition at line 329 of file conventions.hpp.

329{}

Member Data Documentation

◆ strIndex_

string strIndex_
private

Definition at line 333 of file conventions.hpp.

◆ overnightIndexFutureNettingType_

QuantLib::RateAveraging::Type overnightIndexFutureNettingType_
private

Definition at line 334 of file conventions.hpp.

◆ dateGenerationRule_

DateGenerationRule dateGenerationRule_
private

Definition at line 335 of file conventions.hpp.