Logo
Reference manual - version ored_version
Conventions Class Reference

Repository for currency dependent market conventions. More...

#include <ored/configuration/conventions.hpp>

Inheritance diagram for Conventions:

Public Member Functions

 Conventions ()
 Default constructor.
QuantLib::ext::shared_ptr< Conventionget (const string &id) const
std::pair< bool, QuantLib::ext::shared_ptr< Convention > > get (const std::string &id, const Convention::Type &type) const
std::set< QuantLib::ext::shared_ptr< Convention > > get (const Convention::Type &type) const
QuantLib::ext::shared_ptr< ConventiongetFxConvention (const string &ccy1, const string &ccy2) const
bool has (const std::string &id) const
 Checks if we have a convention with the given id.
bool has (const std::string &id, const Convention::Type &type) const
 Checks if we have a convention with the given id and type.
void clear () const
void add (const QuantLib::ext::shared_ptr< Convention > &convention) const
Public Member Functions inherited from XMLSerializable
void fromFile (const std::string &filename)
void toFile (const std::string &filename) const
void fromXMLString (const std::string &xml)
 Parse from XML string.
std::string toXMLString () const
 Parse from XML string.
std::string toXMLStringUnformatted () const

Serialisation

virtual void fromXML (XMLNode *node) override
virtual XMLNode * toXML (XMLDocument &doc) const override

Detailed Description

Repository for currency dependent market conventions.

Member Function Documentation

◆ get() [1/3]

QuantLib::ext::shared_ptr< Convention > get ( const string & id) const

Returns the convention if found and throws if not

◆ get() [2/3]

std::pair< bool, QuantLib::ext::shared_ptr< Convention > > get ( const std::string & id,
const Convention::Type & type ) const

Get a convention with the given id and type. If no convention of the given type with the given id is found, the first element of the returned pair is false and the second element is a nullptr. If a convention is found, the first element of the returned pair is true and the second element holds the convention.

◆ get() [3/3]

std::set< QuantLib::ext::shared_ptr< Convention > > get ( const Convention::Type & type) const

Get all conventions of a given type

◆ getFxConvention()

QuantLib::ext::shared_ptr< Convention > getFxConvention ( const string & ccy1,
const string & ccy2 ) const

Find a convention for an FX pair

◆ clear()

void clear ( ) const

Clear all conventions

◆ add()

void add ( const QuantLib::ext::shared_ptr< Convention > & convention) const

Add a convention. This will overwrite an existing convention with the same id

◆ fromXML()

virtual void fromXML ( XMLNode * node)
overridevirtual

Implements XMLSerializable.

◆ toXML()

virtual XMLNode * toXML ( XMLDocument & doc) const
overridevirtual

Implements XMLSerializable.