1 #ifndef DBALLE_DB_V7_BATCH_H 2 #define DBALLE_DB_V7_BATCH_H 4 #include <dballe/core/smallset.h> 5 #include <dballe/db/v7/fwd.h> 6 #include <dballe/db/v7/utils.h> 11 #include <wreport/var.h> 21 bool write_attrs =
true;
24 bool have_station(
const std::string& report,
const Coords& coords,
26 void new_station(
Tracer<>& trc,
const std::string& report,
31 unsigned count_select_stations = 0;
32 unsigned count_select_station_data = 0;
33 unsigned count_select_data = 0;
38 void set_write_attrs(
bool write_attrs);
41 bool station_can_add);
47 void dump(FILE* out)
const;
66 void dump(FILE* out)
const;
77 inline const wreport::Varcode& station_data_ids_get_value(
const IdVarcode& item)
83 station_data_ids_get_value>
90 std::vector<StationDatum> to_insert;
91 std::vector<StationDatum> to_update;
94 void add(
const wreport::Var* var, UpdateMode on_conflict);
101 int id = MISSING_INT;
106 : id_levtr(id_levtr), var(var)
110 : id(
id), id_levtr(id_levtr), var(var)
114 void dump(FILE* out)
const;
117 return id_levtr < o.id_levtr ||
118 (id_levtr == o.id_levtr && var->
code() < o.var->
code());
122 return id_levtr == o.id_levtr && var->
code() == o.var->
code();
132 : id_varcode(id_varcode), id(
id)
139 return item.id_varcode;
143 measured_data_ids_get_value>
151 std::vector<MeasuredDatum> to_insert;
152 std::vector<MeasuredDatum> to_update;
156 void add(
int id_levtr,
const wreport::Var* var, UpdateMode on_conflict);
163 return item->datetime;
168 measured_data_vector_get_value>
190 void write_pending(
Tracer<>& trc,
bool with_attrs);
191 void dump(FILE* out)
const;
Common base types used by most of DB-All.e code.
Coordinates.
Definition: types.h:371
A station identifier, that can be any string (including the empty string) or a missing value...
Definition: types.h:750
Set structure optimized for a small number of items.
Definition: smallset.h:20
Definition: transaction.h:15
Smart pointer for trace::Step objects, which calls done() when going out of scope.
Definition: db/v7/fwd.h:44
Date and time.
Definition: types.h:163