22 #ifndef DBALLE_DB_SQLITE_STATION_H
23 #define DBALLE_DB_SQLITE_STATION_H
41 struct SQLiteConnection;
42 struct SQLiteStatement;
65 bool maybe_get_id(
int lat,
int lon,
const char* ident,
int*
id);
85 int get_id(
int lat,
int lon,
const char* ident=
nullptr)
override;
95 int obtain_id(
int lat,
int lon,
const char* ident=
nullptr,
bool* inserted=NULL)
override;
97 void get_station_vars(
int id_station,
int id_report, std::function<
void(std::unique_ptr<wreport::Var>)> dest)
override;
103 void dump(FILE* out)
override;
SQLiteStatement * smstm
Precompiled select mobile station query.
Definition: db/sqlite/station.h:60
void add_station_vars(int id_station, Record &rec) override
Add all station variables (without attributes) to rec.
SQLiteStatement * sfstm
Precompiled select fixed station query.
Definition: db/sqlite/station.h:58
void get_station_vars(int id_station, int id_report, std::function< void(std::unique_ptr< wreport::Var >)> dest) override
Export station variables.
SQLiteStatement * istm
Precompiled insert query.
Definition: db/sqlite/station.h:62
Definition: db/sqlite/station.h:106
SQLite statement.
Definition: sqlite/internals.h:124
Key/value store where keys are strings and values are wreport variables.
Definition: record.h:16
Database connection.
Definition: sqlite/internals.h:56
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition: cmdline.h:17
Precompiled queries to manipulate the station table.
Definition: db/sqlite/station.h:49
Station table management used by the db module.
void dump(FILE *out) override
Dump the entire contents of the table to an output stream.
Definition: db/sql/station.h:46
Definition: conversion.h:6
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.
SQLiteConnection & conn
DB connection.
Definition: db/sqlite/station.h:55
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.
int get_id(int lat, int lon, const char *ident=nullptr) override
Get the station ID given latitude, longitude and mobile identifier.
void read_station_vars(SQLiteStatement &stm, std::function< void(std::unique_ptr< wreport::Var >)> dest)
Run stm, read its output and generate variables to send to dest.