libdballe  7.21
v7/mysql/station.h
1 #ifndef DBALLE_DB_V7_MYSQL_STATION_H
2 #define DBALLE_DB_V7_MYSQL_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 mysql {
16 
20 class MySQLStation : public v7::Station
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:
35  ~MySQLStation();
36  MySQLStation(const MySQLStation&) = delete;
37  MySQLStation(const MySQLStation&&) = delete;
38  MySQLStation& operator=(const MySQLStation&) = 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
Definition: state.h:32
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
dballe::sql::MySQLConnection & conn
DB connection.
Definition: v7/mysql/station.h:26
Precompiled queries to manipulate the station table.
Definition: v7/mysql/station.h:20
Database connection.
Definition: mysql.h:125