libdballe  7.19
v7/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 struct Record;
12 struct Msg;
13 
14 namespace msg {
15 struct Context;
16 }
17 
18 namespace db {
19 namespace v7 {
20 namespace sqlite {
21 struct DB;
22 
26 struct SQLiteLevTr : public v7::LevTr
27 {
28 protected:
33 
37  dballe::sql::SQLiteStatement* sdstm = nullptr;
42 
43  void _dump(std::function<void(int, const Level&, const Trange&)> out) override;
44 
45 public:
47  SQLiteLevTr(const LevTr&) = delete;
48  SQLiteLevTr(const LevTr&&) = delete;
49  SQLiteLevTr& operator=(const SQLiteLevTr&) = delete;
50  ~SQLiteLevTr();
51 
52  void prefetch_ids(const std::set<int>& ids, std::function<void(int, const LevTrDesc&)> dest) override;
53  void prefetch_same_level(int id, std::function<void(int, const LevTrDesc&)> dest) override;
54  levtrs_t::iterator lookup_id(State& st, int id) override;
55  levtrs_t::iterator obtain_id(State& state, const LevTrDesc& desc) override;
56 };
57 
58 
59 }
60 }
61 }
62 }
63 #endif
dballe::sql::SQLiteConnection & conn
DB connection.
Definition: v7/sqlite/levtr.h:32
Cache intermediate results during a database transaction, to avoid hitting the database multiple time...
Definition: state.h:140
Information on how a value has been sampled or computed with regards to time.
Definition: types.h:587
Forward declarations for public dballe/sql names.
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition: cmdline.h:17
Vertical level or layer.
Definition: types.h:532
Functions used to connect to DB-All.e and insert, query and delete data.
Precompiled queries to manipulate the lev_tr table.
Definition: v7/levtr.h:24
Precompiled queries to manipulate the lev_tr table.
Definition: v7/sqlite/levtr.h:26
SQLite statement.
Definition: sqlite.h:88
Definition: state.h:58
Database connection.
Definition: sqlite.h:33