/usr/include/dballe/query.h is in libdballe-dev 7.21-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | #ifndef DBALLE_QUERY_H
#define DBALLE_QUERY_H
#include <wreport/var.h>
#include <dballe/types.h>
#include <string>
#include <functional>
#include <memory>
namespace dballe {
struct Record;
/// Query used to filter DB-All.e data
struct Query
{
virtual ~Query() {}
/// Set the query values from the contents of a Record
virtual void set_from_record(const dballe::Record& rec) = 0;
/// Get the Datetime bounds set in this query
virtual DatetimeRange get_datetimerange() const = 0;
/// Set the Datetime range for this query
virtual void set_datetimerange(const DatetimeRange& dt) = 0;
/// Get the range of latitudes to be matched
virtual LatRange get_latrange() const = 0;
/// Set the range of latitudes to be matched
virtual void set_latrange(const LatRange& latrange) = 0;
/// Get the range of longitudes to be matched
virtual LonRange get_lonrange() const = 0;
/// Set the range of longitudes to be matched
virtual void set_lonrange(const LonRange& lonrange) = 0;
/// Get the level to be matched
virtual Level get_level() const = 0;
/// Set the level to be matched
virtual void set_level(const Level& level) = 0;
/// Get the time range to be matched
virtual Trange get_trange() const = 0;
/// Set the level to be matched
virtual void set_trange(const Trange& trange) = 0;
/// Clear the contents of the query, making it match all data
virtual void clear() = 0;
/**
* Return true if this query matches a subset of the given query.
*
* In other words, it returns true if this query is the same as \a other,
* plus zero or more extra fields set, or zero or more ranges narrowed.
*/
virtual bool is_subquery(const Query& other) const = 0;
/**
* Generate a sequence of key names and unique_ptr<Var> for all the
* contents of the query
*/
virtual void foreach_key(std::function<void(const char*, wreport::Var&&)> dest) const = 0;
/// Print the query contents to stderr
virtual void print(FILE* out) const = 0;
/// Return a copy of this query
virtual std::unique_ptr<Query> clone() const = 0;
/// Create a new Query
static std::unique_ptr<Query> create();
/// Create a new Query
static std::unique_ptr<Query> from_record(const Record& rec);
};
}
#endif
|