vartable.h
#ifndef WREPORT_VARTABLE_H
#define WREPORT_VARTABLE_H
#include <wreport/varinfo.h>
#include <string>
#include <functional>
#include <wreport/fwd.h>
namespace wreport {
class Vartable
{
public:
virtual ~Vartable();
virtual std::string pathname() const = 0;
virtual Varinfo query(Varcode code) const = 0;
virtual bool contains(Varcode code) const = 0;
virtual Varinfo query_altered(Varcode code, int new_scale, unsigned new_bit_len, int new_bit_ref) const = 0;
virtual bool iterate(std::function<bool(Varinfo)> dest) const = 0;
static const Vartable* load_bufr(const std::string& pathname);
static const Vartable* load_crex(const std::string& pathname);
static const Vartable* get_bufr(const BufrTableID& id);
static const Vartable* get_crex(const CrexTableID& id);
static const Vartable* get_bufr(const std::string& basename);
static const Vartable* get_crex(const std::string& basename);
};
}
#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::Vartable
Holds a variable information table.
Definition vartable.h:30
wreport::Vartable::query_altered
virtual Varinfo query_altered(Varcode code, int new_scale, unsigned new_bit_len, int new_bit_ref) const =0
Query an altered version of the vartable.
wreport::Vartable::load_crex
static const Vartable * load_crex(const std::string &pathname)
Return a CREX vartable, by file name.
wreport::Vartable::get_crex
static const Vartable * get_crex(const CrexTableID &id)
Find a CREX table.
wreport::Vartable::query
virtual Varinfo query(Varcode code) const =0
Query the Vartable.
wreport::Vartable::load_bufr
static const Vartable * load_bufr(const std::string &pathname)
Return a BUFR vartable, by file name.
wreport::Vartable::get_crex
static const Vartable * get_crex(const std::string &basename)
Find a CREX table, by file name (without extension).
wreport::Vartable::iterate
virtual bool iterate(std::function< bool(Varinfo)> dest) const =0
Iterate the whole contents of the table.
wreport::Vartable::pathname
virtual std::string pathname() const =0
Return the pathname of the file from which this table has been loaded.
wreport::Vartable::get_bufr
static const Vartable * get_bufr(const BufrTableID &id)
Find a BUFR table.
wreport::Vartable::get_bufr
static const Vartable * get_bufr(const std::string &basename)
Find a BUFR table, by file name (without extension).
wreport::Vartable::contains
virtual bool contains(Varcode code) const =0
Check if the code can be resolved to a varinfo.
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
varinfo.h
Implement fast access to information about WMO variables.