libdballe  8.6
sqlite/levtr.h
1 #ifndef DBALLE_DB_V7_SQLITE_LEVTRV7_H
2 #define DBALLE_DB_V7_SQLITE_LEVTRV7_H
3 
4 #include <dballe/db/db.h>
5 #include <dballe/db/v7/levtr.h>
6 #include <dballe/sql/fwd.h>
7 #include <cstdio>
8 #include <memory>
9 
10 namespace dballe {
11 namespace db {
12 namespace v7 {
13 namespace sqlite {
14 struct DB;
15 
19 struct SQLiteLevTr : public v7::LevTr
20 {
21 protected:
26 
35 
36  void _dump(std::function<void(int, const Level&, const Trange&)> out) override;
37 
38 public:
40  SQLiteLevTr(const LevTr&) = delete;
41  SQLiteLevTr(const LevTr&&) = delete;
42  SQLiteLevTr& operator=(const SQLiteLevTr&) = delete;
43  ~SQLiteLevTr();
44 
45  void prefetch_ids(Tracer<>& trc, const std::set<int>& id) override;
46  const LevTrEntry* lookup_id(Tracer<>& trc, int id) override;
47  int obtain_id(Tracer<>& trc, const LevTrEntry& desc) override;
48 };
49 
50 }
51 }
52 }
53 }
54 #endif
dballe::db::v7::sqlite::SQLiteLevTr::dstm
dballe::sql::SQLiteStatement * dstm
Precompiled delete statement.
Definition: sqlite/levtr.h:34
dballe::db::v7::sqlite::SQLiteLevTr::obtain_id
int obtain_id(Tracer<> &trc, const LevTrEntry &desc) override
Look up a LevTr from the database given its description.
dballe::db::v7::Tracer
Smart pointer for trace::Step objects, which calls done() when going out of scope.
Definition: db/v7/fwd.h:45
fwd.h
dballe::db::v7::LevTrEntry
Definition: cache.h:14
dballe::db::v7::Transaction
Definition: transaction.h:15
dballe::db::v7::sqlite::SQLiteLevTr
Precompiled queries to manipulate the lev_tr table.
Definition: sqlite/levtr.h:19
dballe::db::v7::sqlite::SQLiteLevTr::sstm
dballe::sql::SQLiteStatement * sstm
Precompiled select statement.
Definition: sqlite/levtr.h:28
dballe::db::v7::sqlite::SQLiteLevTr::lookup_id
const LevTrEntry * lookup_id(Tracer<> &trc, int id) override
Look up a LevTr from the database given its ID.
dballe::db::v7::sqlite::SQLiteLevTr::prefetch_ids
void prefetch_ids(Tracer<> &trc, const std::set< int > &id) override
Given a set of IDs, load LevTr information for them and add it to the cache.
db.h
dballe::Trange
Information on how a value has been sampled or computed with regards to time.
Definition: types.h:686
dballe::db::v7::LevTr
Precompiled queries to manipulate the lev_tr table.
Definition: levtr.h:20
dballe::Level
Vertical level or layer.
Definition: types.h:624
dballe::sql::SQLiteStatement
SQLite statement.
Definition: sqlite.h:98
dballe::db::v7::sqlite::SQLiteLevTr::istm
dballe::sql::SQLiteStatement * istm
Precompiled insert statement.
Definition: sqlite/levtr.h:32
dballe::db::v7::sqlite::SQLiteLevTr::conn
dballe::sql::SQLiteConnection & conn
DB connection.
Definition: sqlite/levtr.h:25
dballe::sql::SQLiteConnection
Database connection.
Definition: sqlite.h:34
dballe::db::v7::sqlite::SQLiteLevTr::sdstm
dballe::sql::SQLiteStatement * sdstm
Precompiled select data statement.
Definition: sqlite/levtr.h:30