Repository for currency dependent market conventions. More...
#include <ored/configuration/conventions.hpp>
Public Member Functions | |
Conventions () | |
Default constructor. | |
boost::shared_ptr< Convention > | get (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< Convention > | getFxConvention (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 XMLNode * | toXML (XMLDocument &doc) override |
Repository for currency dependent market conventions.
boost::shared_ptr<Convention> get | ( | const string & | id | ) | const |
Returns the convention if found and throws if not
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.
std::set<boost::shared_ptr<Convention> > get | ( | const Convention::Type & | type | ) | const |
Get all conventions of a given type
boost::shared_ptr<Convention> getFxConvention | ( | const string & | ccy1, |
const string & | ccy2 | ||
) | const |
Find a convention for an FX pair
void clear | ( | ) | const |
Clear all conventions
void add | ( | const boost::shared_ptr< Convention > & | convention | ) | const |
Add a convention. This will overwrite an existing convention with the same id