28#include <ql/errors.hpp>
29#include <ql/tuple.hpp>
59 const vector<ReportType>& data(Size i)
const;
60 void toFile(
const string& filename,
const char sep =
',',
const bool commentCharacter =
true,
char quoteChar =
'\0',
61 const string& nullString =
"#N/A",
bool lowerHeader =
false);
69 vector<vector<ReportType>>
data_;
83 vector<Real>
dataAsReal(Size i)
const {
return data_T<Real>(i, 1); }
84 vector<string>
dataAsString(Size i)
const {
return data_T<string>(i, 2); }
85 vector<Date>
dataAsDate(Size i)
const {
return data_T<Date>(i, 3); }
86 vector<Period>
dataAsPeriod(Size i)
const {
return data_T<Period>(i, 4); }
96 template <
typename T> vector<T>
data_T(Size i, Size w)
const {
98 "PlainTypeInMemoryReport::data_T(column=" << i <<
",expectedType=" << w
99 <<
"): Type mismatch, have " <<
columnType(i));
102 tmp.push_back(boost::get<T>(d));
108 vi.push_back(
int(s));
vector< Size > columnPrecision_
Report & add(const ReportType &rt) override
void jumpToColumn(Size i)
vector< ReportType > columnTypes_
const string & header(Size i) const
vector< string > headers_
vector< vector< ReportType > > data_
ReportType columnType(Size i) const
Size columnPrecision(Size i) const
Report & addColumn(const string &name, const ReportType &rt, Size precision=0) override
void toFile(const string &filename, const char sep=',', const bool commentCharacter=true, char quoteChar='\0', const string &nullString="#N/A", bool lowerHeader=false)
bool hasHeader(string h) const
InMemoryReport with access to plain types instead of boost::variant<>, to facilitate language binding...
string dataAsString(Size j, Size i) const
vector< T > data_T(Size i, Size w) const
Period dataAsPeriod(Size j, Size i) const
vector< Real > dataAsReal(Size i) const
vector< Date > dataAsDate(Size i) const
vector< int > sizeToInt(const vector< Size > &v) const
vector< int > dataAsSize(Size i) const
Size columnType(Size i) const
vector< string > dataAsString(Size i) const
PlainInMemoryReport(const QuantLib::ext::shared_ptr< InMemoryReport > &imReport)
int dataAsSize(Size j, Size i) const
std::string header(Size i) const
Date dataAsDate(Size j, Size i) const
vector< Period > dataAsPeriod(Size i) const
QuantLib::ext::shared_ptr< InMemoryReport > imReport_
Real dataAsReal(Size j, Size i) const
boost::variant< Size, Real, string, Date, Period > ReportType
Serializable Credit Default Swap.