libdballe  9.11
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dballe::db::v7::mysql::MySQLStation Class Reference

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

#include <station.h>

Inheritance diagram for dballe::db::v7::mysql::MySQLStation:
dballe::db::v7::Station

Public Member Functions

 MySQLStation (v7::Transaction &tr, dballe::sql::MySQLConnection &conn)
 
 MySQLStation (const MySQLStation &)=delete
 
 MySQLStation (const MySQLStation &&)=delete
 
MySQLStationoperator= (const MySQLStation &)=delete
 
DBStation lookup (Tracer<> &trc, int id_station) override
 Lookup station data by ID.
 
int maybe_get_id (Tracer<> &trc, const dballe::DBStation &st) override
 Get the station ID given latitude, longitude and mobile identifier. More...
 
int insert_new (Tracer<> &trc, const dballe::DBStation &desc) override
 Insert a new station in the database, without checking if it already exists. More...
 
void get_station_vars (Tracer<> &trc, int id_station, std::function< void(std::unique_ptr< wreport::Var >)> dest) override
 Export station variables.
 
void add_station_vars (Tracer<> &trc, int id_station, DBValues &values) override
 Add all station variables (without attributes) to values. More...
 
void run_station_query (Tracer<> &trc, const v7::StationQueryBuilder &qb, std::function< void(const dballe::DBStation &)>) override
 
- Public Member Functions inherited from dballe::db::v7::Station
 Station (v7::Transaction &tr)
 
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.
 
void dump (FILE *out)
 Dump the entire contents of the table to an output stream.
 

Protected Member Functions

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

Protected Attributes

dballe::sql::MySQLConnectionconn
 DB connection.
 
- Protected Attributes inherited from dballe::db::v7::Station
v7::Transactiontr
 

Detailed Description

Precompiled queries to manipulate the station table.

Member Function Documentation

◆ add_station_vars()

void dballe::db::v7::mysql::MySQLStation::add_station_vars ( Tracer<> &  trc,
int  id_station,
DBValues values 
)
overridevirtual

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.

Implements dballe::db::v7::Station.

◆ insert_new()

int dballe::db::v7::mysql::MySQLStation::insert_new ( Tracer<> &  trc,
const dballe::DBStation desc 
)
overridevirtual

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

Returns the ID of the new station

Implements dballe::db::v7::Station.

◆ maybe_get_id()

int dballe::db::v7::mysql::MySQLStation::maybe_get_id ( Tracer<> &  trc,
const dballe::DBStation st 
)
overridevirtual

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

It returns MISSING_INT if it does not exist.

Implements dballe::db::v7::Station.


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