libdballe  7.19
v7/levtr.h
1 #ifndef DBALLE_DB_V7_LEVTR_H
2 #define DBALLE_DB_V7_LEVTR_H
3 
4 #include <dballe/core/defs.h>
5 #include <dballe/db/v7/state.h>
6 #include <memory>
7 #include <set>
8 #include <cstdio>
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 
24 struct LevTr
25 {
26 protected:
27  virtual void _dump(std::function<void(int, const Level&, const Trange&)> out) = 0;
28 
29 public:
30  virtual ~LevTr();
31 
35  virtual void prefetch_ids(const std::set<int>& ids, std::function<void(int, const LevTrDesc&)> dest) = 0;
36 
40  virtual void prefetch_same_level(int id, std::function<void(int, const LevTrDesc&)> dest) = 0;
41 
47  msg::Context* to_msg(State& st, int id, Msg& msg);
48 
50  virtual levtrs_t::iterator lookup_id(State& st, int id) = 0;
51 
56  virtual levtrs_t::iterator obtain_id(State& state, const LevTrDesc& desc) = 0;
57 
59  void dump(FILE* out);
60 };
61 
62 }
63 }
64 }
65 #endif
Store an array of physical data all on the same level.
Definition: context.h:44
Storage for related physical data.
Definition: msg.h:70
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
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition: cmdline.h:17
Vertical level or layer.
Definition: types.h:532
Precompiled queries to manipulate the lev_tr table.
Definition: v7/levtr.h:24
Common definitions.
Definition: state.h:58