libdballe  7.21
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dballe::db::v6::sqlite::SQLiteStationBase Class Reference

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

#include <station.h>

Inheritance diagram for dballe::db::v6::sqlite::SQLiteStationBase:
dballe::db::v6::Station dballe::db::v6::sqlite::SQLiteStationV6

Public Member Functions

 SQLiteStationBase (dballe::sql::SQLiteConnection &conn)
 
 SQLiteStationBase (const SQLiteStationBase &)=delete
 
 SQLiteStationBase (const SQLiteStationBase &&)=delete
 
SQLiteStationBaseoperator= (const SQLiteStationBase &)=delete
 
int get_id (int lat, int lon, const char *ident=nullptr) override
 Get the station ID given latitude, longitude and mobile identifier. More...
 
int obtain_id (int lat, int lon, const char *ident=nullptr, bool *inserted=NULL) override
 Get the station ID given latitude, longitude and mobile identifier. More...
 
void get_station_vars (int id_station, int id_report, 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...
 
void dump (FILE *out) override
 Dump the entire contents of the table to an output stream.
 
- Public Member Functions inherited from dballe::db::v6::Station
virtual ~Station ()
 Instantiate a Station object for this connection.
 

Protected Member Functions

bool maybe_get_id (int lat, int lon, const char *ident, int *id)
 Lookup the ID of a station, returning true if it was found, false if not.
 
void read_station_vars (dballe::sql::SQLiteStatement &stm, std::function< void(std::unique_ptr< wreport::Var >)> dest)
 Run stm, read its output and generate variables to send to dest.
 

Protected Attributes

dballe::sql::SQLiteConnectionconn
 DB connection.
 
dballe::sql::SQLiteStatementsfstm = nullptr
 Precompiled select fixed station query.
 
dballe::sql::SQLiteStatementsmstm = nullptr
 Precompiled select mobile station query.
 
dballe::sql::SQLiteStatementistm = nullptr
 Precompiled insert query.
 

Detailed Description

Precompiled queries to manipulate the station table.

Member Function Documentation

◆ add_station_vars()

void dballe::db::v6::sqlite::SQLiteStationBase::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::v6::Station.

◆ get_id()

int dballe::db::v6::sqlite::SQLiteStationBase::get_id ( int  lat,
int  lon,
const char *  ident = nullptr 
)
overridevirtual

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

It throws an exception if it does not exist.

Returns
Resulting ID of the station

Implements dballe::db::v6::Station.

◆ obtain_id()

int dballe::db::v6::sqlite::SQLiteStationBase::obtain_id ( int  lat,
int  lon,
const char *  ident = nullptr,
bool *  inserted = NULL 
)
overridevirtual

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

It creates the station record if it does not exist.

Returns
Resulting ID of the station

Implements dballe::db::v6::Station.


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