#include <orea/simm/crif.hpp>
Public Types | |
enum class | CrifType { Empty , Frtb , Simm } |
Public Member Functions | |
Crif ()=default | |
CrifType | type () const |
void | addRecord (const CrifRecord &record, bool aggregateDifferentAmountCurrencies=false, bool sortFxVolQualifer=true) |
void | addRecords (const Crif &crif, bool aggregateDifferentAmountCurrencies=false, bool sortFxVolQualfier=true) |
void | clear () |
std::set< CrifRecord >::const_iterator | begin () const |
std::set< CrifRecord >::const_iterator | end () const |
std::set< CrifRecord >::const_iterator | find (const CrifRecord &r) const |
std::set< CrifRecord >::const_iterator | findBy (const NettingSetDetails nsd, CrifRecord::ProductClass pc, const CrifRecord::RiskType rt, const std::string &qualifier) const |
Find first element. More... | |
bool | empty () const |
size_t | size () const |
const bool | hasCrifRecords () const |
check if there are crif records beside simmParameters More... | |
const std::set< std::string > & | portfolioIds () const |
Give back the set of portfolio IDs that have been loaded. More... | |
const std::set< ore::data::NettingSetDetails > & | nettingSetDetails () const |
const bool | hasSimmParameters () const |
check if the Crif contains simmParameters More... | |
Crif | filterNonZeroAmount (double threshold=0.0, std::string alwaysIncludeFxRiskCcy="") const |
returns a crif without zero amount records, FXRisk entries in currency alwaysIncludeFxRiskCcy are always included More... | |
Crif | simmParameters () const |
returns a Crif containing only simmParameter entries More... | |
void | setSimmParameters (const Crif &crif) |
deletes all existing simmParameter and replaces them with the new one More... | |
void | setCrifRecords (const Crif &crif) |
deletes all existing simmParameter and replaces them with the new one More... | |
void | fillAmountUsd (const QuantLib::ext::shared_ptr< ore::data::Market > market) |
bool | hasNettingSetDetails () const |
Check if netting set details are used anywhere, instead of just the netting set ID. More... | |
Crif | aggregate () const |
Aggregate all existing records. More... | |
size_t | countMatching (const NettingSetDetails &nsd, const CrifRecord::ProductClass pc, const CrifRecord::RiskType rt, const std::string &qualifier) const |
std::set< CrifRecord::ProductClass > | ProductClassesByNettingSetDetails (const NettingSetDetails nsd) const |
std::set< std::string > | qualifiersBy (const NettingSetDetails nsd, CrifRecord::ProductClass pc, const CrifRecord::RiskType rt) const |
std::vector< CrifRecord > | filterByQualifierAndBucket (const NettingSetDetails &nsd, const CrifRecord::ProductClass pc, const CrifRecord::RiskType rt, const std::string &qualifier, const std::string &bucket) const |
std::vector< CrifRecord > | filterByQualifier (const NettingSetDetails &nsd, const CrifRecord::ProductClass pc, const CrifRecord::RiskType rt, const std::string &qualifier) const |
std::vector< CrifRecord > | filterByBucket (const NettingSetDetails &nsd, const CrifRecord::ProductClass pc, const CrifRecord::RiskType rt, const std::string &bucket) const |
std::vector< CrifRecord > | filterBy (const NettingSetDetails &nsd, const CrifRecord::ProductClass pc, const CrifRecord::RiskType rt) const |
std::vector< CrifRecord > | filterBy (const CrifRecord::RiskType rt) const |
std::vector< CrifRecord > | filterByTradeId (const std::string &id) const |
std::set< std::string > | tradeIds () const |
Private Member Functions | |
void | insertCrifRecord (const CrifRecord &record, bool aggregateDifferentAmountCurrencies=false) |
void | addFrtbCrifRecord (const CrifRecord &record, bool aggregateDifferentAmountCurrencies=false, bool sortFxVolQualifer=true) |
void | addSimmCrifRecord (const CrifRecord &record, bool aggregateDifferentAmountCurrencies=false, bool sortFxVolQualifer=true) |
void | addSimmParameterRecord (const CrifRecord &record) |
void | updateAmountExistingRecord (std::set< CrifRecord >::iterator &it, const CrifRecord &record) |
void | updateAmountExistingRecord (std::map< CrifRecord::SimmAmountCcyKey, const CrifRecord * >::iterator &it, const CrifRecord &record) |
Private Attributes | |
CrifType | type_ = CrifType::Empty |
std::set< CrifRecord > | records_ |
std::map< CrifRecord::SimmAmountCcyKey, const CrifRecord * > | diffAmountCurrenciesIndex_ |
std::set< std::string > | portfolioIds_ |
Set of portfolio IDs that have been loaded. More... | |
std::set< ore::data::NettingSetDetails > | nettingSetDetails_ |
|
default |
CrifType type | ( | ) | const |
void addRecord | ( | const CrifRecord & | record, |
bool | aggregateDifferentAmountCurrencies = false , |
||
bool | sortFxVolQualifer = true |
||
) |
Definition at line 41 of file crif.cpp.
void addRecords | ( | const Crif & | crif, |
bool | aggregateDifferentAmountCurrencies = false , |
||
bool | sortFxVolQualfier = true |
||
) |
Definition at line 154 of file crif.cpp.
std::set< CrifRecord >::const_iterator begin | ( | ) | const |
std::set< CrifRecord >::const_iterator end | ( | ) | const |
std::set< CrifRecord >::const_iterator find | ( | const CrifRecord & | r | ) | const |
std::set< CrifRecord >::const_iterator findBy | ( | const NettingSetDetails | nsd, |
CrifRecord::ProductClass | pc, | ||
const CrifRecord::RiskType | rt, | ||
const std::string & | qualifier | ||
) | const |
Find first element.
Definition at line 196 of file crif.cpp.
bool empty | ( | ) | const |
const bool hasCrifRecords | ( | ) | const |
const std::set< std::string > & portfolioIds | ( | ) | const |
Give back the set of portfolio IDs that have been loaded.
Simm methods Give back the set of portfolio IDs that have been loaded
Definition at line 321 of file crif.cpp.
const std::set< NettingSetDetails > & nettingSetDetails | ( | ) | const |
Definition at line 322 of file crif.cpp.
const bool hasSimmParameters | ( | ) | const |
Crif filterNonZeroAmount | ( | double | threshold = 0.0 , |
std::string | alwaysIncludeFxRiskCcy = "" |
||
) | const |
returns a crif without zero amount records, FXRisk entries in currency alwaysIncludeFxRiskCcy are always included
Definition at line 204 of file crif.cpp.
Crif simmParameters | ( | ) | const |
void setSimmParameters | ( | const Crif & | crif | ) |
deletes all existing simmParameter and replaces them with the new one
Definition at line 290 of file crif.cpp.
void setCrifRecords | ( | const Crif & | crif | ) |
deletes all existing simmParameter and replaces them with the new one
Definition at line 305 of file crif.cpp.
void fillAmountUsd | ( | const QuantLib::ext::shared_ptr< ore::data::Market > | market | ) |
For each CRIF record checks if amountCurrency and amount are defined and uses these to populate the record's amountUsd
Definition at line 351 of file crif.cpp.
bool hasNettingSetDetails | ( | ) | const |
Check if netting set details are used anywhere, instead of just the netting set ID.
Definition at line 342 of file crif.cpp.
Crif aggregate | ( | ) | const |
Aggregate all existing records.
Definition at line 160 of file crif.cpp.
size_t countMatching | ( | const NettingSetDetails & | nsd, |
const CrifRecord::ProductClass | pc, | ||
const CrifRecord::RiskType | rt, | ||
const std::string & | qualifier | ||
) | const |
Definition at line 334 of file crif.cpp.
std::set< CrifRecord::ProductClass > ProductClassesByNettingSetDetails | ( | const NettingSetDetails | nsd | ) | const |
std::set< std::string > qualifiersBy | ( | const NettingSetDetails | nsd, |
CrifRecord::ProductClass | pc, | ||
const CrifRecord::RiskType | rt | ||
) | const |
Definition at line 227 of file crif.cpp.
std::vector< CrifRecord > filterByQualifierAndBucket | ( | const NettingSetDetails & | nsd, |
const CrifRecord::ProductClass | pc, | ||
const CrifRecord::RiskType | rt, | ||
const std::string & | qualifier, | ||
const std::string & | bucket | ||
) | const |
Definition at line 236 of file crif.cpp.
std::vector< CrifRecord > filterByQualifier | ( | const NettingSetDetails & | nsd, |
const CrifRecord::ProductClass | pc, | ||
const CrifRecord::RiskType | rt, | ||
const std::string & | qualifier | ||
) | const |
std::vector< CrifRecord > filterByBucket | ( | const NettingSetDetails & | nsd, |
const CrifRecord::ProductClass | pc, | ||
const CrifRecord::RiskType | rt, | ||
const std::string & | bucket | ||
) | const |
std::vector< CrifRecord > filterBy | ( | const NettingSetDetails & | nsd, |
const CrifRecord::ProductClass | pc, | ||
const CrifRecord::RiskType | rt | ||
) | const |
std::vector< CrifRecord > filterBy | ( | const CrifRecord::RiskType | rt | ) | const |
std::vector< CrifRecord > filterByTradeId | ( | const std::string & | id | ) | const |
std::set< std::string > tradeIds | ( | ) | const |
|
private |
Definition at line 77 of file crif.cpp.
|
private |
Definition at line 51 of file crif.cpp.
|
private |
Definition at line 60 of file crif.cpp.
|
private |
Definition at line 96 of file crif.cpp.
|
private |
Definition at line 117 of file crif.cpp.
|
private |
Definition at line 135 of file crif.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |