libdballe  7.7
Public Member Functions | Protected Member Functions | Protected Attributes
dballe::db::odbc::ODBCStationBase Class Reference

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

#include <station.h>

Inheritance diagram for dballe::db::odbc::ODBCStationBase:
dballe::db::sql::Station dballe::db::odbc::ODBCStationV6

Public Member Functions

 ODBCStationBase (ODBCConnection &conn)
 
 ODBCStationBase (const ODBCStationBase &)=delete
 
 ODBCStationBase (const ODBCStationBase &&)=delete
 
ODBCStationBaseoperator= (const ODBCStationBase &)=delete
 
int get_id (int lat, int lon, const char *ident=NULL) override
 Get the station ID given latitude, longitude and mobile identifier. More...
 
int obtain_id (int lat, int lon, const char *ident=NULL, 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::sql::Station
virtual ~Station ()
 Instantiate a Station object for this connection.
 

Protected Member Functions

void set_ident (const char *ident)
 Set the mobile station identifier input value for this ::dba_db_station. More...
 
void get_data (int id)
 Get station information given a station ID. More...
 
void update ()
 Update the information about a station entry.
 
void remove ()
 Remove a station record.
 
void impl_add_station_vars (const char *query, int id_station, Record &rec)
 

Protected Attributes

ODBCConnectionconn
 DB connection.
 
db::Sequenceseq_station
 Station ID sequence, when the DB requires it.
 
ODBCStatementsfstm
 Precompiled select fixed station query.
 
ODBCStatementsmstm
 Precompiled select mobile station query.
 
ODBCStatementsstm
 Precompiled select data by station id query.
 
ODBCStatementistm
 Precompiled insert query.
 
ODBCStatementustm
 Precompiled update query.
 
ODBCStatementdstm
 Precompiled delete query.
 
int id
 Station ID SQL parameter.
 
int lat
 Station latitude SQL parameter.
 
int lon
 Station longitude SQL parameter.
 
char ident [64]
 Mobile station identifier SQL parameter.
 
SQLLEN ident_ind
 Mobile station identifier indicator.
 

Detailed Description

Precompiled queries to manipulate the station table.

Member Function Documentation

void dballe::db::odbc::ODBCStationBase::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::sql::Station.

Reimplemented in dballe::db::odbc::ODBCStationV6.

void dballe::db::odbc::ODBCStationBase::get_data ( int  id)
protected

Get station information given a station ID.

Parameters
idID of the station to query
int dballe::db::odbc::ODBCStationBase::get_id ( int  lat,
int  lon,
const char *  ident = NULL 
)
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::sql::Station.

int dballe::db::odbc::ODBCStationBase::obtain_id ( int  lat,
int  lon,
const char *  ident = NULL,
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::sql::Station.

void dballe::db::odbc::ODBCStationBase::set_ident ( const char *  ident)
protected

Set the mobile station identifier input value for this ::dba_db_station.

Parameters
identValue to use for ident. NULL can be used to unset ident.

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