22 #ifndef DBA_MEMDB_STATION_H
23 #define DBA_MEMDB_STATION_H
25 #include <dballe/memdb/valuestorage.h>
26 #include <dballe/memdb/index.h>
40 template<
typename T>
struct Results;
52 Station(
size_t id,
const Coord& coords,
const std::string& report)
53 : id(
id), coords(coords), mobile(
false), report(report) {}
54 Station(
size_t id,
double lat,
double lon,
const std::string& report)
55 : id(
id), coords(lat, lon), mobile(
false), report(report) {}
58 Station(
size_t id,
const Coord& coords,
const std::string& ident,
const std::string& report)
59 : id(
id), coords(coords), mobile(
true), ident(ident), report(report) {}
60 Station(
size_t id,
double lat,
double lon,
const std::string& ident,
const std::string& report)
61 : id(
id), coords(lat, lon), mobile(
true), ident(ident), report(report) {}
71 bool operator<(
const Station& o)
const {
return id < o.id; }
72 bool operator>(
const Station& o)
const {
return id > o.id; }
73 bool operator==(
const Station& o)
const {
return id == o.id; }
74 bool operator!=(
const Station& o)
const {
return id != o.id; }
90 size_t obtain_fixed(
const Coord& coords,
const std::string& report,
bool create=
true);
93 size_t obtain_mobile(
const Coord& coords,
const std::string& ident,
const std::string& report,
bool create=
true);
101 void dump(FILE* out)
const;
Store an array of physical data all on the same level.
Definition: msg/context.h:44
size_t obtain_fixed(const Coord &coords, const std::string &report, bool create=true)
Get a fixed Station record.
size_t obtain_mobile(const Coord &coords, const std::string &ident, const std::string &report, bool create=true)
Get a mobile Station record.
Storage for related physical data.
Definition: msg.h:119
msg::Context & fill_msg(Msg &msg) const
Fill lat, lon, report information, message type (from report) and identifier in msg.
void query(const Record &rec, Results< Station > &res) const
Query stations returning the IDs.
DB-All.E record.
Definition: record.h:102
size_t obtain(const Record &rec, bool create=true)
Get a fixed or mobile Station record depending on the data in rec.
Station information.
Definition: memdb/station.h:43
Storage and index for station information.
Definition: memdb/station.h:78
Coordinates.
Definition: defs.h:167
Definition: mem/cursor.h:35