libwreport 3.38
|
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 throw () =0 |
Type of source/target encoding. | |
Subset & | obtain_subset (unsigned subsection) |
Get a Subset from the message. | |
const Subset & | subset (unsigned subsection) const |
Get a Subset from the message. | |
virtual void | load_tables ()=0 |
Load a new set of tables to use for encoding this message. | |
virtual std::string | encode () const =0 |
Encode the message. | |
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. | |
virtual unsigned | diff (const Bulletin &msg) const |
Compute the differences between two bulletins. | |
virtual unsigned | diff_details (const Bulletin &msg) const |
Diff format-specific details. | |
Data Fields | |
std::string | fname |
Input file name (optional). | |
off_t | offset = 0 |
File offset of the start of the message. | |
uint8_t | master_table_number = 0 |
BUFR Master table number. | |
uint8_t | data_category = 0xff |
Data category (BUFR or CREX Table A) | |
uint8_t | data_subcategory = 0xff |
International data sub-category (see Common Code table C-13) | |
uint8_t | data_subcategory_local = 0xff |
Local data sub-category, defined locally by automatic data-processing (ADP) centres. | |
uint16_t | originating_centre = 0xffff |
Identification of originating/generating centre (see Common Code table C-11) | |
uint16_t | originating_subcentre = 0xffff |
Identification of originating/generating sub-centre (allocated by originating/generating centre - see Common Code table C-12) | |
uint8_t | update_sequence_number = 0 |
Update sequence number (zero for original messages and for messages containing only delayed reports; incremented for the other updates) | |
uint16_t | rep_year = 0 |
Reference year in bulletin header. | |
uint8_t | rep_month = 0 |
Reference month in bulletin header. | |
uint8_t | rep_day = 0 |
Reference day in bulletin header. | |
uint8_t | rep_hour = 0 |
Reference hour in bulletin header. | |
uint8_t | rep_minute = 0 |
Reference minute in bulletin header. | |
uint8_t | rep_second = 0 |
Reference second in bulletin header. | |
Tables | tables |
Varcode and opcode tables used for encoding or decoding. | |
std::vector< Varcode > | datadesc |
Parsed data descriptor section. | |
std::vector< Subset > | subsets |
Decoded variables. | |
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.
|
virtual |
Reset the bulletin.
Reimplemented in wreport::BufrBulletin, and wreport::CrexBulletin.
|
virtual |
|
virtual |
Diff format-specific details.
Reimplemented in wreport::BufrBulletin, and wreport::CrexBulletin.
References diff_details().
Referenced by diff_details().
|
pure virtual |
Encode the message.
Implemented in wreport::BufrBulletin, and wreport::CrexBulletin.
References encode().
Referenced by encode().
|
pure virtual |
Type of source/target encoding.
Implemented in wreport::BufrBulletin, and wreport::CrexBulletin.
|
pure virtual |
Load a new set of tables to use for encoding this message.
Implemented in wreport::BufrBulletin, and wreport::CrexBulletin.
References load_tables().
Referenced by load_tables().
Subset & wreport::Bulletin::obtain_subset | ( | unsigned | subsection | ) |
Get a Subset from the message.
The subset will be created if it does not exist, and it will be memory managed by the Bulletin.
subsection | The subsection index (starting from 0) |
References obtain_subset().
Referenced by obtain_subset().
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 |
References print_datadesc().
Referenced by print_datadesc().
|
virtual |
Print format-specific details.
Reimplemented in wreport::BufrBulletin, and wreport::CrexBulletin.
References print_details().
Referenced by print_details().
const Subset & wreport::Bulletin::subset | ( | unsigned | subsection | ) | const |
uint8_t wreport::Bulletin::data_subcategory_local = 0xff |
Local data sub-category, defined locally by automatic data-processing (ADP) centres.
Note: the local data sub-category is maintained for backwards compatibility with BUFR editions 0-3, since many ADP centres have made extensive use of such values in the past. The international data sub-category introduced with BUFR edition 4 is intended to provide a mechanism for better understanding of the overall nature and intent of messages exchanged between ADP centres. These two values (i.e. local sub-category and international sub-category) are intended to be supplementary to one another, so both may be used within a particular BUFR message.
std::string wreport::Bulletin::fname |
Input file name (optional).
If available, it will be used to generate better error messages.
If not available, it is empty.
Referenced by wreport::BufrBulletin::decode(), wreport::BufrBulletin::decode(), wreport::CrexBulletin::decode(), wreport::BufrBulletin::decode_header(), wreport::BufrBulletin::decode_header(), wreport::CrexBulletin::decode_header(), wreport::BufrBulletin::decode_verbose(), wreport::CrexBulletin::decode_verbose(), wreport::BufrBulletin::read(), wreport::CrexBulletin::read(), wreport::BufrBulletin::write(), and wreport::CrexBulletin::write().
uint8_t wreport::Bulletin::master_table_number = 0 |
BUFR Master table number.
A master table may be defined for a scientific discipline other than meteorology. The current list of master tables, along with their associated values in octet 4, is as follows:
\l 0: Meteorology maintained by the World Meteorological Organization (WMO) \l 10: Oceanography maintained by the Intergovernmental Oceanographic Commission (IOC) of UNESCO
off_t wreport::Bulletin::offset = 0 |
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.
Referenced by wreport::BufrBulletin::decode(), wreport::BufrBulletin::decode(), wreport::CrexBulletin::decode(), wreport::BufrBulletin::decode_header(), wreport::BufrBulletin::decode_header(), wreport::CrexBulletin::decode_header(), wreport::BufrBulletin::decode_verbose(), wreport::CrexBulletin::decode_verbose(), wreport::BufrBulletin::read(), and wreport::CrexBulletin::read().