Skip to content

Commit 8fef25b

Browse files
pcaspersjenkins
authored andcommitted
QPR-11979 add builder label to bond builder results
1 parent a1d1f44 commit 8fef25b

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

OREData/ored/portfolio/bond.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,9 @@ BondBuilder::Result BondFactory::build(const boost::shared_ptr<EngineFactory>& e
333333
boost::shared_lock<boost::shared_mutex> lock(mutex_);
334334
for (auto const& b : builders_) {
335335
if (referenceData->hasData(b.first, securityId)) {
336-
return b.second->build(engineFactory, referenceData, securityId);
336+
auto tmp = b.second->build(engineFactory, referenceData, securityId);
337+
tmp.builderLabel = b.first;
338+
return tmp;
337339
}
338340
}
339341

OREData/ored/portfolio/bond.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,9 @@ class Bond : public Trade {
181181

182182
struct BondBuilder {
183183
struct Result {
184+
std::string builderLabel;
184185
boost::shared_ptr<QuantLib::Bond> bond;
185186
boost::shared_ptr<QuantExt::ModelBuilder> modelBuilder; // might be nullptr
186-
187-
188187
bool isInflationLinked = false;
189188
bool hasCreditRisk = true;
190189
std::string currency;

0 commit comments

Comments
 (0)