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