libwreport 2.1
Public Member Functions | Static Public Member Functions | Data Fields | Protected Attributes
wreport::DTable Struct Reference

D-table with Dxxyyy aggregate code expansions. More...

#include <dtable.h>

Public Member Functions

const std::string & id () const throw ()
 Table ID.
bool loaded () const throw ()
 True if the table has been loaded.
void load (const std::pair< std::string, std::string > &idfile)
 Load a table.
Opcodes query (Varcode var) const
 Query the DTable.

Static Public Member Functions

static const DTableget (const char *id)
 Return a DTable by id, loading it if necessary.
static const DTableget (const std::pair< std::string, std::string > &idfile)
 Same as get(), but explicitly specifies the pathname.

Data Fields

std::vector< Varcodevarcodes
 One single table with the concatenation of all the expansion varcodes.
std::vector< dtable::Entryentries
 Expansion entries with pointers inside varcodes.

Protected Attributes

std::string m_id
 Table ID.

Detailed Description

D-table with Dxxyyy aggregate code expansions.


Member Function Documentation

static const DTable* wreport::DTable::get ( const char *  id) [static]

Return a DTable by id, loading it if necessary.

Once loaded, the table will be cached in memory for reuse, and further calls to get() will return the cached version.

The cached tables are never deallocated, so the returned pointer is valid through the whole lifetime of the program.

Parameters:
idID of the DTable data to access
static const DTable* wreport::DTable::get ( const std::pair< std::string, std::string > &  idfile) [static]

Same as get(), but explicitly specifies the pathname.

Parameters:
idfilepair of (table id, pathname of the table on disk)
void wreport::DTable::load ( const std::pair< std::string, std::string > &  idfile)

Load a table.

Parameters:
idfilepair of (table id, pathname of the table on disk)
Opcodes wreport::DTable::query ( Varcode  var) const

Query the DTable.

Parameters:
varentry code (i.e. DXXYYY as a wreport::Varcode WR_VAR(3, xx, yyy).
Returns:
the bufrex_opcode chain that contains the expansion elements (must be deallocated by the caller using bufrex_opcode_delete)

The documentation for this struct was generated from the following file: