libdballe  7.29
Public Member Functions | List of all members
dballe::db::v6::Station Struct Referenceabstract
Inheritance diagram for dballe::db::v6::Station:
dballe::db::v6::mysql::MySQLStationBase dballe::db::v6::postgresql::StationBase dballe::db::v6::sqlite::SQLiteStationBase dballe::db::v6::mysql::MySQLStationV6 dballe::db::v6::postgresql::PostgreSQLStationV6 dballe::db::v6::sqlite::SQLiteStationV6

Public Member Functions

virtual ~Station ()
 Instantiate a Station object for this connection.
 
virtual int get_id (int lat, int lon, const char *ident=NULL)=0
 Get the station ID given latitude, longitude and mobile identifier. More...
 
virtual int obtain_id (int lat, int lon, const char *ident=NULL, bool *inserted=NULL)=0
 Get the station ID given latitude, longitude and mobile identifier. More...
 
virtual void dump (FILE *out)=0
 Dump the entire contents of the table to an output stream.
 
virtual void get_station_vars (int id_station, int id_report, std::function< void(std::unique_ptr< wreport::Var >)> dest)=0
 Export station variables.
 
virtual void add_station_vars (int id_station, Record &rec)=0
 Add all station variables (without attributes) to rec. More...
 

Member Function Documentation

virtual void dballe::db::v6::Station::add_station_vars ( int  id_station,
Record rec 
)
pure virtual

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.

Implemented in dballe::db::v6::sqlite::SQLiteStationBase, dballe::db::v6::mysql::MySQLStationBase, and dballe::db::v6::postgresql::StationBase.

virtual int dballe::db::v6::Station::get_id ( int  lat,
int  lon,
const char *  ident = NULL 
)
pure virtual

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

Implemented in dballe::db::v6::sqlite::SQLiteStationBase, dballe::db::v6::mysql::MySQLStationBase, and dballe::db::v6::postgresql::StationBase.

virtual int dballe::db::v6::Station::obtain_id ( int  lat,
int  lon,
const char *  ident = NULL,
bool *  inserted = NULL 
)
pure virtual

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

Implemented in dballe::db::v6::sqlite::SQLiteStationBase, dballe::db::v6::mysql::MySQLStationBase, and dballe::db::v6::postgresql::StationBase.


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