1 #ifndef DBA_MEMDB_STATIONVALUE_H
2 #define DBA_MEMDB_STATIONVALUE_H
4 #include <dballe/memdb/valuestorage.h>
5 #include <dballe/memdb/index.h>
6 #include <dballe/memdb/valuebase.h>
7 #include <wreport/var.h>
22 template<
typename T>
struct Results;
32 :
ValueBase(std::move(var)), station(station) {}
49 bool has_variables_for(
const Station& station)
const
51 return by_station.find(&station) != by_station.end();
57 size_t insert(
const Station& station, std::unique_ptr<wreport::Var> var,
bool replace=
true);
60 size_t insert(
const Station& station,
const wreport::Var& var,
bool replace=
true);
67 bool remove(
const Station& station, wreport::Varcode code);
70 void erase(
size_t idx);
81 void dump(FILE* out)
const;
Store an array of physical data all on the same level.
Definition: context.h:44
Station information.
Definition: valuebase.h:36
Definition: mem/cursor.h:14
void fill_msg(const Station &station, msg::Context &ctx) const
Fill a message context with all the variables for this station.
void fill_record(const Station &station, Record &rec) const
Fill a record with all the variables for this station.
Storage and index for station values.
Definition: stationvalue.h:41
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
Station information.
Definition: memdb/station.h:27
size_t insert(const Station &station, std::unique_ptr< wreport::Var > var, bool replace=true)
Insert a new value, or replace an existing one for the same station.
Value describing one property of a station.
Definition: stationvalue.h:27
Index element positions based by one value.
Definition: index.h:41
void erase(size_t idx)
Removes a value, by index.
Definition: memdb/levtr.h:16
void query(const core::Query &q, Results< Station > &stations, Results< StationValue > &res) const
Query values for the given stations.