libdballe
9.13
dballe
db
v7
levtr.h
1
#ifndef DBALLE_DB_V7_LEVTR_H
2
#define DBALLE_DB_V7_LEVTR_H
3
4
#include <cstdio>
5
#include <
dballe/core/defs.h
>
6
#include <dballe/db/v7/cache.h>
7
#include <dballe/db/v7/fwd.h>
8
#include <dballe/msg/fwd.h>
9
#include <functional>
10
#include <memory>
11
#include <set>
12
13
namespace
dballe {
14
namespace
db {
15
namespace
v7 {
16
20
struct
LevTr
21
{
22
protected
:
23
v7::Transaction
& tr;
24
LevTrCache
cache;
25
virtual
void
26
_dump(std::function<
void
(
int
,
const
Level
&,
const
Trange
&)> out) = 0;
27
28
public
:
29
LevTr(
v7::Transaction
& tr);
30
virtual
~LevTr();
31
38
void
clear_cache
();
39
44
virtual
void
prefetch_ids
(
Tracer<>
& trc,
const
std::set<int>& ids) = 0;
45
51
impl::msg::Context
*
to_msg
(
Tracer<>
& trc,
int
id
,
impl::Message
& msg);
52
57
const
LevTrEntry
&
lookup_cache
(
int
id
);
58
60
virtual
const
LevTrEntry
*
lookup_id
(
Tracer<>
& trc,
int
id
) = 0;
61
66
virtual
int
obtain_id
(
Tracer<>
& trc,
const
LevTrEntry
& desc) = 0;
67
69
void
dump
(FILE* out);
70
};
71
72
}
// namespace v7
73
}
// namespace db
74
}
// namespace dballe
75
#endif
dballe::db::v7::Tracer
Smart pointer for trace::Step objects, which calls done() when going out of scope.
Definition
db/v7/fwd.h:45
dballe::impl::Message
Storage for related physical data.
Definition
msg.h:134
dballe::impl::msg::Context
Store an array of physical data all on the same level.
Definition
context.h:24
defs.h
Common definitions.
dballe::Level
Vertical level or layer.
Definition
types.h:625
dballe::Trange
Information on how a value has been sampled or computed with regards to time.
Definition
types.h:689
dballe::db::v7::LevTrCache
Definition
cache.h:53
dballe::db::v7::LevTrEntry
Definition
cache.h:15
dballe::db::v7::LevTr::lookup_cache
const LevTrEntry & lookup_cache(int id)
Lookup a LevTr entry from the cache, throwing an exception if it is not found.
dballe::db::v7::LevTr::lookup_id
virtual const LevTrEntry * lookup_id(Tracer<> &trc, int id)=0
Look up a LevTr from the database given its ID.
dballe::db::v7::LevTr::to_msg
impl::msg::Context * to_msg(Tracer<> &trc, int id, impl::Message &msg)
Get/create a Context in the Msg for this level/timerange.
dballe::db::v7::LevTr::obtain_id
virtual int obtain_id(Tracer<> &trc, const LevTrEntry &desc)=0
Look up a LevTr from the database given its description.
dballe::db::v7::LevTr::dump
void dump(FILE *out)
Dump the entire contents of the table to an output stream.
dballe::db::v7::LevTr::clear_cache
void clear_cache()
Invalidate the LevTrEntry cache.
dballe::db::v7::LevTr::prefetch_ids
virtual void prefetch_ids(Tracer<> &trc, const std::set< int > &ids)=0
Given a set of IDs, load LevTr information for them and add it to the cache.
dballe::db::v7::Transaction
Definition
transaction.h:16
Generated by
1.13.2