libdballe  9.14
mysql/levtr.h
1 #ifndef DBALLE_DB_V7_MYSQL_LEVTRV7_H
2 #define DBALLE_DB_V7_MYSQL_LEVTRV7_H
3 
4 #include <cstdio>
5 #include <dballe/db/db.h>
6 #include <dballe/db/v7/fwd.h>
7 #include <dballe/db/v7/levtr.h>
8 #include <dballe/sql/fwd.h>
9 #include <memory>
10 
11 namespace dballe {
12 namespace db {
13 namespace v7 {
14 namespace mysql {
15 struct DB;
16 
20 struct MySQLLevTr : public v7::LevTr
21 {
22 protected:
27 
28  void
29  _dump(std::function<void(int, const Level&, const Trange&)> out) override;
30 
31 public:
33  MySQLLevTr(const LevTr&) = delete;
34  MySQLLevTr(const LevTr&&) = delete;
35  MySQLLevTr& operator=(const MySQLLevTr&) = delete;
36  ~MySQLLevTr();
37 
38  void prefetch_ids(Tracer<>& trc, const std::set<int>& ids) override;
39  const LevTrEntry* lookup_id(Tracer<>& trc, int id) override;
40  int obtain_id(Tracer<>& trc, const LevTrEntry& desc) override;
41 };
42 
43 } // namespace mysql
44 } // namespace v7
45 } // namespace db
46 } // namespace dballe
47 #endif
Forward declarations for public dballe/sql names.
void prefetch_ids(Tracer<> &trc, const std::set< int > &ids) override
Given a set of IDs, load LevTr information for them and add it to the cache.
Information on how a value has been sampled or computed with regards to time.
Definition: types.h:688
Functions used to connect to DB-All.e and insert, query and delete data.
Definition: cmdline.h:18
Vertical level or layer.
Definition: types.h:624
int obtain_id(Tracer<> &trc, const LevTrEntry &desc) override
Look up a LevTr from the database given its description.
Definition: cache.h:14
Definition: transaction.h:15
Precompiled queries to manipulate the lev_tr table.
Definition: levtr.h:20
Smart pointer for trace::Step objects, which calls done() when going out of scope.
Definition: db/v7/fwd.h:44
dballe::sql::MySQLConnection & conn
DB connection.
Definition: mysql/levtr.h:26
Precompiled queries to manipulate the lev_tr table.
Definition: mysql/levtr.h:20
const LevTrEntry * lookup_id(Tracer<> &trc, int id) override
Look up a LevTr from the database given its ID.
Database connection.
Definition: mysql.h:140