libdballe  7.21
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dballe::db::v7::postgresql::PostgreSQLStation Class Reference

Precompiled queries to manipulate the station table. More...

#include <station.h>

Inheritance diagram for dballe::db::v7::postgresql::PostgreSQLStation:
dballe::db::v7::Station

Public Member Functions

 PostgreSQLStation (dballe::sql::PostgreSQLConnection &conn)
 
 PostgreSQLStation (const PostgreSQLStation &)=delete
 
 PostgreSQLStation (const PostgreSQLStation &&)=delete
 
PostgreSQLStationoperator= (const PostgreSQLStation &)=delete
 
stations_t::iterator lookup_id (State &st, int id) override
 Look up a station give its ID. More...
 
stations_t::iterator obtain_id (State &st, const StationDesc &desc) override
 Get the station ID given latitude, longitude and mobile identifier. More...
 
void get_station_vars (int id_station, 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. More...
 
- Public Member Functions inherited from dballe::db::v7::Station
virtual ~Station ()
 Instantiate a Station object for this connection.
 
virtual stations_t::iterator get_id (State &st, const StationDesc &desc)
 Get the station ID given latitude, longitude and mobile identifier. More...
 
void dump (FILE *out)
 Dump the entire contents of the table to an output stream.
 

Protected Member Functions

bool maybe_get_id (const StationDesc &st, int *id) override
 Lookup the ID of a station, returning true if it was found, false if not.
 
void _dump (std::function< void(int, int, const Coords &coords, const char *ident)> out) override
 

Protected Attributes

dballe::sql::PostgreSQLConnectionconn
 DB connection.
 

Detailed Description

Precompiled queries to manipulate the station table.

Member Function Documentation

§ add_station_vars()

void dballe::db::v7::postgresql::PostgreSQLStation::add_station_vars ( int  id_station,
Record rec 
)
overridevirtual

Add all station variables (without attributes) to rec.

If the same variable exists in many different networks, the one with the highest priority will be used.

Implements dballe::db::v7::Station.

§ lookup_id()

stations_t::iterator dballe::db::v7::postgresql::PostgreSQLStation::lookup_id ( State st,
int  id 
)
overridevirtual

Look up a station give its ID.

It throws an exception if it does not exist.

Implements dballe::db::v7::Station.

§ obtain_id()

stations_t::iterator dballe::db::v7::postgresql::PostgreSQLStation::obtain_id ( State st,
const StationDesc desc 
)
overridevirtual

Get the station ID given latitude, longitude and mobile identifier.

It creates the station record if it does not exist.

Implements dballe::db::v7::Station.


The documentation for this class was generated from the following file: