1 #ifndef DBALLE_DB_V7_STATE_H 2 #define DBALLE_DB_V7_STATE_H 4 #include <wreport/var.h> 7 #include <unordered_set> 24 ItemState(
int id,
bool is_new) : id(
id), is_new(is_new) {}
39 bool operator<(
const StationDesc& o)
const {
return compare(o) < 0; }
47 void to_record(
Record& rec)
const;
52 using ItemState::ItemState;
55 typedef std::map<StationDesc, StationState> stations_t;
74 bool operator<(
const LevTrDesc& o)
const {
return compare(o) < 0; }
79 using ItemState::ItemState;
82 typedef std::map<LevTrDesc, LevTrState> levtrs_t;
83 typedef std::map<int, levtrs_t::iterator> levtr_id_t;
88 stations_t::iterator station;
94 : station(station), varcode(varcode) {}
103 using ItemState::ItemState;
106 typedef std::map<StationValueDesc, StationValueState> stationvalues_t;
111 stations_t::iterator station;
120 : station(station), levtr(levtr), datetime(datetime), varcode(varcode) {}
124 bool operator<(
const ValueDesc& o)
const {
return compare(o) < 0; }
129 using ItemState::ItemState;
132 typedef std::map<ValueDesc, ValueState> values_t;
144 levtr_id_t levtr_ids;
145 stationvalues_t stationvalues;
147 std::unordered_set<int> stationvalues_new;
148 std::unordered_set<int> values_new;
Cache intermediate results during a database transaction, to avoid hitting the database multiple time...
Definition: state.h:140
Coordinates.
Definition: types.h:337
Information on how a value has been sampled or computed with regards to time.
Definition: types.h:587
Key/value store where keys are strings and values are wreport variables.
Definition: record.h:16
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition: cmdline.h:17
Vertical level or layer.
Definition: types.h:532
A station identifier, that can be any string (including the empty string) or a missing value...
Definition: core/defs.h:19
Trange trange
Time range.
Definition: state.h:64
Date and time.
Definition: types.h:158
Level level
Vertical level or layer.
Definition: state.h:61
Datetime datetime
Date and time at which the value was measured or forecast.
Definition: state.h:114