#include <orea/simm/simmbucketmapperbase.hpp>
Public Member Functions | |
SimmBucketMapperBase (const QuantLib::ext::shared_ptr< ore::data::ReferenceDataManager > &refDataManager=nullptr, const QuantLib::ext::shared_ptr< SimmBasicNameMapper > &nameMapper=nullptr) | |
Default constructor that adds fixed known mappings. More... | |
std::string | bucket (const CrifRecord::RiskType &riskType, const std::string &qualifier) const override |
bool | hasBuckets (const CrifRecord::RiskType &riskType) const override |
Check if the given SIMM RiskType has a bucket structure. More... | |
bool | has (const CrifRecord::RiskType &riskType, const std::string &qualifier, boost::optional< bool > fallback=boost::none) const override |
Check if the given riskType and qualifier has a valid mapping. More... | |
Public Member Functions inherited from SimmBucketMapper | |
virtual | ~SimmBucketMapper () |
Destructor. More... | |
virtual std::string | bucket (const CrifRecord::RiskType &riskType, const std::string &qualifier) const =0 |
virtual bool | hasBuckets (const CrifRecord::RiskType &riskType) const =0 |
Check if the given SIMM RiskType has a bucket structure. More... | |
virtual bool | has (const CrifRecord::RiskType &riskType, const std::string &qualifier, boost::optional< bool > fallback=boost::none) const =0 |
Check if the given riskType and qualifier has a mapping (which is valid, and matches the fallback flag if given) More... | |
virtual void | addMapping (const CrifRecord::RiskType &riskType, const std::string &qualifier, const std::string &bucket, const std::string &validFrom="", const std::string &validTo="", bool fallback=false)=0 |
Add a single bucket mapping for qualifier with risk type riskType . More... | |
virtual const std::set< FailedMapping > & | failedMappings () const =0 |
void | updateFromCrif (const ore::analytics::Crif &crif) |
Public Member Functions inherited from XMLSerializable | |
virtual | ~XMLSerializable () |
virtual void | fromXML (XMLNode *node)=0 |
virtual XMLNode * | toXML (XMLDocument &doc) const=0 |
void | fromFile (const std::string &filename) |
void | toFile (const std::string &filename) const |
void | fromXMLString (const std::string &xml) |
std::string | toXMLString () const |
Serialisation | |
std::map< CrifRecord::RiskType, std::map< std::string, std::set< BucketMapping > > > | bucketMapping_ |
std::set< CrifRecord::RiskType > | rtWithBuckets_ |
Set of SIMM risk types that have buckets. More... | |
std::map< std::pair< CrifRecord::RiskType, std::string >, std::string > | cache_ |
QuantLib::ext::shared_ptr< ore::data::ReferenceDataManager > | refDataManager_ |
Reference data manager. More... | |
QuantLib::ext::shared_ptr< SimmBasicNameMapper > | nameMapper_ |
Simm Name Mapper. More... | |
std::set< FailedMapping > | failedMappings_ |
ore::data::XMLNode * | toXML (ore::data::XMLDocument &) const override |
void | fromXML (ore::data::XMLNode *node) override |
void | addMapping (const CrifRecord::RiskType &riskType, const std::string &qualifier, const std::string &bucket, const std::string &validFrom="", const std::string &validTo="", bool fallback=false) override |
Add a single bucket mapping for qualifier with risk type riskType . More... | |
void | setSimmNameMapper (const QuantLib::ext::shared_ptr< SimmBasicNameMapper > nameMapper) |
Set the Reference data manager. More... | |
void | setRefDataManger (const QuantLib::ext::shared_ptr< ore::data::BasicReferenceDataManager > &refDataManager) |
Set the Reference data manager. More... | |
const std::set< FailedMapping > & | failedMappings () const override |
virtual std::string | irBucket (const std::string &qualifier) const |
void | checkRiskType (const CrifRecord::RiskType &riskType) const |
Check the risk type before adding a mapping entry. More... | |
void | reset () |
Reset the SIMM bucket mapper i.e. clears all mappings and adds the initial hard-coded commodity mappings. More... | |
Definition at line 58 of file simmbucketmapperbase.hpp.
SimmBucketMapperBase | ( | const QuantLib::ext::shared_ptr< ore::data::ReferenceDataManager > & | refDataManager = nullptr , |
const QuantLib::ext::shared_ptr< SimmBasicNameMapper > & | nameMapper = nullptr |
||
) |
Default constructor that adds fixed known mappings.
Definition at line 52 of file simmbucketmapperbase.cpp.
|
overridevirtual |
Return the SIMM bucket for a given SIMM RiskType and SIMM Qualifier. An error is thrown if there is no bucket for the combination.
Implements SimmBucketMapper.
Definition at line 87 of file simmbucketmapperbase.cpp.
|
overridevirtual |
Check if the given SIMM RiskType has a bucket structure.
Implements SimmBucketMapper.
Definition at line 190 of file simmbucketmapperbase.cpp.
|
overridevirtual |
Check if the given riskType
and qualifier
has a valid mapping.
Implements SimmBucketMapper.
Definition at line 192 of file simmbucketmapperbase.cpp.
|
overridevirtual |
Implements XMLSerializable.
Definition at line 298 of file simmbucketmapperbase.cpp.
|
overridevirtual |
Implements XMLSerializable.
Definition at line 227 of file simmbucketmapperbase.cpp.
|
overridevirtual |
Add a single bucket
mapping for qualifier
with risk type riskType
.
Implements SimmBucketMapper.
Definition at line 323 of file simmbucketmapperbase.cpp.
void setSimmNameMapper | ( | const QuantLib::ext::shared_ptr< SimmBasicNameMapper > | nameMapper | ) |
Set the Reference data manager.
Definition at line 93 of file simmbucketmapperbase.hpp.
void setRefDataManger | ( | const QuantLib::ext::shared_ptr< ore::data::BasicReferenceDataManager > & | refDataManager | ) |
Set the Reference data manager.
Definition at line 96 of file simmbucketmapperbase.hpp.
|
overridevirtual |
|
protectedvirtual |
Simple logic for RiskType Risk_IRCurve. Qualifier is a currency code and this is checked here.
Definition at line 367 of file simmbucketmapperbase.cpp.
|
protected |
Check the risk type before adding a mapping entry.
Definition at line 377 of file simmbucketmapperbase.cpp.
|
private |
Reset the SIMM bucket mapper i.e. clears all mappings and adds the initial hard-coded commodity mappings.
Definition at line 388 of file simmbucketmapperbase.cpp.
|
protected |
Map from SIMM RiskType to another map that holds the SIMM Qualifier to SIMM bucket mappings
Definition at line 112 of file simmbucketmapperbase.hpp.
|
protected |
Set of SIMM risk types that have buckets.
Definition at line 115 of file simmbucketmapperbase.hpp.
|
mutableprivate |
Definition at line 118 of file simmbucketmapperbase.hpp.
|
private |
Reference data manager.
Definition at line 124 of file simmbucketmapperbase.hpp.
|
private |
Simm Name Mapper.
Definition at line 127 of file simmbucketmapperbase.hpp.
|
mutableprivate |
Definition at line 129 of file simmbucketmapperbase.hpp.