Skip to content

Commit 11151e6

Browse files
rolandlichtersjenkins
authored andcommitted
Merge remote-tracking branch 'origin/master' into roland_interface
1 parent b083243 commit 11151e6

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

OREAnalytics/orea/app/oreapp.cpp

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,35 @@ boost::shared_ptr<NPVCube> OREApp::getCube(std::string cubeName) {
120120
return b.second;
121121
}
122122
}
123-
QL_FAIL("report " << cubeName << " not found in results");
123+
QL_FAIL("npv cube " << cubeName << " not found in results");
124+
}
125+
126+
std::set<std::string> OREApp::getMarketCubeNames() {
127+
QL_REQUIRE(analyticsManager_, "analyticsManager_ not set yet, call analytics first");
128+
std::set<std::string> names;
129+
for (const auto& c : analyticsManager_->mktCubes()) {
130+
for (auto b : c.second) {
131+
string cubeName = b.first;
132+
if (names.find(cubeName) == names.end())
133+
names.insert(cubeName);
134+
else {
135+
ALOG("market cube name " << cubeName
136+
<< " occurs more than once, will retrieve the first cube with that name only");
137+
}
138+
}
139+
}
140+
return names;
141+
}
142+
143+
boost::shared_ptr<AggregationScenarioData> OREApp::getMarketCube(std::string cubeName) {
144+
QL_REQUIRE(analyticsManager_, "analyticsManager_ not set yet, call analytics first");
145+
for (const auto& c : analyticsManager_->mktCubes()) {
146+
for (auto b : c.second) {
147+
if (cubeName == b.first)
148+
return b.second;
149+
}
150+
}
151+
QL_FAIL("market cube " << cubeName << " not found in results");
124152
}
125153

126154
std::vector<std::string> OREApp::getErrors() {

OREAnalytics/orea/app/oreapp.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ class OREApp {
6868
std::set<std::string> getCubeNames();
6969
boost::shared_ptr<NPVCube> getCube(std::string cubeName);
7070

71+
std::set<std::string> getMarketCubeNames();
72+
boost::shared_ptr<AggregationScenarioData> getMarketCube(std::string cubeName);
73+
7174
std::vector<std::string> getErrors();
7275

7376
//! time for executing run(...) in seconds

0 commit comments

Comments
 (0)