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

#include <ored/marketdata/todaysmarketparameters.hpp>

+ Collaboration diagram for MarketConfiguration:

Public Member Functions

 MarketConfiguration (map< MarketObject, string > marketObjectIds={})
 
string operator() (const MarketObject o) const
 
void setId (const MarketObject o, const string &id)
 
void add (const MarketConfiguration &o)
 

Private Attributes

map< MarketObject, string > marketObjectIds_
 

Detailed Description

Definition at line 57 of file todaysmarketparameters.hpp.

Constructor & Destructor Documentation

◆ MarketConfiguration()

MarketConfiguration ( map< MarketObject, string >  marketObjectIds = {})

Definition at line 94 of file todaysmarketparameters.cpp.

94 {
95 for (Size i = 0; i < marketObjectData.size(); ++i) {
96 marketObjectIds_[marketObjectData[i].obj] = Market::defaultConfiguration;
97 }
98
99 for (const auto& moi : marketObjectIds)
100 setId(moi.first, moi.second);
101}
void setId(const MarketObject o, const string &id)
map< MarketObject, string > marketObjectIds_
static const string defaultConfiguration
Default configuration label.
Definition: market.hpp:296
+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

string operator() ( const MarketObject  o) const

Definition at line 103 of file todaysmarketparameters.cpp.

103 {
104 QL_REQUIRE(marketObjectIds_.find(o) != marketObjectIds_.end(),
105 "MarketConfiguration: did not find MarketObject " << o << " (this is unexpected)");
106 return marketObjectIds_.at(o);
107}

◆ setId()

void setId ( const MarketObject  o,
const string &  id 
)

Definition at line 109 of file todaysmarketparameters.cpp.

109 {
110 if (id != "")
111 marketObjectIds_[o] = id;
112}
+ Here is the caller graph for this function:

◆ add()

void add ( const MarketConfiguration o)

Definition at line 114 of file todaysmarketparameters.cpp.

114 {
115 // overwrite if already existent
116 for (auto const& x : o.marketObjectIds_)
117 marketObjectIds_[x.first] = x.second;
118}

Member Data Documentation

◆ marketObjectIds_

map<MarketObject, string> marketObjectIds_
private

Definition at line 65 of file todaysmarketparameters.hpp.