wreport::Bulletin Class Referenceabstract

Storage for the decoded data of a BUFR or CREX message. More...

`#include <bulletin.h>`

Inheritance diagram for wreport::Bulletin:

## 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.

## Detailed Description

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.

## Member Function Documentation

## clear()

virtual void wreport::Bulletin::clear | ( |  | ) |

virtual

Reset the bulletin.

Reimplemented in wreport::BufrBulletin, and wreport::CrexBulletin.

## diff()

virtual unsigned wreport::Bulletin::diff | ( | const Bulletin & | msg | ) | const

virtual

Compute the differences between two bulletins.

Details of the differences found will be formatted using the notes system (

See also
  notes.h).

Parameters

  msg | The bulletin to compare with this one

Returns
  The number of differences found

References diff().

Referenced by diff().

## diff_details()

virtual unsigned wreport::Bulletin::diff_details | ( | const Bulletin & | msg | ) | const

virtual

Diff format-specific details.

Reimplemented in wreport::BufrBulletin, and wreport::CrexBulletin.

References diff_details().

Referenced by diff_details().

## encode()

virtual std::string wreport::Bulletin::encode | ( |  | ) | const

pure virtual

Encode the message.

Implemented in wreport::BufrBulletin, and wreport::CrexBulletin.

References encode().

Referenced by encode().

## encoding_name()

virtual const char * wreport::Bulletin::encoding_name | ( |  | ) | const
throw | ( | ) |  |  |

pure virtual

Type of source/target encoding.

Implemented in wreport::BufrBulletin, and wreport::CrexBulletin.

## load_tables()

virtual void wreport::Bulletin::load_tables | ( |  | ) |

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().

## obtain_subset()

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.

Parameters

  subsection | The subsection index (starting from 0)

References obtain_subset().

Referenced by obtain_subset().

## print_datadesc()

void wreport::Bulletin::print_datadesc | ( | FILE * | out,
|  | unsigned | indent = 0 ) const

Pretty-print the data descriptor section.

Parameters

  out | Output stream to use
  indent | Indent all output by this amount of spaces

References print_datadesc().

Referenced by print_datadesc().

## print_details()

virtual void wreport::Bulletin::print_details | ( | FILE * | out | ) | const

virtual

Print format-specific details.

Reimplemented in wreport::BufrBulletin, and wreport::CrexBulletin.

References print_details().

Referenced by print_details().

## subset()

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

Parameters

  subsection | The subsection index (starting from 0)

References subset().

Referenced by subset().

## Field Documentation

## data_subcategory_local

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.

## fname

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().

## master_table_number

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

## offset

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().

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

- bulletin.h