tables.h
#ifndef WREPORT_TABLES_H
#define WREPORT_TABLES_H
#include <wreport/varinfo.h>
#include <wreport/fwd.h>
#include <map>
#include <string>
namespace wreport {
struct Tables
{
const Vartable* btable;
const DTable* dtable;
mutable std::map<std::string, _Varinfo> bitmap_table;
mutable std::map<Varcode, _Varinfo> chardata_table;
mutable std::map<unsigned, _Varinfo> unknown_table;
Tables();
Tables(const Tables&) = delete;
Tables(Tables&&);
~Tables();
Tables& operator=(const Tables&) = delete;
Tables& operator=(Tables&&);
bool loaded() const;
void clear();
void load_bufr(const BufrTableID& id);
void load_crex(const CrexTableID& id);
// Create a varinfo to store the bitmap
Varinfo get_bitmap(Varcode code, const std::string& bitmap) const;
// Create a varinfo to store character data
Varinfo get_chardata(Varcode code, unsigned len) const;
// Create a varinfo to store a C06 unknown local descriptor
Varinfo get_unknown(Varcode code, unsigned bit_len) const;
};
}
#endif
wreport::BufrTableID
Identifying information for one distinct instance of BUFR tables.
Definition tableinfo.h:14
wreport::CrexTableID
Identifying information for one distinct instance of CREX tables.
Definition tableinfo.h:44
wreport::DTable
BUFR/CREX table D with Dxxyyy aggregate code expansions.
Definition dtable.h:14
wreport::Vartable
Holds a variable information table.
Definition vartable.h:30
wreport
String functions.
Definition benchmark.h:13
wreport::Varinfo
const _Varinfo * Varinfo
Varinfo reference.
Definition fwd.h:11
wreport::Varcode
uint16_t Varcode
Holds the WMO variable code of a variable.
Definition fwd.h:12
wreport::Tables::bitmap_table
std::map< std::string, _Varinfo > bitmap_table
Storage for temporary Varinfos for bitmaps.
Definition tables.h:21
wreport::Tables::chardata_table
std::map< Varcode, _Varinfo > chardata_table
Storage for temporary Varinfos for arbitrary character data.
Definition tables.h:23
wreport::Tables::btable
const Vartable * btable
Vartable used to lookup B table codes.
Definition tables.h:17
wreport::Tables::loaded
bool loaded() const
Check if the B and D tables have been loaded.
wreport::Tables::load_crex
void load_crex(const CrexTableID &id)
Load CREX B and D tables.
wreport::Tables::dtable
const DTable * dtable
DTable used to lookup D table codes.
Definition tables.h:19
wreport::Tables::unknown_table
std::map< unsigned, _Varinfo > unknown_table
Storage for temporary Varinfos for C06 unknown local descriptors.
Definition tables.h:25
wreport::Tables::clear
void clear()
Clear btable, datable and all locally generated Varinfos.
wreport::Tables::load_bufr
void load_bufr(const BufrTableID &id)
Load BUFR B and D tables.
varinfo.h
Implement fast access to information about WMO variables.