template<class TAB>
class lib::stat::DataTable< TAB >
Table with data values, stored persistently as CSV file.
Each row within the table represents a data record, holding a sequence of values. Values are statically typed per column, i.e. one column may hold strings, while the next column holds doubles. For actual usage it is thus necessary to define the column layout, through a sequence of column Descriptors.
Usage
Actually those Column objects serve as descriptors, but also as accessors — and they hold the actual data storage for each column, which is a std::vector<VAL>
of value type VAL
. There is always a current record — corresponding to the actual data value and the newest data row. For persistent storage, the sequence of rows is reversed, so the newest data appears at the top of the CSV file.
- Template Parameters
-
TAB | a struct comprised of several Column objects, which hold the data and provide access to values of this specific column. Moreover, this type must define a function allColumns() to return a tuple with references to these column fields; the order of fields within this tuple also defines the order of columns within the table and persistent CSV storage. |
Definition at line 194 of file data.hpp.
|
void | appendRowFromCSV (string line) |
|
template<class OP > |
void | forAllColumns (OP &&doIt) const |
| apply a generic Lambda to all columns
|
|
CSVLine | formatCSVRow (size_t rownum) const |
|
CSVLine | generateHeaderSpec () const |
|
void | loadData () |
|
void | saveData (std::ofstream &csvFile, size_t lineLimit) |
|
void | verifyHeaderSpec (string headerLine) |
|
| MoveOnly (MoveOnly &&)=default |
|
| MoveOnly (MoveOnly const &)=delete |
|
MoveOnly & | operator= (MoveOnly &&)=delete |
|
MoveOnly & | operator= (MoveOnly const &)=delete |
|