libdballe
8.3
dballe
db
v7
postgresql
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
20
class
PostgreSQLStation
:
public
v7::Station
21
{
22
protected
:
26
dballe::sql::PostgreSQLConnection
&
conn
;
27
28
void
_dump(std::function<
void
(
int
,
int
,
const
Coords
& coords,
const
char
* ident)> out)
override
;
29
30
public
:
31
PostgreSQLStation
(
v7::Transaction
& tr,
dballe::sql::PostgreSQLConnection
& conn);
32
~
PostgreSQLStation
();
33
PostgreSQLStation
(
const
PostgreSQLStation
&) =
delete
;
34
PostgreSQLStation
(
const
PostgreSQLStation
&&) =
delete
;
35
PostgreSQLStation
& operator=(
const
PostgreSQLStation
&) =
delete
;
36
37
DBStation
lookup(
Tracer<>
& trc,
int
id_station)
override
;
38
int
maybe_get_id(
Tracer<>
& trc,
const
dballe::DBStation
& st)
override
;
39
int
insert_new(
Tracer<>
& trc,
const
dballe::DBStation
& desc)
override
;
40
void
get_station_vars(
Tracer<>
& trc,
int
id_station, std::function<
void
(std::unique_ptr<wreport::Var>)> dest)
override
;
41
void
add_station_vars(
Tracer<>
& trc,
int
id_station,
DBValues
& values)
override
;
42
void
run_station_query(
Tracer<>
& trc,
const
v7::StationQueryBuilder
& qb, std::function<
void
(
const
dballe::DBStation
&)>)
override
;
43
};
44
45
}
46
}
47
}
48
}
49
#endif
dballe::db::v7::StationQueryBuilder
Definition:
qbuilder.h:81
dballe::sql::PostgreSQLConnection
Database connection.
Definition:
postgresql.h:241
dballe::db::v7::postgresql::PostgreSQLStation::conn
dballe::sql::PostgreSQLConnection & conn
DB connection.
Definition:
postgresql/station.h:26
dballe::db::v7::postgresql::PostgreSQLStation
Precompiled queries to manipulate the station table.
Definition:
postgresql/station.h:20
dballe::Coords
Coordinates.
Definition:
types.h:365
dballe
Definition:
cmdline.h:18
dballe::db::v7::Station
Definition:
station.h:24
dballe::DBValues
Collection of DBValue objects, indexed by wreport::Varcode.
Definition:
values.h:191
dballe::db::v7::Transaction
Definition:
transaction.h:15
dballe::db::v7::Tracer
Smart pointer for trace::Step objects, which calls done() when going out of scope.
Definition:
db/v7/fwd.h:45
wreport
dballe::DBStation
Definition:
types.h:847
Generated by
1.8.13