Logo
Reference manual - version orea_version
Public Types | Public Member Functions | List of all members
SimmResults Class Reference

#include <orea/simm/simmresults.hpp>

Public Types

typedef SimmConfiguration::ProductClass ProductClass
 
typedef SimmConfiguration::RiskClass RiskClass
 
typedef SimmConfiguration::MarginType MarginType
 
typedef std::tuple< ProductClass, RiskClass, MarginType, std::string > Key
 

Public Member Functions

 SimmResults (const std::string &resultCcy="", const std::string &calcCcy="")
 
void add (const SimmConfiguration::ProductClass &pc, const SimmConfiguration::RiskClass &rc, const SimmConfiguration::MarginType &mt, const std::string &b, QuantLib::Real im, const std::string &resultCurrency, const std::string &calculationCurrency, const bool overwrite)
 
void convert (const boost::shared_ptr< ore::data::Market > &market, const std::string &currency)
 Convert SIMM amounts to a different currency.
 
void convert (QuantLib::Real fxSpot, const std::string &currency)
 
QuantLib::Real get (const SimmConfiguration::ProductClass &pc, const SimmConfiguration::RiskClass &rc, const SimmConfiguration::MarginType &mt, const std::string b) const
 
bool has (const SimmConfiguration::ProductClass &pc, const SimmConfiguration::RiskClass &rc, const SimmConfiguration::MarginType &mt, const std::string b) const
 
bool empty () const
 Return true if the container is empty, otherwise false.
 
void clear ()
 Clear the results from the container.
 
const std::map< Key, QuantLib::Real > & data () const
 Return the map containing the results.
 
std::map< Key, QuantLib::Real > & data ()
 
std::string & resultCurrency ()
 
const std::string & resultCurrency () const
 
std::string & calculationCurrency ()
 
const std::string & calculationCurrency () const
 

Detailed Description

A container for SIMM results broken down by product class, risk class and margin type.

Member Function Documentation

◆ add()

void add ( const SimmConfiguration::ProductClass pc,
const SimmConfiguration::RiskClass rc,
const SimmConfiguration::MarginType mt,
const std::string &  b,
QuantLib::Real  im,
const std::string &  resultCurrency,
const std::string &  calculationCurrency,
const bool  overwrite 
)

Add initial margin value im to the results container for the given combination of SIMM product class, risk class and margin type

Remarks
If there is already a result in the container for that combination, it is overwritten if overwrite=true. Otherwise, the amounts are added together. Can check this using the has method before adding.

◆ get()

QuantLib::Real get ( const SimmConfiguration::ProductClass pc,
const SimmConfiguration::RiskClass rc,
const SimmConfiguration::MarginType mt,
const std::string  b 
) const

Get the initial margin value from the results container for the given combination of SIMM product class, risk class and margin type

Warning:
returns QuantLib::Null<QuantLib::Real> if there is no initial margin value in the results for the given combination. Can avoid this by first checking the results using the has method.

◆ has()

bool has ( const SimmConfiguration::ProductClass pc,
const SimmConfiguration::RiskClass rc,
const SimmConfiguration::MarginType mt,
const std::string  b 
) const

Check if there is an initial margin value in the results container for the given combination of SIMM product class, risk class and margin type