Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Manage a table with data records, stored persistently as CSV.
In the context of observations, configuration, calibration and QA, a series of measurement data taken over time is often evaluated statistically, to distill typical averages, variances and trends. Short of using a database, a modest amount of numeric data can be maintained in CSV files, which also allows for further manual evaluation within a spreadsheet or statistics application. The CSV format as such can be quite elaborate, yet for the purpose of saving and later reading back some values generated by the application itself, supporting a limited format flavour is sufficient:
As a fundamental building block, this header provides a data table template with flexible column configuration to hold arbitrary, explicitly typed values. This solution is statically typed and does not carry any runtime type information; the actual data table object is then defined and accessed by means of accessor components for each column of data. A tuple of current values corresponding to the most recent row of data can be accessed directly through these sub-components.
Create an actual instantiation of the DataTable template, passing a structure with util::Column descriptors. You may then directly access the values of the actual column or save/load from a persistent CSV file.
allColumns()
std::vector
of CSV-stringsDefinition in file data.hpp.
#include "lib/error.hpp"
#include "lib/nocopy.hpp"
#include "lib/stat/csv.hpp"
#include "lib/stat/file.hpp"
#include "lib/format-string.hpp"
#include "lib/util.hpp"
#include <type_traits>
#include <utility>
#include <fstream>
#include <vector>
#include <string>
#include <limits>
#include <deque>
Classes | |
struct | Column< VAL > |
Descriptor and Accessor for a data column within a DataTable table. More... | |
class | DataTable< TAB > |
Table with data values, stored persistently as CSV file. More... | |
Namespaces | |
lib | |
Implementation namespace for support and library code. | |