1 #ifndef DBALLE_DB_SUMMARY_XAPIAN_H 2 #define DBALLE_DB_SUMMARY_XAPIAN_H 4 #include <dballe/core/fwd.h> 5 #include <dballe/db/summary.h> 19 virtual Xapian::Database& reader() = 0;
20 virtual Xapian::WritableDatabase& writer() = 0;
21 virtual void commit() = 0;
22 virtual void clear() = 0;
28 template<
typename Station>
31 std::unique_ptr<XapianDB> db;
38 bool stations(std::function<
bool(
const Station&)>)
const override;
39 bool reports(std::function<
bool(
const std::string&)>)
const override;
40 bool levels(std::function<
bool(
const Level&)>)
const override;
41 bool tranges(std::function<
bool(
const Trange&)>)
const override;
45 Datetime datetime_max()
const override;
46 unsigned data_count()
const override;
48 void clear()
override;
58 DBALLE_TEST_ONLY
void dump(FILE* out)
const override;
bool iter(std::function< bool(const Station &, const summary::VarDesc &, const DatetimeRange &, size_t)>) const override
Iterate the contents of this summary. There is no guarantee on sorting order.
Station information.
Definition: types.h:793
void add(const Station &station, const summary::VarDesc &vd, const dballe::DatetimeRange &dtrange, size_t count) override
Add an entry to the summary.
Description of a variable, independent of where and when it was measured.
Definition: summary.h:17
void clear() override
Completely empty the summary.
Information on how a value has been sampled or computed with regards to time.
Definition: types.h:686
Vertical level or layer.
Definition: types.h:624
void to_json(core::JSONWriter &writer) const override
Serialize to JSON.
Abstract interface for accessing Xapian databases, with read locking only when needed.
Definition: summary_xapian.h:15
bool iter_filtered(const dballe::Query &query, std::function< bool(const Station &, const summary::VarDesc &, const DatetimeRange &, size_t)>) const override
Iterate the contents of this summary. There is no guarantee on sorting order.
Range of datetimes.
Definition: types.h:294
High level objects for working with DB-All.e DB summaries.
Definition: summary.h:44
Date and time.
Definition: types.h:164
JSON serializer.
Definition: json.h:29
Datetime datetime_min() const override
Recompute reports, levels, tranges, and varcodes.
void commit() override
Write changes to disk.
Query used to filter DB-All.e data.
Definition: query.h:14
High level objects for working with DB-All.e DB summaries.
Definition: summary_xapian.h:29