libdballe
7.7
Main Page
Modules
Namespaces
Data Structures
Files
File List
Globals
dballe
db
sql
db/sql/levtr.h
1
/*
2
* db/levtr - level-timerange table implementation
3
*
4
* Copyright (C) 2005--2015 ARPA-SIM <urpsim@smr.arpa.emr.it>
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
*
19
* Author: Enrico Zini <enrico@enricozini.com>
20
*/
21
22
#ifndef DBALLE_DB_SQL_LEVTR_H
23
#define DBALLE_DB_SQL_LEVTR_H
24
25
#include <
dballe/core/defs.h
>
26
#include <memory>
27
#include <cstdio>
28
29
namespace
dballe
{
30
struct
Record;
31
struct
Msg;
32
33
namespace
msg {
34
struct
Context;
35
}
36
37
namespace
db {
38
struct
Connection;
39
struct
Statement;
40
41
namespace
sql {
42
46
struct
LevTr
47
{
48
struct
DBRow
49
{
51
int
id
;
53
int
ltype1
;
55
int
l1
;
57
int
ltype2
;
59
int
l2
;
61
int
pind
;
63
int
p1
;
65
int
p2
;
66
};
67
68
virtual
~
LevTr
();
69
74
virtual
int
obtain_id(
const
Level
& lev,
const
Trange
& tr) = 0;
75
77
virtual
const
DBRow
* read(
int
id
) = 0;
78
80
virtual
void
read_all(std::function<
void
(
const
DBRow
&)> dest) = 0;
81
83
virtual
void
dump(FILE* out) = 0;
84
};
85
86
struct
LevTrCache
87
{
88
virtual
~
LevTrCache
();
89
95
virtual
bool
to_rec(
int
id
,
Record
& rec) = 0;
96
98
virtual
Level
to_level(
int
id
)
const
= 0;
99
101
virtual
Trange
to_trange(
int
id
)
const
= 0;
102
108
virtual
msg::Context
* to_msg(
int
id
,
Msg
& msg) = 0;
109
111
virtual
void
invalidate() = 0;
112
114
virtual
void
dump(FILE* out)
const
= 0;
115
117
static
std::unique_ptr<LevTrCache> create(
LevTr
& levtr);
118
};
119
120
}
121
}
122
}
123
124
#endif
125
dballe::msg::Context
Store an array of physical data all on the same level.
Definition:
context.h:44
dballe::db::sql::LevTr::DBRow::pind
int pind
Time range type SQL parameter.
Definition:
db/sql/levtr.h:61
dballe::db::sql::LevTr::DBRow
Definition:
db/sql/levtr.h:48
dballe::Msg
Storage for related physical data.
Definition:
msg.h:133
dballe::db::sql::LevTr::DBRow::ltype1
int ltype1
First level type SQL parameter.
Definition:
db/sql/levtr.h:53
dballe::Trange
Information on how a value has been sampled or computed with regards to time.
Definition:
types.h:565
dballe::Record
Key/value store where keys are strings and values are wreport variables.
Definition:
record.h:16
dballe::db::sql::LevTr::DBRow::ltype2
int ltype2
Second level type SQL parameter.
Definition:
db/sql/levtr.h:57
dballe
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition:
cmdline.h:17
dballe::db::sql::LevTr::DBRow::p2
int p2
Time range P2 SQL parameter.
Definition:
db/sql/levtr.h:65
dballe::db::sql::LevTr::DBRow::l1
int l1
Level L1 SQL parameter.
Definition:
db/sql/levtr.h:55
dballe::Level
Vertical level or layer.
Definition:
types.h:515
dballe::db::sql::LevTrCache
Definition:
db/sql/levtr.h:86
dballe::db::sql::LevTr::DBRow::id
int id
lev_tr ID SQL parameter
Definition:
db/sql/levtr.h:51
dballe::db::sql::LevTr::DBRow::p1
int p1
Time range P1 SQL parameter.
Definition:
db/sql/levtr.h:63
defs.h
Common definitions.
dballe::db::sql::LevTr::DBRow::l2
int l2
Level L2 SQL parameter.
Definition:
db/sql/levtr.h:59
dballe::db::sql::LevTr
Precompiled queries to manipulate the lev_tr table.
Definition:
db/sql/levtr.h:46
Generated by
1.8.11