libwreport
2.8
|
Storage for the decoded data of a BUFR or CREX message. More...
#include <bulletin.h>
Public Member Functions | |
virtual void | clear () |
Reset the bulletin. | |
virtual const char * | encoding_name () const =0 throw () |
Type of source/target encoding. | |
Subset & | obtain_subset (unsigned subsection) |
Get a Subset from the message. More... | |
const Subset & | subset (unsigned subsection) const |
Get a Subset from the message. More... | |
virtual void | load_tables ()=0 |
Load a new set of tables to use for encoding this message. | |
virtual void | decode_header (const std::string &buf, const char *fname="(memory)", size_t offset=0)=0 |
Parse only the header of an encoded message. More... | |
virtual void | decode (const std::string &buf, const char *fname="(memory)", size_t offset=0)=0 |
Parse an encoded message. More... | |
virtual void | encode (std::string &buf) const =0 |
Encode the message. | |
void | visit_datadesc (opcode::Visitor &e) const |
Walk the structure of the data descriptor section sending events to an opcode::Explorer. | |
void | visit (bulletin::Visitor &out) const |
Run the Data Descriptor Section interpreter, sending commands to executor. | |
void | print (FILE *out) const |
Dump the contents of this bulletin. | |
void | print_structured (FILE *out) const |
Dump the contents of this bulletin, in a more structured way. | |
virtual void | print_details (FILE *out) const |
Print format-specific details. | |
void | print_datadesc (FILE *out, unsigned indent=0) const |
Pretty-print the data descriptor section. More... | |
virtual unsigned | diff (const Bulletin &msg) const |
Compute the differences between two bulletins. More... | |
virtual unsigned | diff_details (const Bulletin &msg) const |
Diff format-specific details. | |
Data Fields | |
const char * | fname |
Input file name (optional). More... | |
size_t | offset |
File offset of the start of the message. More... | |
int | type |
Message category. | |
int | subtype |
International message subcategory. | |
int | localsubtype |
Local message subcategory. | |
int | edition |
Edition number. | |
int | master_table_number |
Master table number. | |
const Vartable * | btable |
vartable used to lookup B table codes | |
const DTable * | dtable |
dtable used to lookup D table codes | |
std::vector< Varcode > | datadesc |
Parsed data descriptor section. | |
std::vector< Subset > | subsets |
Decoded variables. | |
int | rep_year |
Representative datetime for this data. More... | |
int | rep_month |
Month. | |
int | rep_day |
Day. | |
int | rep_hour |
Hour. | |
int | rep_minute |
Minute. | |
int | rep_second |
Second. | |
Storage for the decoded data of a BUFR or CREX message.
A Bulletin roughly reflects the structure of a BUFR or CREX message: it contains metadata, a sequence of wreport::Varcode with the contents of a Data Descriptor Section, and one or more wreport::Subset with the decoded values.
Subsets are essentially sequences of wreport::Var objects, and therefore contain the values together with the full range of variable information, including type, measurement units and number of significant digits.
Extra values like quality control statistics or replaced values are represented as 'attributes' to the wreport::Var objects.
|
pure virtual |
Parse an encoded message.
buf | The buffer to decode |
fname | The file name to use for error messages |
offset | The offset inside the file of the start of the bulletin, used for error messages |
Implemented in wreport::CrexBulletin, and wreport::BufrBulletin.
|
pure virtual |
Parse only the header of an encoded message.
buf | The buffer to decode |
fname | The file name to use for error messages |
offset | The offset inside the file of the start of the bulletin, used for error messages |
Implemented in wreport::CrexBulletin, and wreport::BufrBulletin.
|
virtual |
Compute the differences between two bulletins.
Details of the differences found will be formatted using the notes system (
msg | The bulletin to compare with this one |
Subset& wreport::Bulletin::obtain_subset | ( | unsigned | subsection) |
void wreport::Bulletin::print_datadesc | ( | FILE * | out, |
unsigned | indent = 0 |
||
) | const |
Pretty-print the data descriptor section.
out | Output stream to use |
indent | Indent all output by this amount of spaces |
const Subset& wreport::Bulletin::subset | ( | unsigned | subsection) | const |
Get a Subset from the message.
An exception will be thrown if the subset does not exist
subsection | The subsection index (starting from 0) |
const char* wreport::Bulletin::fname |
Input file name (optional).
If available, it will be used to generate better error messages.
If not available, it is NULL.
size_t wreport::Bulletin::offset |
File offset of the start of the message.
If available, it will be used to generate better error messages.
If not available, it is 0.
int wreport::Bulletin::rep_year |
Representative datetime for this data.
Year