23#include <ql/errors.hpp>
25#include <boost/algorithm/string.hpp>
39 if (row_ <= report_->rows()) {
40 vector<Report::ReportType> entries;
41 for (Size i = 0; i <
report_->columns(); i++) {
57 QL_REQUIRE(entries.size() == 10,
"On row number " <<
row_ <<
": A sensitivity record needs 10 entries");
60 sr.
tradeId = QuantLib::ext::get<std::string>(entries[0]);
66 sr.
shift_1 = QuantLib::ext::get<Real>(entries[3]);
71 sr.
shift_2 = QuantLib::ext::get<Real>(entries[5]);
73 sr.
currency = QuantLib::ext::get<std::string>(entries[6]);
74 sr.
baseNpv = QuantLib::ext::get<Real>(entries[7]);
75 sr.
delta = QuantLib::ext::get<Real>(entries[8]);
76 sr.
gamma = QuantLib::ext::get<Real>(entries[9]);
SensitivityRecord processRecord(const std::vector< ore::data::Report::ReportType > &entries) const
Create a record from a collection of strings.
QuantLib::ext::shared_ptr< ore::data::InMemoryReport > report_
void reset() override
Resets the stream so that SensitivityRecord objects can be streamed again.
SensitivityRecord next() override
Returns the next SensitivityRecord in the stream.
bool parseBool(const string &s)
Real parseReal(const string &s)
pair< RiskFactorKey, string > deconstructFactor(const string &factor)
Class for streaming SensitivityRecords from a report.
Shift scenario generation.