1 #ifndef DBALLE_CORE_QUERY_H 2 #define DBALLE_CORE_QUERY_H 4 #include <dballe/query.h> 6 #include <dballe/record.h> 15 #define DBA_DB_MODIFIER_BEST (1 << 0) 17 #define DBA_DB_MODIFIER_UNSORTED (1 << 5) 19 #define DBA_DB_MODIFIER_SORT_FOR_EXPORT (1 << 7) 20 #define DBA_DB_MODIFIER_SUMMARY_DETAILS (1 << 8) 31 static const uint32_t WANT_MISSING_IDENT = (1 << 0);
32 static const uint32_t WANT_MISSING_LTYPE1 = (1 << 1);
33 static const uint32_t WANT_MISSING_L1 = (1 << 2);
34 static const uint32_t WANT_MISSING_LTYPE2 = (1 << 3);
35 static const uint32_t WANT_MISSING_L2 = (1 << 4);
36 static const uint32_t WANT_MISSING_PIND = (1 << 5);
37 static const uint32_t WANT_MISSING_P1 = (1 << 6);
38 static const uint32_t WANT_MISSING_P2 = (1 << 7);
46 int ana_id = MISSING_INT;
47 int prio_min = MISSING_INT;
48 int prio_max = MISSING_INT;
50 int mobile = MISSING_INT;
57 std::set<wreport::Varcode> varcodes;
59 std::string ana_filter;
60 std::string data_filter;
61 std::string attr_filter;
62 int limit = MISSING_INT;
63 int block = MISSING_INT;
64 int station = MISSING_INT;
66 std::unique_ptr<dballe::Query>
clone()
const override;
68 unsigned get_modifiers()
const;
81 void clear()
override;
109 void print(FILE* out)
const override;
void set_level(const Level &level) override
Set the level to be matched.
Definition: core/query.h:77
void foreach_key(std::function< void(const char *, wreport::Var &&)> dest) const override
Generate a sequence of dba_keyword and Var for all contents of the query that can be represented in a...
LatRange get_latrange() const override
Get the range of latitudes to be matched.
Definition: core/query.h:72
DatetimeRange get_datetimerange() const override
Get the Datetime bounds set in this query.
Definition: core/query.h:70
uint32_t want_missing
Set a bit a 1 with WANT_MISSING_* constants to specify that the query wants results in which the corr...
Definition: core/query.h:45
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
Standard dballe::Query implementation.
Definition: core/query.h:29
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition: cmdline.h:17
static const Query & downcast(const dballe::Query &query)
Return a reference to query downcasted as core::Query.
Vertical level or layer.
Definition: types.h:532
void clear() override
Clear the contents of the query, making it match all data.
A station identifier, that can be any string (including the empty string) or a missing value...
Definition: core/defs.h:19
Range of datetimes.
Definition: types.h:272
Range of latitudes.
Definition: types.h:407
Trange get_trange() const override
Get the time range to be matched.
Definition: core/query.h:78
void print(FILE *out) const override
Print the query contents to stderr.
void set_datetimerange(const DatetimeRange &dt) override
Set the Datetime range for this query.
Definition: core/query.h:71
void set_latrange(const LatRange &lr) override
Set the range of latitudes to be matched.
Definition: core/query.h:73
Query used to filter DB-All.e data.
Definition: query.h:14
Level get_level() const override
Get the level to be matched.
Definition: core/query.h:76
JSON serializer.
Definition: json.h:23
std::unique_ptr< dballe::Query > clone() const override
Return a copy of this query.
Range of longitudes.
Definition: types.h:481
void set_trange(const Trange &trange) override
Set the level to be matched.
Definition: core/query.h:79
void set_from_test_string(const std::string &s)
Set a record from a ", "-separated string of assignments.
void set_from_record(const dballe::Record &rec) override
Set the query values from the contents of a Record.
bool is_subquery(const dballe::Query &other) const override
Return true if this query matches a subset of the given query.
LonRange get_lonrange() const override
Get the range of longitudes to be matched.
Definition: core/query.h:74
void serialize(JSONWriter &out) const
Send the contents to a JSONWriter.
static unsigned parse_modifiers(const dballe::Record &rec)
Parse the query=* modifiers specification inside the record, returning the ORed flags.
void set_lonrange(const LonRange &lr) override
Set the range of longitudes to be matched.
Definition: core/query.h:75