Logo
Reference manual - version ored_version
Public Member Functions | List of all members
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.
 
boost::shared_ptr< Conventionget (const string &id) const
 
std::pair< bool, boost::shared_ptr< Convention > > get (const std::string &id, const Convention::Type &type) const
 
std::set< boost::shared_ptr< Convention > > get (const Convention::Type &type) const
 
boost::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 boost::shared_ptr< Convention > &convention) const
 
- Public Member Functions inherited from XMLSerializable
void fromFile (const std::string &filename)
 
void toFile (const std::string &filename)
 
void fromXMLString (const std::string &xml)
 Parse from XML string.
 
std::string toXMLString ()
 Parse from XML string.
 

Serialisation

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

Detailed Description

Repository for currency dependent market conventions.

Member Function Documentation

◆ get() [1/3]

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

Returns the convention if found and throws if not

◆ get() [2/3]

std::pair<bool, boost::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<boost::shared_ptr<Convention> > get ( const Convention::Type type) const

Get all conventions of a given type

◆ getFxConvention()

boost::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 boost::shared_ptr< Convention > &  convention) const

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