libdballe 9.13
db/v7/fwd.h
1#ifndef DBALLE_DB_V7_FWD_H
2#define DBALLE_DB_V7_FWD_H
3
4namespace dballe {
5namespace db {
6namespace v7 {
7
8struct Transaction;
9struct QueryBuilder;
11struct DataQueryBuilder;
13struct IdQueryBuilder;
14struct DB;
15struct Repinfo;
16struct Station;
17struct LevTr;
18struct LevTrEntry;
19struct SQLTrace;
20struct Driver;
21
22namespace cursor {
23struct Stations;
24struct StationData;
25struct Data;
26struct Summary;
27} // namespace cursor
28
29namespace batch {
30struct Station;
31struct StationDatum;
32struct MeasuredDatum;
33} // namespace batch
34
35namespace trace {
36struct Step;
37struct Transaction;
38} // namespace trace
39
44template <typename Step = trace::Step> class Tracer
45{
46protected:
47 Step* step;
48
49public:
50 Tracer() : step(nullptr) {}
51 Tracer(Step* step) : step(step) {}
52 Tracer(const Tracer&) = delete;
53 Tracer(Tracer&& o) : step(o.step) { o.step = nullptr; }
54 Tracer& operator=(const Tracer&) = delete;
55 Tracer& operator=(Tracer&&) = delete;
56 ~Tracer()
57 {
58 if (step)
59 step->done();
60 }
61 void reset(Step* step) { this->step = step; }
62 void done()
63 {
64 if (step)
65 step->done();
66 step = nullptr;
67 }
68 Step* operator->() { return step; }
69 operator bool() const { return step; }
70};
71
72} // namespace v7
73} // namespace db
74} // namespace dballe
75
76#endif
DB-ALLe database connection for database format V7.
Definition db/v7/db.h:21
One operation being traced.
Definition db/v7/trace.h:28
Definition db/v7/trace.h:177
Definition qbuilder.h:96
Definition driver.h:20
Definition qbuilder.h:122
Definition cache.h:15
Precompiled queries to manipulate the lev_tr table.
Definition levtr.h:21
Build SQL queries for V7 databases.
Definition qbuilder.h:17
Fast cached access to the repinfo table.
Definition repinfo.h:73
Definition qbuilder.h:83
Definition station.h:25
Definition qbuilder.h:135
Definition transaction.h:16
Definition batch.h:179
CursorData implementation.
Definition db/v7/cursor.h:274
CursorStationData implementation.
Definition db/v7/cursor.h:216
CursorStation implementation.
Definition db/v7/cursor.h:198
CursorSummary implementation.
Definition db/v7/cursor.h:323