libwreport  3.23
tables.h
1 #ifndef WREPORT_TABLES_H
2 #define WREPORT_TABLES_H
3 
4 #include <wreport/varinfo.h>
5 #include <map>
6 #include <string>
7 
8 namespace wreport {
9 struct BufrTableID;
10 struct CrexTableID;
11 struct Vartable;
12 struct DTable;
13 
17 struct Tables
18 {
20  const Vartable* btable;
22  const DTable* dtable;
24  mutable std::map<std::string, _Varinfo> bitmap_table;
26  mutable std::map<Varcode, _Varinfo> chardata_table;
28  mutable std::map<unsigned, _Varinfo> unknown_table;
29 
30  Tables();
31  Tables(const Tables&) = delete;
32  Tables(Tables&&);
33  ~Tables();
34 
35  Tables& operator=(const Tables&) = delete;
36  Tables& operator=(Tables&&);
37 
39  bool loaded() const;
40 
42  void clear();
43 
45  void load_bufr(const BufrTableID& id);
46 
48  void load_crex(const CrexTableID& id);
49 
50  // Create a varinfo to store the bitmap
51  Varinfo get_bitmap(Varcode code, const std::string& bitmap) const;
52 
53  // Create a varinfo to store character data
54  Varinfo get_chardata(Varcode code, unsigned len) const;
55 
56  // Create a varinfo to store a C06 unknown local descriptor
57  Varinfo get_unknown(Varcode code, unsigned bit_len) const;
58 };
59 
60 }
61 #endif
String functions.
Definition: benchmark.h:13
uint16_t Varcode
Holds the WMO variable code of a variable.
Definition: fwd.h:11
Identifying information for one distinct instance of BUFR tables.
Definition: tableinfo.h:15
Identifying information for one distinct instance of CREX tables.
Definition: tableinfo.h:44
BUFR/CREX table D with Dxxyyy aggregate code expansions.
Definition: dtable.h:14
Collection of BUFR/CREX tables used to work on a bulletin.
Definition: tables.h:18
std::map< std::string, _Varinfo > bitmap_table
Storage for temporary Varinfos for bitmaps.
Definition: tables.h:24
std::map< Varcode, _Varinfo > chardata_table
Storage for temporary Varinfos for arbitrary character data.
Definition: tables.h:26
const Vartable * btable
Vartable used to lookup B table codes.
Definition: tables.h:20
bool loaded() const
Check if the B and D tables have been loaded.
void load_crex(const CrexTableID &id)
Load CREX B and D tables.
const DTable * dtable
DTable used to lookup D table codes.
Definition: tables.h:22
std::map< unsigned, _Varinfo > unknown_table
Storage for temporary Varinfos for C06 unknown local descriptors.
Definition: tables.h:28
void clear()
Clear btable, datable and all locally generated Varinfos.
void load_bufr(const BufrTableID &id)
Load BUFR B and D tables.
Holds a variable information table.
Definition: vartable.h:32
Information about a variable.
Definition: varinfo.h:137
Implement fast access to information about WMO variables.