22 #ifndef DBA_MEMDB_SERIALIZER_H
23 #define DBA_MEMDB_SERIALIZER_H
25 #include <dballe/memdb/station.h>
26 #include <dballe/memdb/stationvalue.h>
27 #include <dballe/memdb/levtr.h>
28 #include <dballe/memdb/value.h>
45 std::string pathname_tmp;
52 void open(
const std::string& pathname);
86 void write(
const Memdb& memdb);
105 void open(
const std::string& pathname);
107 template<
typename INFILE>
108 void read_attrs(
const INFILE& values);
120 template<
typename VALUES>
123 typedef typename VALUES::value_type value_type;
127 std::map<size_t, size_t> id_map;
130 const typename VALUES::value_type& by_lineno(
size_t lineno)
const;
void rollback()
Roll back the write, deleting the output temporary file and leaving the original untouched.
In-memory database backend.
Definition: memdb.h:78
Definition: serializer.h:140
void commit()
Commit the write, closing the output temporary file and renaming it to its final name.
Storage and index for station information.
Definition: stationvalue.h:58
Definition: serializer.h:147
Definition: serializer.h:133
Deserializer for Memdb.
Definition: serializer.h:158
Storage and index for station information.
Definition: memdb/station.h:78
Routines to parse data in CSV format.
void open(const std::string &pathname)
Same as CSVReader::open, but it considers missing files as empty files.
virtual void flush_row()
Write the current line to the output file, and start a new one.
CSVReader implementation that reads using stdio and has helper functions to deserialize Memdb...
Definition: serializer.h:95
CSVWriter implementation that writes its output file atomically.
Definition: serializer.h:42
Serializer for Memdb contents.
Definition: serializer.h:76
Common implementation bits of ValueStorage deserializers.
Definition: serializer.h:121