1 #ifndef DBALLE_DB_V7_BATCH_H 2 #define DBALLE_DB_V7_BATCH_H 4 #include <wreport/var.h> 6 #include <dballe/core/smallset.h> 7 #include <dballe/db/v7/fwd.h> 8 #include <dballe/db/v7/utils.h> 21 bool write_attrs =
true;
24 bool have_station(
const std::string& report,
const Coords& coords,
const Ident& ident);
25 void new_station(
Tracer<>& trc,
const std::string& report,
const Coords& coords,
const Ident& ident);
29 unsigned count_select_stations = 0;
30 unsigned count_select_station_data = 0;
31 unsigned count_select_data = 0;
36 void set_write_attrs(
bool write_attrs);
43 void dump(FILE* out)
const;
65 void dump(FILE* out)
const;
79 std::vector<StationDatum> to_insert;
80 std::vector<StationDatum> to_update;
83 void add(
const wreport::Var* var, UpdateMode on_conflict);
94 : id_levtr(id_levtr), var(var) {}
96 : id(
id), id_levtr(id_levtr), var(var) {}
98 void dump(FILE* out)
const;
99 bool operator<(
const MeasuredDatum& o)
const {
return id_levtr < o.id_levtr || (id_levtr == o.id_levtr && var->
code() < o.var->
code()); }
100 bool operator==(
const MeasuredDatum& o)
const {
return id_levtr == o.id_levtr && var->
code() == o.var->
code(); }
109 : id_varcode(id_varcode), id(
id)
124 std::vector<MeasuredDatum> to_insert;
125 std::vector<MeasuredDatum> to_update;
132 void add(
int id_levtr,
const wreport::Var* var, UpdateMode on_conflict);
136 inline const Datetime& measured_data_vector_get_value(
MeasuredData*
const& item) {
return item->datetime; }
161 void write_pending(
Tracer<>& trc,
bool with_attrs);
162 void dump(FILE* out)
const;
Common base types used by most of DB-All.e code.
Coordinates.
Definition: types.h:368
A station identifier, that can be any string (including the empty string) or a missing value...
Definition: types.h:747
Set structure optimized for a small number of items.
Definition: smallset.h:16
Definition: transaction.h:15
Smart pointer for trace::Step objects, which calls done() when going out of scope.
Definition: db/v7/fwd.h:45
Date and time.
Definition: types.h:164