22 #ifndef DBALLE_DB_MYSQL_STATION_H
23 #define DBALLE_DB_MYSQL_STATION_H
41 struct MySQLConnection;
57 bool maybe_get_id(
int lat,
int lon,
const char* ident,
int*
id);
60 void read_station_vars(
const std::string& query, std::function<
void(std::unique_ptr<wreport::Var>)> dest);
77 int get_id(
int lat,
int lon,
const char* ident=
nullptr)
override;
87 int obtain_id(
int lat,
int lon,
const char* ident=
nullptr,
bool* inserted=NULL)
override;
89 void get_station_vars(
int id_station,
int id_report, std::function<
void(std::unique_ptr<wreport::Var>)> dest)
override;
95 void dump(FILE* out)
override;
Database connection.
Definition: mysql/internals.h:145
void dump(FILE *out) override
Dump the entire contents of the table to an output stream.
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.
int get_id(int lat, int lon, const char *ident=nullptr) 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:16
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.
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition: cmdline.h:17
Definition: db/mysql/station.h:98
void get_station_vars(int id_station, int id_report, std::function< void(std::unique_ptr< wreport::Var >)> dest) override
Export station variables.
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.
Station table management used by the db module.
MySQLConnection & conn
DB connection.
Definition: db/mysql/station.h:54
Definition: db/sql/station.h:46
Definition: conversion.h:6
Precompiled queries to manipulate the station table.
Definition: db/mysql/station.h:48
void add_station_vars(int id_station, Record &rec) override
Add all station variables (without attributes) to rec.