libdballe  7.21
v6/postgresql/station.h
1 #ifndef DBALLE_DB_V6_POSTGRESQL_V6_STATION_H
2 #define DBALLE_DB_V6_POSTGRESQL_V6_STATION_H
3 
4 #include <dballe/db/v6/station.h>
5 #include <dballe/sql/fwd.h>
6 #include <functional>
7 #include <memory>
8 
9 namespace wreport {
10 struct Var;
11 }
12 
13 namespace dballe {
14 namespace db {
15 namespace v6 {
16 namespace postgresql {
17 
18 class StationBase : public v6::Station
19 {
20 protected:
25 
27  bool maybe_get_id(int lat, int lon, const char* ident, int* id);
28 
29  StationBase(const StationBase&) = delete;
30  StationBase(const StationBase&&) = delete;
31  StationBase& operator=(const StationBase&) = delete;
32 
33 public:
35  ~StationBase();
36 
45  int get_id(int lat, int lon, const char* ident=nullptr) override;
46 
55  int obtain_id(int lat, int lon, const char* ident=nullptr, bool* inserted=NULL) override;
56 
57  void get_station_vars(int id_station, int id_report, std::function<void(std::unique_ptr<wreport::Var>)> dest) override;
58 
59  void add_station_vars(int id_station, Record& rec) override;
60 
64  void dump(FILE* out) override;
65 };
66 
68 {
69 public:
72 };
73 
74 }
75 }
76 }
77 }
78 #endif
Database connection.
Definition: postgresql.h:239
dballe::sql::PostgreSQLConnection & conn
DB connection.
Definition: v6/postgresql/station.h:24
Key/value store where keys are strings and values are wreport variables.
Definition: record.h:16
Forward declarations for public dballe/sql names.
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition: cmdline.h:17
Definition: v6/postgresql/station.h:18
Definition: v6/postgresql/station.h:67
Definition: v6/station.h:18