libwreport
3.40
|
Base Vartable implementation. More...
#include <vartable.h>
Public Member Functions | |
Base (const std::filesystem::path &pathname) | |
std::string | pathname () const override |
Return the pathname of the file from which this table has been loaded. | |
std::filesystem::path | path () const override |
Return the pathname of the file from which this table has been loaded. | |
_Varinfo * | obtain (unsigned line_no, Varcode code) |
const Entry * | query_entry (Varcode code) const |
Varinfo | query (Varcode code) const override |
Query the Vartable. More... | |
bool | contains (Varcode code) const override |
Check if the code can be resolved to a varinfo. | |
Varinfo | query_altered (Varcode code, int new_scale, unsigned new_bit_len, int new_bit_ref) const override |
Query an altered version of the vartable. More... | |
bool | iterate (std::function< bool(Varinfo)> dest) const override |
Iterate the whole contents of the table. More... | |
Data Fields | |
std::vector< Entry > | entries |
Entries in this Vartable. More... | |
Protected Attributes | |
std::filesystem::path | m_pathname |
Pathname to the file from which this vartable has been loaded. | |
Additional Inherited Members | |
![]() | |
static const Vartable * | load_bufr (const std::string &pathname) |
Return a BUFR vartable, by file name. More... | |
static const Vartable * | load_bufr (const std::filesystem::path &pathname) |
static const Vartable * | load_bufr (const char *pathname) |
static const Vartable * | load_crex (const std::string &pathname) |
Return a CREX vartable, by file name. More... | |
static const Vartable * | load_crex (const std::filesystem::path &pathname) |
static const Vartable * | load_crex (const char *pathname) |
static const Vartable * | get_bufr (const BufrTableID &id) |
Find a BUFR table. | |
static const Vartable * | get_crex (const CrexTableID &id) |
Find a CREX table. | |
static const Vartable * | get_bufr (const std::string &basename) |
Find a BUFR table, by file name (without extension) | |
static const Vartable * | get_crex (const std::string &basename) |
Find a CREX table, by file name (without extension) | |
|
overridevirtual |
Iterate the whole contents of the table.
Return false from dest to stop iteration.
Implements wreport::Vartable.
Query the Vartable.
Throws an exception if not found.
code | wreport::Varcode to query |
Implements wreport::Vartable.
|
overridevirtual |
Query an altered version of the vartable.
code | wreport::Varcode to query |
new_scale | Scale to use instead of the default |
new_bit_len | Bit length to use instead of the default |
new_bit_ref | bit_ref to use instead of the default |
Implements wreport::Vartable.
std::vector<Entry> wreport::vartable::Base::entries |
Entries in this Vartable.
The entries are sorted by varcode, so that we can look them up by binary search.
Since we are handing out pointers to _Varinfo structures inside the vector, those pointers will be invalidated if a vector reallocation gets triggered. This means that once the table has been loaded, it size cannot be changed anymore.