libdballe  7.19
Public Member Functions | Protected Member Functions | List of all members
dballe::db::v7::Station Struct Referenceabstract
Inheritance diagram for dballe::db::v7::Station:
dballe::db::v7::mysql::MySQLStation dballe::db::v7::postgresql::PostgreSQLStation dballe::db::v7::sqlite::SQLiteStation

Public Member Functions

virtual ~Station ()
 Instantiate a Station object for this connection.
 
virtual stations_t::iterator lookup_id (State &st, int id)=0
 Look up a station give its ID. More...
 
virtual stations_t::iterator get_id (State &st, const StationDesc &desc)
 Get the station ID given latitude, longitude and mobile identifier. More...
 
virtual stations_t::iterator obtain_id (State &st, const StationDesc &desc)=0
 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.
 
virtual void get_station_vars (int id_station, 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...
 

Protected Member Functions

virtual bool maybe_get_id (const StationDesc &st, int *id)=0
 
virtual void _dump (std::function< void(int, int, const Coords &coords, const char *ident)> out)=0
 

Member Function Documentation

virtual void dballe::db::v7::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::v7::sqlite::SQLiteStation, dballe::db::v7::mysql::MySQLStation, and dballe::db::v7::postgresql::PostgreSQLStation.

virtual stations_t::iterator dballe::db::v7::Station::get_id ( State st,
const StationDesc desc 
)
virtual

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

It throws an exception if it does not exist.

virtual stations_t::iterator dballe::db::v7::Station::lookup_id ( State st,
int  id 
)
pure virtual

Look up a station give its ID.

It throws an exception if it does not exist.

Implemented in dballe::db::v7::sqlite::SQLiteStation, dballe::db::v7::mysql::MySQLStation, and dballe::db::v7::postgresql::PostgreSQLStation.

virtual stations_t::iterator dballe::db::v7::Station::obtain_id ( State st,
const StationDesc desc 
)
pure virtual

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

It creates the station record if it does not exist.

Implemented in dballe::db::v7::sqlite::SQLiteStation, dballe::db::v7::mysql::MySQLStation, and dballe::db::v7::postgresql::PostgreSQLStation.


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