libdballe 9.6
Public Member Functions | List of all members
dballe::db::Transaction Class Referenceabstract
Inheritance diagram for dballe::db::Transaction:
dballe::Transaction dballe::db::v7::Transaction dballe::db::v7::TestTransaction

Public Member Functions

virtual void clear_cached_state ()=0
 Clear state information cached during the transaction.
 
virtual void attr_query_station (int data_id, std::function< void(std::unique_ptr< wreport::Var >)> dest)=0
 Query attributes on a station value.
 
virtual void attr_query_data (int data_id, std::function< void(std::unique_ptr< wreport::Var >)> dest)=0
 Query attributes on a data value.
 
virtual void attr_insert_station (int data_id, const Values &attrs)=0
 Insert new attributes on a station value.
 
virtual void attr_insert_data (int data_id, const Values &attrs)=0
 Insert new attributes on a data value.
 
virtual void attr_remove_station (int data_id, const db::AttrList &attrs)=0
 Delete attributes from a station value.
 
virtual void attr_remove_data (int data_id, const db::AttrList &attrs)=0
 Delete attributes from a data value.
 
virtual void update_repinfo (const char *repinfo_file, int *added, int *deleted, int *updated)=0
 Update the repinfo table in the database, with the data found in the given file.
 
virtual void dump (FILE *out)=0
 Dump the entire contents of the database to an output stream.
 
- Public Member Functions inherited from dballe::Transaction
virtual void commit ()=0
 Commit this transaction.
 
virtual void rollback ()=0
 Roll back this transaction.
 
virtual void rollback_nothrow () noexcept=0
 Roll back this transaction.
 
virtual std::shared_ptr< CursorStationquery_stations (const Query &query)=0
 Start a query on the station variables archive.
 
virtual std::shared_ptr< CursorStationDataquery_station_data (const Query &query)=0
 Query the station variables in the database.
 
virtual std::shared_ptr< CursorDataquery_data (const Query &query)=0
 Query the database.
 
virtual std::shared_ptr< CursorSummaryquery_summary (const Query &query)=0
 Query a summary of what the result would be for a query.
 
virtual std::shared_ptr< CursorMessagequery_messages (const Query &query)=0
 Query the database returning the matching data as Message objects.
 
virtual void remove_all ()=0
 Remove all data from the database.
 
virtual void remove_station_data (const Query &query)=0
 Remove data from the database.
 
virtual void remove_data (const Query &query)=0
 Remove data from the database.
 
virtual void import_message (const Message &message, const DBImportOptions &opts=DBImportOptions::defaults)=0
 Import a Message into the DB-All.e database.
 
virtual void import_messages (const std::vector< std::shared_ptr< Message > > &messages, const DBImportOptions &opts=DBImportOptions::defaults)
 Import Messages into the DB-All.e database.
 
virtual void insert_station_data (Data &data, const DBInsertOptions &opts=DBInsertOptions::defaults)=0
 Insert station values into the database.
 
virtual void insert_data (Data &data, const DBInsertOptions &opts=DBInsertOptions::defaults)=0
 Insert data values into the database.
 

Constructor & Destructor Documentation

◆ ~Transaction()

virtual dballe::db::Transaction::~Transaction ( )
inlinevirtual

Reimplemented from dballe::Transaction.

Member Function Documentation

◆ attr_insert_data()

virtual void dballe::db::Transaction::attr_insert_data ( int  data_id,
const Values attrs 
)
pure virtual

Insert new attributes on a data value.

Parameters
data_idThe id (returned by Cursor::attr_reference_id()) used to refer to the value
attrsThe attributes to be added

Implemented in dballe::db::v7::Transaction.

◆ attr_insert_station()

virtual void dballe::db::Transaction::attr_insert_station ( int  data_id,
const Values attrs 
)
pure virtual

Insert new attributes on a station value.

Parameters
data_idThe id (returned by Cursor::attr_reference_id()) used to refer to the value
attrsThe attributes to be added

Implemented in dballe::db::v7::Transaction.

◆ attr_query_data()

virtual void dballe::db::Transaction::attr_query_data ( int  data_id,
std::function< void(std::unique_ptr< wreport::Var >)>  dest 
)
pure virtual

Query attributes on a data value.

Parameters
data_idThe id (returned by Cursor::attr_reference_id()) used to refer to the value
destThe function that will be called on each resulting attribute

Implemented in dballe::db::v7::Transaction.

◆ attr_query_station()

virtual void dballe::db::Transaction::attr_query_station ( int  data_id,
std::function< void(std::unique_ptr< wreport::Var >)>  dest 
)
pure virtual

Query attributes on a station value.

Parameters
data_idThe id (returned by Cursor::attr_reference_id()) used to refer to the value
destThe function that will be called on each resulting attribute

Implemented in dballe::db::v7::Transaction.

◆ attr_remove_data()

virtual void dballe::db::Transaction::attr_remove_data ( int  data_id,
const db::AttrList &  attrs 
)
pure virtual

Delete attributes from a data value.

Parameters
data_idThe id (returned by Cursor::attr_reference_id()) used to refer to the value
attrsArray of WMO codes of the attributes to delete. If empty, all attributes associated to the value will be deleted.

Implemented in dballe::db::v7::Transaction.

◆ attr_remove_station()

virtual void dballe::db::Transaction::attr_remove_station ( int  data_id,
const db::AttrList &  attrs 
)
pure virtual

Delete attributes from a station value.

Parameters
data_idThe id (returned by Cursor::attr_reference_id()) used to refer to the value
attrsArray of WMO codes of the attributes to delete. If empty, all attributes associated to the value will be deleted.

Implemented in dballe::db::v7::Transaction.

◆ clear_cached_state()

virtual void dballe::db::Transaction::clear_cached_state ( )
pure virtual

Clear state information cached during the transaction.

This can be used when, for example, a command that deletes data is issued that would invalidate ID information cached inside the transaction.

Implemented in dballe::db::v7::Transaction.

◆ dump()

virtual void dballe::db::Transaction::dump ( FILE *  out)
pure virtual

Dump the entire contents of the database to an output stream.

Implemented in dballe::db::v7::Transaction.

◆ update_repinfo()

virtual void dballe::db::Transaction::update_repinfo ( const char *  repinfo_file,
int *  added,
int *  deleted,
int *  updated 
)
pure virtual

Update the repinfo table in the database, with the data found in the given file.

Parameters
repinfo_fileThe name of the CSV file with the report type information data to load. The file is in CSV format with 6 columns: report code, mnemonic id, description, priority, descriptor, table A category. If repinfo_file is NULL, then the default of /etc/dballe/repinfo.csv is used.
Return values
addedThe number of repinfo entries that have been added
deletedThe number of repinfo entries that have been deleted
updatedThe number of repinfo entries that have been updated

Implemented in dballe::db::v7::Transaction.


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