File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
126154std::vector<std::string> OREApp::getErrors () {
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments