Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Crif Class Reference

#include <orea/simm/crif.hpp>

+ Collaboration diagram for Crif:

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::ProductClassProductClassesByNettingSetDetails (const NettingSetDetails nsd) const
 
std::set< std::string > qualifiersBy (const NettingSetDetails nsd, CrifRecord::ProductClass pc, const CrifRecord::RiskType rt) const
 
std::vector< CrifRecordfilterByQualifierAndBucket (const NettingSetDetails &nsd, const CrifRecord::ProductClass pc, const CrifRecord::RiskType rt, const std::string &qualifier, const std::string &bucket) const
 
std::vector< CrifRecordfilterByQualifier (const NettingSetDetails &nsd, const CrifRecord::ProductClass pc, const CrifRecord::RiskType rt, const std::string &qualifier) const
 
std::vector< CrifRecordfilterByBucket (const NettingSetDetails &nsd, const CrifRecord::ProductClass pc, const CrifRecord::RiskType rt, const std::string &bucket) const
 
std::vector< CrifRecordfilterBy (const NettingSetDetails &nsd, const CrifRecord::ProductClass pc, const CrifRecord::RiskType rt) const
 
std::vector< CrifRecordfilterBy (const CrifRecord::RiskType rt) const
 
std::vector< CrifRecordfilterByTradeId (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< CrifRecordrecords_
 
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::NettingSetDetailsnettingSetDetails_
 

Detailed Description

Definition at line 35 of file crif.hpp.

Member Enumeration Documentation

◆ CrifType

enum class CrifType
strong
Enumerator
Empty 
Frtb 
Simm 

Definition at line 37 of file crif.hpp.

Constructor & Destructor Documentation

◆ Crif()

Crif ( )
default

Member Function Documentation

◆ type()

CrifType type ( ) const

Definition at line 40 of file crif.hpp.

40{ return type_; }
CrifType type_
Definition: crif.hpp:125
+ Here is the caller graph for this function:

◆ addRecord()

void addRecord ( const CrifRecord record,
bool  aggregateDifferentAmountCurrencies = false,
bool  sortFxVolQualifer = true 
)

Definition at line 41 of file crif.cpp.

41 {
42 if (record.type() == CrifRecord::RecordType::FRTB) {
43 addFrtbCrifRecord(record, aggregateDifferentAmountCurrencies, sortFxVolQualifer);
44 } else if (record.type() == CrifRecord::RecordType::SIMM && !record.isSimmParameter()) {
45 addSimmCrifRecord(record, aggregateDifferentAmountCurrencies, sortFxVolQualifer);
46 } else {
48 }
49}
void addFrtbCrifRecord(const CrifRecord &record, bool aggregateDifferentAmountCurrencies=false, bool sortFxVolQualifer=true)
Definition: crif.cpp:51
void addSimmParameterRecord(const CrifRecord &record)
Definition: crif.cpp:96
void addSimmCrifRecord(const CrifRecord &record, bool aggregateDifferentAmountCurrencies=false, bool sortFxVolQualifer=true)
Definition: crif.cpp:60
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addRecords()

void addRecords ( const Crif crif,
bool  aggregateDifferentAmountCurrencies = false,
bool  sortFxVolQualfier = true 
)

Definition at line 154 of file crif.cpp.

154 {
155 for (const auto& r : crif.records_) {
156 addRecord(r, aggregateDifferentAmountCurrencies, sortFxVolQualifer);
157 }
158}
void addRecord(const CrifRecord &record, bool aggregateDifferentAmountCurrencies=false, bool sortFxVolQualifer=true)
Definition: crif.cpp:41
+ Here is the call graph for this function:

◆ clear()

void clear ( )

Definition at line 45 of file crif.hpp.

45{ records_.clear(); }
std::set< CrifRecord > records_
Definition: crif.hpp:126

◆ begin()

std::set< CrifRecord >::const_iterator begin ( ) const

Definition at line 47 of file crif.hpp.

47{ return records_.cbegin(); }

◆ end()

std::set< CrifRecord >::const_iterator end ( ) const

Definition at line 48 of file crif.hpp.

48{ return records_.cend(); }
+ Here is the caller graph for this function:

◆ find()

std::set< CrifRecord >::const_iterator find ( const CrifRecord r) const

Definition at line 49 of file crif.hpp.

49{ return records_.find(r); }

◆ findBy()

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.

197 {
198 return std::find_if(records_.begin(), records_.end(), [&nsd, &pc, &rt, &qualifier](const CrifRecord& record) {
199 return record.nettingSetDetails == nsd && record.productClass == pc && record.riskType == rt &&
200 record.qualifier == qualifier;
201 });
202};
+ Here is the caller graph for this function:

◆ empty()

bool empty ( ) const

Definition at line 55 of file crif.hpp.

55{ return records_.empty(); }
+ Here is the caller graph for this function:

◆ size()

size_t size ( ) const

Definition at line 57 of file crif.hpp.

57{ return records_.size(); }

◆ hasCrifRecords()

const bool hasCrifRecords ( ) const

check if there are crif records beside simmParameters

Definition at line 174 of file crif.cpp.

174 {
175 auto it = std::find_if(records_.begin(), records_.end(), isNotSimmParameter);
176 return it != records_.end();
177}
auto isNotSimmParameter
Definition: crif.cpp:39

◆ portfolioIds()

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.

321{ return portfolioIds_; }
std::set< std::string > portfolioIds_
Set of portfolio IDs that have been loaded.
Definition: crif.hpp:131

◆ nettingSetDetails()

const std::set< NettingSetDetails > & nettingSetDetails ( ) const

Definition at line 322 of file crif.cpp.

322{ return nettingSetDetails_; }
std::set< ore::data::NettingSetDetails > nettingSetDetails_
Definition: crif.hpp:132

◆ hasSimmParameters()

const bool hasSimmParameters ( ) const

check if the Crif contains simmParameters

Definition at line 180 of file crif.cpp.

180 {
181 auto it = std::find_if(records_.begin(), records_.end(), isSimmParameter);
182 return it != records_.end();
183}
auto isSimmParameter
Definition: crif.cpp:38

◆ filterNonZeroAmount()

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.

204 {
205 Crif results;
206 for (auto record : records_) {
207 QL_REQUIRE(record.amount != QuantLib::Null<QuantLib::Real>() || record.amountUsd != QuantLib::Null<double>(),
208 "Internal Error, amount and amountUsd are empty");
209 double absAmount = 0.0;
210 if ((record.amount != QuantLib::Null<double>()) && (record.amountUsd != QuantLib::Null<double>())) {
211 absAmount = std::max(std::fabs(record.amount), std::fabs(record.amountUsd));
212 } else if (record.amount != QuantLib::Null<double>()) {
213 absAmount = std::fabs(record.amount);
214 } else if (record.amountUsd != QuantLib::Null<double>()) {
215 absAmount = std::fabs(record.amountUsd);
216 }
217 bool add = (absAmount > threshold && !QuantLib::close_enough(absAmount, threshold));
218 if (!alwaysIncludeFxRiskCcy.empty())
219 add = add || (record.riskType == CrifRecord::RiskType::FX && record.qualifier == alwaysIncludeFxRiskCcy);
220 if (add) {
221 results.addRecord(record);
222 }
223 }
224 return results;
225}
+ Here is the call graph for this function:

◆ simmParameters()

Crif simmParameters ( ) const

returns a Crif containing only simmParameter entries

Definition at line 186 of file crif.cpp.

186 {
187 Crif results;
188 for (const auto& record : records_) {
189 if (record.isSimmParameter()) {
190 results.addSimmParameterRecord(record);
191 }
192 }
193 return results;
194}
+ Here is the call graph for this function:

◆ setSimmParameters()

void setSimmParameters ( const Crif crif)

deletes all existing simmParameter and replaces them with the new one

Definition at line 290 of file crif.cpp.

290 {
291 auto backup = records_;
292 records_.clear();
293 for (auto& r : backup) {
294 if (!r.isSimmParameter()) {
295 addRecord(r);
296 }
297 }
298 for (const auto& r : crif) {
299 if (r.isSimmParameter()) {
301 }
302 }
303}
+ Here is the call graph for this function:

◆ setCrifRecords()

void setCrifRecords ( const Crif crif)

deletes all existing simmParameter and replaces them with the new one

Definition at line 305 of file crif.cpp.

305 {
306 auto backup = records_;
307 records_.clear();
308 for (auto& r : backup) {
309 if (r.isSimmParameter()) {
310 addRecord(r);
311 }
312 }
313 for (const auto& r : crif) {
314 if (!r.isSimmParameter()) {
315 addRecord(r);
316 }
317 }
318}
+ Here is the call graph for this function:

◆ fillAmountUsd()

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.

351 {
352 if (!market) {
353 WLOG("CrifLoader::fillAmountUsd() was called, but market object is empty.")
354 return;
355 }
356 std::set<CrifRecord> results;
357
358 for (const CrifRecord& r : records_) {
359 auto cr = r;
360 // Fill in amount USD if it is missing and if CRIF record requires it (i.e. if it has amount and amount
361 // currency, and risk type is neither AddOnNotionalFactor or ProductClassMultiplier)
362 if (cr.requiresAmountUsd() && !cr.hasAmountUsd()) {
363 if (!cr.hasAmount() || !cr.hasAmountCcy()) {
365 cr.tradeId, cr.tradeType, "Populating CRIF amount USD",
366 "CRIF record is missing one of Amount and AmountCurrency, and there is no amountUsd value to "
367 "fall back to: " +
369 .log();
370 } else {
371 double usdSpot = market->fxRate(cr.amountCurrency + "USD")->value();
372 cr.amountUsd = cr.amount * usdSpot;
373 }
374 }
375 results.insert(cr);
376 }
377 records_ = results;
378}
#define WLOG(text)
std::string to_string(const LocationInfo &l)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasNettingSetDetails()

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.

342 {
343 bool hasNettingSetDetails = false;
344 for (const auto& nsd : nettingSetDetails_) {
345 if (!nsd.emptyOptionalFields())
347 }
349}
bool hasNettingSetDetails() const
Check if netting set details are used anywhere, instead of just the netting set ID.
Definition: crif.cpp:342
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ aggregate()

Crif aggregate ( ) const

Aggregate all existing records.

Definition at line 160 of file crif.cpp.

160 {
161 Crif result;
162 for (auto cr : records_) {
163 // We set the trade ID to an empty string because we are netting at portfolio level
164 // The only exception here is schedule trades that are denoted by two rows,
165 // with RiskType::Notional and RiskType::PV
166 if (cr.imModel != "Schedule") {
167 cr.tradeId = "";
168 }
169 result.addRecord(cr);
170 }
171 return result;
172}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ countMatching()

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.

335 {
336 return std::count_if(records_.begin(), records_.end(), [&nsd, &pc, &rt, &qualifier](const CrifRecord& record) {
337 return record.nettingSetDetails == nsd && record.productClass == pc && record.riskType == rt &&
338 record.qualifier == qualifier;
339 });
340}
+ Here is the caller graph for this function:

◆ ProductClassesByNettingSetDetails()

std::set< CrifRecord::ProductClass > ProductClassesByNettingSetDetails ( const NettingSetDetails  nsd) const

Definition at line 324 of file crif.cpp.

324 {
325 std::set<CrifRecord::ProductClass> keys;
326 for (const auto& record : records_) {
327 if (record.nettingSetDetails == nsd) {
328 keys.insert(record.productClass);
329 }
330 }
331 return keys;
332}
+ Here is the caller graph for this function:

◆ qualifiersBy()

std::set< std::string > qualifiersBy ( const NettingSetDetails  nsd,
CrifRecord::ProductClass  pc,
const CrifRecord::RiskType  rt 
) const

Definition at line 227 of file crif.cpp.

228 {
229 auto res = records_ | boost::adaptors::filtered([&nsd, &pc, &rt](const CrifRecord& record) {
230 return record.nettingSetDetails == nsd && record.productClass == pc && record.riskType == rt;
231 }) |
232 boost::adaptors::transformed([](const CrifRecord& record) { return record.qualifier; });
233 return boost::copy_range<std::set<std::string>>(res);
234}
+ Here is the caller graph for this function:

◆ filterByQualifierAndBucket()

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.

239 {
240 return boost::copy_range<std::vector<CrifRecord>>(
241 records_ | boost::adaptors::filtered([&nsd, &pc, &rt, &qualifier, &bucket](const CrifRecord& record) {
242 return record.nettingSetDetails == nsd && record.productClass == pc && record.riskType == rt &&
243 record.qualifier == qualifier && record.bucket == bucket;
244 }));
245}

◆ filterByQualifier()

std::vector< CrifRecord > filterByQualifier ( const NettingSetDetails nsd,
const CrifRecord::ProductClass  pc,
const CrifRecord::RiskType  rt,
const std::string &  qualifier 
) const

Definition at line 247 of file crif.cpp.

248 {
249
250 return boost::copy_range<std::vector<CrifRecord>>(
251 records_ | boost::adaptors::filtered([&nsd, &pc, &rt, &qualifier](const CrifRecord& record) {
252 return record.nettingSetDetails == nsd && record.productClass == pc && record.riskType == rt &&
253 record.qualifier == qualifier;
254 }));
255}
+ Here is the caller graph for this function:

◆ filterByBucket()

std::vector< CrifRecord > filterByBucket ( const NettingSetDetails nsd,
const CrifRecord::ProductClass  pc,
const CrifRecord::RiskType  rt,
const std::string &  bucket 
) const

Definition at line 257 of file crif.cpp.

258 {
259 return boost::copy_range<std::vector<CrifRecord>>(
260 records_ | boost::adaptors::filtered([&nsd, &pc, &rt, &bucket](const CrifRecord& record) {
261 return record.nettingSetDetails == nsd && record.productClass == pc && record.riskType == rt &&
262 record.bucket == bucket;
263 }));
264}
+ Here is the caller graph for this function:

◆ filterBy() [1/2]

std::vector< CrifRecord > filterBy ( const NettingSetDetails nsd,
const CrifRecord::ProductClass  pc,
const CrifRecord::RiskType  rt 
) const

Definition at line 266 of file crif.cpp.

267 {
268 return boost::copy_range<std::vector<CrifRecord>>(
269 records_ | boost::adaptors::filtered([&nsd, &pc, &rt](const CrifRecord& record) {
270 return record.nettingSetDetails == nsd && record.productClass == pc && record.riskType == rt;
271 }));
272}
+ Here is the caller graph for this function:

◆ filterBy() [2/2]

std::vector< CrifRecord > filterBy ( const CrifRecord::RiskType  rt) const

Definition at line 274 of file crif.cpp.

274 {
275 return boost::copy_range<std::vector<CrifRecord>>(
276 records_ | boost::adaptors::filtered([&rt](const CrifRecord& record) { return record.riskType == rt; }));
277}

◆ filterByTradeId()

std::vector< CrifRecord > filterByTradeId ( const std::string &  id) const

Definition at line 279 of file crif.cpp.

279 {
280 return boost::copy_range<std::vector<CrifRecord>>(
281 records_ | boost::adaptors::filtered([&id](const CrifRecord& record) { return record.tradeId == id; }));
282}

◆ tradeIds()

std::set< std::string > tradeIds ( ) const

Definition at line 284 of file crif.cpp.

284 {
285 return boost::copy_range<std::set<std::string>>(
286 records_ | boost::adaptors::transformed([](const CrifRecord& r) { return r.tradeId; }));
287}

◆ insertCrifRecord()

void insertCrifRecord ( const CrifRecord record,
bool  aggregateDifferentAmountCurrencies = false 
)
private

Definition at line 77 of file crif.cpp.

77 {
78
79 auto it = aggregateDifferentAmountCurrencies ? records_.end() : records_.find(record);
80 auto itDiffAmountCcy = aggregateDifferentAmountCurrencies
81 ? diffAmountCurrenciesIndex_.find(record.getSimmAmountCcyKey())
83
84 if (it == records_.end() && itDiffAmountCcy == diffAmountCurrenciesIndex_.end()) {
85 auto recordIt = records_.insert(record);
86 diffAmountCurrenciesIndex_[record.getSimmAmountCcyKey()] = &(*(recordIt.first));
87 portfolioIds_.insert(record.portfolioId);
88 nettingSetDetails_.insert(record.nettingSetDetails);
89 } else if (it != records_.end()) {
91 } else {
92 updateAmountExistingRecord(itDiffAmountCcy, record);
93 }
94}
void updateAmountExistingRecord(std::set< CrifRecord >::iterator &it, const CrifRecord &record)
Definition: crif.cpp:117
std::map< CrifRecord::SimmAmountCcyKey, const CrifRecord * > diffAmountCurrenciesIndex_
Definition: crif.hpp:127
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addFrtbCrifRecord()

void addFrtbCrifRecord ( const CrifRecord record,
bool  aggregateDifferentAmountCurrencies = false,
bool  sortFxVolQualifer = true 
)
private

Definition at line 51 of file crif.cpp.

52 {
53 QL_REQUIRE(type_ == CrifType::Empty || type_ == CrifType::Frtb, "Can not add a FRTB crif record to a SIMM Crif");
54 if (type_ == CrifType::Empty) {
56 }
57 insertCrifRecord(record, aggregateDifferentAmountCurrencies);
58}
void insertCrifRecord(const CrifRecord &record, bool aggregateDifferentAmountCurrencies=false)
Definition: crif.cpp:77
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addSimmCrifRecord()

void addSimmCrifRecord ( const CrifRecord record,
bool  aggregateDifferentAmountCurrencies = false,
bool  sortFxVolQualifer = true 
)
private

Definition at line 60 of file crif.cpp.

61 {
62 QL_REQUIRE(type_ == CrifType::Empty || type_ == CrifType::Simm, "Can not add a Simm crif record to a Frtb Crif");
63 if (type_ == CrifType::Empty) {
65 }
66 auto recordToAdd = record;
67 if (sortFxVolQualifer && recordToAdd.riskType == CrifRecord::RiskType::FXVol) {
68 auto ccy_1 = recordToAdd.qualifier.substr(0, 3);
69 auto ccy_2 = recordToAdd.qualifier.substr(3);
70 if (ccy_1 > ccy_2)
71 ccy_1.swap(ccy_2);
72 recordToAdd.qualifier = ccy_1 + ccy_2;
73 }
74 insertCrifRecord(recordToAdd, aggregateDifferentAmountCurrencies);
75}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addSimmParameterRecord()

void addSimmParameterRecord ( const CrifRecord record)
private

Definition at line 96 of file crif.cpp.

96 {
97 auto it = records_.find(record);
98 if (it == records_.end()) {
99 CrifRecord newRecord = record;
100 records_.insert(newRecord);
101 diffAmountCurrenciesIndex_[record.getSimmAmountCcyKey()] = &newRecord;
102 } else if (it->riskType == CrifRecord::RiskType::AddOnFixedAmount) {
103 updateAmountExistingRecord(it, record);
104 } else if (it->riskType == CrifRecord::RiskType::AddOnNotionalFactor ||
105 it->riskType == CrifRecord::RiskType::ProductClassMultiplier) {
106 // Only log warning if the values are not the same. If they are, then there is no material discrepancy.
107 if (record.amount != it->amount) {
108 string errMsg = "Found more than one instance of risk type " + ore::data::to_string(it->riskType) +
109 ". Please check the SIMM parameters input. If enforceIMRegulations=False, then it "
110 "is possible that multiple entries for different regulations now belong under the same "
111 "'Unspecified' regulation.";
112 ore::analytics::StructuredAnalyticsWarningMessage("SIMM", "Aggregating SIMM parameters", errMsg).log();
113 }
114 }
115}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateAmountExistingRecord() [1/2]

void updateAmountExistingRecord ( std::set< CrifRecord >::iterator &  it,
const CrifRecord record 
)
private

Definition at line 117 of file crif.cpp.

117 {
118 bool updated = false;
119 if (record.hasAmountUsd()) {
120 it->amountUsd += record.amountUsd;
121 updated = true;
122 }
123 if (record.hasAmount() && record.hasAmountCcy() && it->amountCurrency == record.amountCurrency) {
124 it->amount += record.amount;
125 updated = true;
126 }
127 if (record.hasAmountResultCcy() && record.hasResultCcy() && it->resultCurrency == record.resultCurrency) {
128 it->amountResultCcy += record.amountResultCcy;
129 updated = true;
130 }
131 if (updated)
132 DLOG("Updated net CRIF records: " << *it)
133}
#define DLOG(text)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateAmountExistingRecord() [2/2]

void updateAmountExistingRecord ( std::map< CrifRecord::SimmAmountCcyKey, const CrifRecord * >::iterator &  it,
const CrifRecord record 
)
private

Definition at line 135 of file crif.cpp.

136 {
137 bool updated = false;
138 if (record.hasAmountUsd()) {
139 it->second->amountUsd += record.amountUsd;
140 updated = true;
141 }
142 if (record.hasAmount() && record.hasAmountCcy() && it->second->amountCurrency == record.amountCurrency) {
143 it->second->amount += record.amount;
144 updated = true;
145 }
146 if (record.hasAmountResultCcy() && record.hasResultCcy() && it->second->resultCurrency == record.resultCurrency) {
147 it->second->amountResultCcy += record.amountResultCcy;
148 updated = true;
149 }
150 if (updated)
151 DLOG("Updated net CRIF records: " << *(it->second))
152}
+ Here is the call graph for this function:

Member Data Documentation

◆ type_

CrifType type_ = CrifType::Empty
private

Definition at line 125 of file crif.hpp.

◆ records_

std::set<CrifRecord> records_
private

Definition at line 126 of file crif.hpp.

◆ diffAmountCurrenciesIndex_

std::map<CrifRecord::SimmAmountCcyKey, const CrifRecord*> diffAmountCurrenciesIndex_
private

Definition at line 127 of file crif.hpp.

◆ portfolioIds_

std::set<std::string> portfolioIds_
private

Set of portfolio IDs that have been loaded.

Definition at line 131 of file crif.hpp.

◆ nettingSetDetails_

std::set<ore::data::NettingSetDetails> nettingSetDetails_
private

Definition at line 132 of file crif.hpp.