1 #ifndef DBALLE_DB_V6_MYSQL_STATION_H
2 #define DBALLE_DB_V6_MYSQL_STATION_H
4 #include <dballe/db/v6/station.h>
30 bool maybe_get_id(
int lat,
int lon,
const char* ident,
int*
id);
33 void read_station_vars(
const std::string& query, std::function<
void(std::unique_ptr<wreport::Var>)> dest);
50 int get_id(
int lat,
int lon,
const char* ident=
nullptr)
override;
60 int obtain_id(
int lat,
int lon,
const char* ident=
nullptr,
bool* inserted=NULL)
override;
62 void get_station_vars(
int id_station,
int id_report, std::function<
void(std::unique_ptr<wreport::Var>)> dest)
override;
68 void dump(FILE* out)
override;
void dump(FILE *out) override
Dump the entire contents of the table to an output stream.
int obtain_id(int lat, int lon, const char *ident=nullptr, bool *inserted=NULL) override
Get the station ID given latitude, longitude and mobile identifier.
Key/value store where keys are strings and values are wreport variables.
Definition: record.h:17
Forward declarations for public dballe/sql names.
int get_id(int lat, int lon, const char *ident=nullptr) override
Get the station ID given latitude, longitude and mobile identifier.
void add_station_vars(int id_station, Record &rec) override
Add all station variables (without attributes) to rec.
Precompiled queries to manipulate the station table.
Definition: v6/mysql/station.h:21
void read_station_vars(const std::string &query, std::function< void(std::unique_ptr< wreport::Var >)> dest)
Run stm, read its output and generate variables to send to dest.
bool maybe_get_id(int lat, int lon, const char *ident, int *id)
Lookup the ID of a station, returning true if it was found, false if not.
Definition: v6/station.h:19
Definition: v6/mysql/station.h:71
Database connection.
Definition: mysql.h:126
sql::MySQLConnection & conn
DB connection.
Definition: v6/mysql/station.h:27
void get_station_vars(int id_station, int id_report, std::function< void(std::unique_ptr< wreport::Var >)> dest) override
Export station variables.