22 #ifndef DBALLE_DB_POSTGRESQL_V6_STATION_H
23 #define DBALLE_DB_POSTGRESQL_V6_STATION_H
41 struct PostgreSQLConnection;
42 namespace postgresql {
54 bool maybe_get_id(
int lat,
int lon,
const char* ident,
int*
id);
72 int get_id(
int lat,
int lon,
const char* ident=
nullptr)
override;
82 int obtain_id(
int lat,
int lon,
const char* ident=
nullptr,
bool* inserted=NULL)
override;
84 void get_station_vars(
int id_station,
int id_report, std::function<
void(std::unique_ptr<wreport::Var>)> dest)
override;
91 void dump(FILE* out)
override;
PostgreSQLConnection & conn
DB connection.
Definition: db/postgresql/station.h:51
void get_station_vars(int id_station, int id_report, std::function< void(std::unique_ptr< wreport::Var >)> dest) override
Export station variables.
void add_station_vars(int id_station, Record &rec) override
Add all station variables (without attributes) to rec.
Definition: db/postgresql/station.h:94
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
int get_id(int lat, int lon, const char *ident=nullptr) override
Get the station ID given latitude, longitude and mobile identifier.
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.
Database connection.
Definition: postgresql/internals.h:249
Station table management used by the db module.
Definition: db/sql/station.h:46
Definition: conversion.h:6
Definition: db/postgresql/station.h:45
void dump(FILE *out) override
Dump the entire contents of the table to an output stream.