libdballe  7.21
v7/postgresql/station.h
1 #ifndef DBALLE_DB_V7_POSTGRESQL_STATION_H
2 #define DBALLE_DB_V7_POSTGRESQL_STATION_H
3 
4 #include <dballe/db/v7/station.h>
5 #include <functional>
6 #include <memory>
7 
8 namespace wreport {
9 struct Var;
10 }
11 
12 namespace dballe {
13 namespace db {
14 namespace v7 {
15 namespace postgresql {
16 
21 {
22 protected:
27 
29  bool maybe_get_id(const StationDesc& st, int* id) override;
30 
31  void _dump(std::function<void(int, int, const Coords& coords, const char* ident)> out) override;
32 
33 public:
36  PostgreSQLStation(const PostgreSQLStation&) = delete;
37  PostgreSQLStation(const PostgreSQLStation&&) = delete;
38  PostgreSQLStation& operator=(const PostgreSQLStation&) = delete;
39 
40  stations_t::iterator lookup_id(State& st, int id) override;
41  stations_t::iterator obtain_id(State& st, const StationDesc& desc) override;
42 
43  void get_station_vars(int id_station, std::function<void(std::unique_ptr<wreport::Var>)> dest) override;
44  void add_station_vars(int id_station, Record& rec) override;
45 };
46 
47 }
48 }
49 }
50 }
51 #endif
Database connection.
Definition: postgresql.h:239
dballe::sql::PostgreSQLConnection & conn
DB connection.
Definition: v7/postgresql/station.h:26
Definition: state.h:32
Precompiled queries to manipulate the station table.
Definition: v7/postgresql/station.h:20
Cache intermediate results during a database transaction, to avoid hitting the database multiple time...
Definition: state.h:140
Coordinates.
Definition: types.h:337
Key/value store where keys are strings and values are wreport variables.
Definition: record.h:16
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition: cmdline.h:17
Definition: v7/station.h:19