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;
28template<
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;
58 DBALLE_TEST_ONLY
void dump(FILE* out)
const override;
Query used to filter DB-All.e data.
Definition: query.h:15
JSON serializer.
Definition: json.h:30
High level objects for working with DB-All.e DB summaries.
Definition: summary_xapian.h:30
void commit() override
Write changes to disk.
void add(const Station &station, const summary::VarDesc &vd, const dballe::DatetimeRange &dtrange, size_t count) override
Add an entry to the summary.
void to_json(core::JSONWriter &writer) const override
Serialize to JSON.
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.
void clear() override
Completely empty the summary.
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.
Datetime datetime_min() const override
Recompute reports, levels, tranges, and varcodes.
High level objects for working with DB-All.e DB summaries.
Definition: summary.h:45
Range of datetimes.
Definition: types.h:295
Date and time.
Definition: types.h:165
Vertical level or layer.
Definition: types.h:625
Station information.
Definition: types.h:794
Information on how a value has been sampled or computed with regards to time.
Definition: types.h:687
Abstract interface for accessing Xapian databases, with read locking only when needed.
Definition: summary_xapian.h:16
Description of a variable, independent of where and when it was measured.
Definition: summary.h:18