libwreport  3.29
vartable.h
1 #ifndef WREPORT_VARTABLE_H
2 #define WREPORT_VARTABLE_H
3 
4 #include <wreport/varinfo.h>
5 #include <string>
6 #include <functional>
7 #include <wreport/fwd.h>
8 
9 namespace wreport {
10 
29 class Vartable
30 {
31 public:
32  virtual ~Vartable();
33 
35  virtual std::string pathname() const = 0;
36 
45  virtual Varinfo query(Varcode code) const = 0;
46 
48  virtual bool contains(Varcode code) const = 0;
49 
66  virtual Varinfo query_altered(Varcode code, int new_scale, unsigned new_bit_len, int new_bit_ref) const = 0;
67 
75  virtual bool iterate(std::function<bool(Varinfo)> dest) const = 0;
76 
83  static const Vartable* load_bufr(const std::string& pathname);
84 
91  static const Vartable* load_crex(const std::string& pathname);
92 
94  static const Vartable* get_bufr(const BufrTableID& id);
95 
97  static const Vartable* get_crex(const CrexTableID& id);
98 
100  static const Vartable* get_bufr(const std::string& basename);
101 
103  static const Vartable* get_crex(const std::string& basename);
104 };
105 
106 }
107 
108 #endif
wreport::Vartable::get_bufr
static const Vartable * get_bufr(const BufrTableID &id)
Find a BUFR table.
wreport::Vartable::contains
virtual bool contains(Varcode code) const =0
Check if the code can be resolved to a varinfo.
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::get_crex
static const Vartable * get_crex(const CrexTableID &id)
Find a CREX table.
wreport::_Varinfo
Information about a variable.
Definition: varinfo.h:137
wreport::Varcode
uint16_t Varcode
Holds the WMO variable code of a variable.
Definition: fwd.h:12
wreport::Vartable::get_crex
static const Vartable * get_crex(const std::string &basename)
Find a CREX table, by file name (without extension)
wreport::BufrTableID
Identifying information for one distinct instance of BUFR tables.
Definition: tableinfo.h:14
wreport::Vartable::load_bufr
static const Vartable * load_bufr(const std::string &pathname)
Return a BUFR vartable, by file name.
wreport::Vartable::pathname
virtual std::string pathname() const =0
Return the pathname of the file from which this table has been loaded.
wreport::CrexTableID
Identifying information for one distinct instance of CREX tables.
Definition: tableinfo.h:44
wreport::Vartable::query
virtual Varinfo query(Varcode code) const =0
Query the Vartable.
wreport::Vartable
Holds a variable information table.
Definition: vartable.h:30
wreport::Vartable::load_crex
static const Vartable * load_crex(const std::string &pathname)
Return a CREX vartable, by file name.
varinfo.h
Implement fast access to information about WMO variables.
wreport::Vartable::iterate
virtual bool iterate(std::function< bool(Varinfo)> dest) const =0
Iterate the whole contents of the table.
wreport
String functions.
Definition: benchmark.h:13
wreport::Vartable::get_bufr
static const Vartable * get_bufr(const std::string &basename)
Find a BUFR table, by file name (without extension)