libdballe  9.11
postgresql/levtr.h
1 #ifndef DBALLE_DB_V7_POSTGRESQL_LEVTRV7_H
2 #define DBALLE_DB_V7_POSTGRESQL_LEVTRV7_H
3 
4 #include <dballe/db/db.h>
5 #include <dballe/db/v7/levtr.h>
6 #include <dballe/db/v7/fwd.h>
7 #include <dballe/sql/fwd.h>
8 #include <cstdio>
9 #include <memory>
10 
11 namespace dballe {
12 namespace db {
13 namespace v7 {
14 namespace postgresql {
15 struct DB;
16 
20 struct PostgreSQLLevTr : public v7::LevTr
21 {
22 protected:
24 
25  void _dump(std::function<void(int, const Level&, const Trange&)> out) override;
26 
27 public:
29  PostgreSQLLevTr(const LevTr&) = delete;
30  PostgreSQLLevTr(const LevTr&&) = delete;
31  PostgreSQLLevTr& operator=(const PostgreSQLLevTr&) = delete;
32  ~PostgreSQLLevTr();
33 
34  void prefetch_ids(Tracer<>& trc, const std::set<int>& ids) override;
35  const LevTrEntry* lookup_id(Tracer<>& trc, int id) override;
36  int obtain_id(Tracer<>& trc, const LevTrEntry& desc) override;
37 };
38 
39 
40 }
41 }
42 }
43 }
44 #endif
Forward declarations for public dballe/sql names.
Database connection.
Definition: postgresql.h:241
Information on how a value has been sampled or computed with regards to time.
Definition: types.h:686
Functions used to connect to DB-All.e and insert, query and delete data.
Definition: cmdline.h:18
Precompiled queries to manipulate the lev_tr table.
Definition: postgresql/levtr.h:20
Vertical level or layer.
Definition: types.h:624
Definition: cache.h:14
const LevTrEntry * lookup_id(Tracer<> &trc, int id) override
Look up a LevTr from the database given its ID.
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:45
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.
int obtain_id(Tracer<> &trc, const LevTrEntry &desc) override
Look up a LevTr from the database given its description.