#include <ored/report/report.hpp>
Public Types | |
typedef boost::variant< Size, Real, string, Date, Period > | ReportType |
Public Member Functions | |
virtual | ~Report () |
virtual Report & | addColumn (const string &name, const ReportType &, Size precision=0)=0 |
virtual Report & | next ()=0 |
virtual Report & | add (const ReportType &rt)=0 |
virtual void | end ()=0 |
virtual void | flush () |
Abstract Report interface class
A Report can be thought of as a CSV file or SQL table, it has columns (each with a name and type) which are set before we add any data, then each row of data is added with calls to add().
ReportType is a boost::variant which covers all the allowable types for a report.
Usage of the report API is as follows
Report npv_report = makeReport(); // create headers npv_report.addColumn("Id", string()) .addColumn("NPV", double(), 2) .addColumn("CP", string()); // add rows npv_report.next().add("t1").add(123.45).add("cp"); npv_report.next().add("t2").add(3.14).add("cp"); npv_report.next().add("t3").add(100.0).add("cp2"); npv_report.end();
Definition at line 64 of file report.hpp.
typedef boost::variant<Size, Real, string, Date, Period> ReportType |
Definition at line 66 of file report.hpp.
|
virtual |
Definition at line 68 of file report.hpp.
|
pure virtual |
Implemented in CSVFileReport, and InMemoryReport.
|
pure virtual |
Implemented in CSVFileReport, and InMemoryReport.
|
pure virtual |
Implemented in CSVFileReport, and InMemoryReport.
|
pure virtual |
Implemented in CSVFileReport, and InMemoryReport.
|
virtual |