libdballe 9.6
Public Member Functions | Protected Member Functions | Protected Attributes | 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

 Station (v7::Transaction &tr)
 
virtual DBStation lookup (Tracer<> &trc, int id_station)=0
 Lookup station data by ID.
 
virtual int maybe_get_id (Tracer<> &trc, const dballe::DBStation &st)=0
 Get the station ID given latitude, longitude and mobile identifier.
 
virtual int insert_new (Tracer<> &trc, const dballe::DBStation &desc)=0
 Insert a new station in the database, without checking if it already exists.
 
virtual void run_station_query (Tracer<> &trc, const v7::StationQueryBuilder &qb, std::function< void(const dballe::DBStation &station)>)=0
 Run a station query, iterating on the resulting stations.
 
virtual void get_station_vars (Tracer<> &trc, int id_station, std::function< void(std::unique_ptr< wreport::Var >)> dest)=0
 Export station variables.
 
virtual void add_station_vars (Tracer<> &trc, int id_station, DBValues &values)=0
 Add all station variables (without attributes) to values.
 
void dump (FILE *out)
 Dump the entire contents of the table to an output stream.
 

Protected Member Functions

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

Protected Attributes

v7::Transactiontr
 

Member Function Documentation

◆ add_station_vars()

virtual void dballe::db::v7::Station::add_station_vars ( Tracer<> &  trc,
int  id_station,
DBValues values 
)
pure virtual

Add all station variables (without attributes) to values.

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

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

◆ get_station_vars()

virtual void dballe::db::v7::Station::get_station_vars ( Tracer<> &  trc,
int  id_station,
std::function< void(std::unique_ptr< wreport::Var >)>  dest 
)
pure virtual

◆ insert_new()

virtual int dballe::db::v7::Station::insert_new ( Tracer<> &  trc,
const dballe::DBStation desc 
)
pure virtual

Insert a new station in the database, without checking if it already exists.

Returns the ID of the new station

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

◆ lookup()

virtual DBStation dballe::db::v7::Station::lookup ( Tracer<> &  trc,
int  id_station 
)
pure virtual

◆ maybe_get_id()

virtual int dballe::db::v7::Station::maybe_get_id ( Tracer<> &  trc,
const dballe::DBStation st 
)
pure virtual

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

It returns MISSING_INT if it does not exist.

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


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