wreport::CrexBulletin Class Reference

CREX bulletin implementation. More...

`#include <bulletin.h>`

Inheritance diagram for wreport::CrexBulletin:

## Public Member Functions

void | clear ()
| Reset the bulletin.
const char * | encoding_name () const override throw ()
| Type of source/target encoding.
void | load_tables () override
| Load a new set of tables to use for encoding this message.
std::string | encode () const override
| Encode the message.
void | print_details (FILE *out) const override
| Print format-specific details.
unsigned | diff_details (const Bulletin &msg) const override
| Diff format-specific details.
Public Member Functions inherited from wreport::Bulletin
Subset & | obtain_subset (unsigned subsection)
| Get a Subset from the message.
const Subset & | subset (unsigned subsection) const
| Get a Subset from 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.
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.

## Static Public Member Functions

static bool | read (FILE *in, std::string &buf, const char *fname=0, off_t *offset=0)
| Read an encoded BUFR message from a stream.
static void | write (const std::string &buf, FILE *out, const char *fname=0)
| Write an encoded BUFR message to a stream.
static std::unique_ptr< CrexBulletin > | create ()
| To prevent breaking ABI if new members are added to bulletins, direct construction is discouraged in favour of an allocator function.
static std::unique_ptr< CrexBulletin > | decode_header (const std::string &raw, const char *fname="(memory)", size_t offset=0)
| Parse only the header of an encoded BUFR message.
static std::unique_ptr< CrexBulletin > | decode (const std::string &raw, const char *fname="(memory)", size_t offset=0)
| Parse an encoded BUFR message.
static std::unique_ptr< CrexBulletin > | decode_verbose (const std::string &raw, FILE *out, const char *fname="(memory)", size_t offset=0)
| Parse an encoded BUFR message, printing decoding information.

## Data Fields

uint8_t | edition_number = 2
| CREX Edition number.
uint8_t | master_table_version_number = 19
| CREX master table version number.
uint8_t | master_table_version_number_bufr = 19
| BUFR master table version number.
uint8_t | master_table_version_number_local = 0
| Version number of local table used to augment the master table.
bool | has_check_digit = false
| True if the CREX message uses the check digit feature.
Data Fields inherited from wreport::Bulletin
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

CREX bulletin implementation.

## Member Function Documentation

## clear()

void wreport::CrexBulletin::clear | ( |  | ) |

virtual

Reset the bulletin.

Reimplemented from wreport::Bulletin.

## decode()

std::unique_ptr< CrexBulletin > wreport::CrexBulletin::decode | ( | const std::string & | raw,
|  | const char * | fname = "(memory)",
|  | size_t | offset = 0 )

static

Parse an encoded BUFR message.

Parameters

  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

Returns
  The new bulletin with the decoded message

References wreport::Bulletin::fname, and wreport::Bulletin::offset.

## decode_header()

std::unique_ptr< CrexBulletin > wreport::CrexBulletin::decode_header | ( | const std::string & | raw,
|  | const char * | fname = "(memory)",
|  | size_t | offset = 0 )

static

Parse only the header of an encoded BUFR message.

Parameters

  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

Returns
  The new bulletin with the decoded message

References wreport::Bulletin::fname, and wreport::Bulletin::offset.

## decode_verbose()

std::unique_ptr< CrexBulletin > wreport::CrexBulletin::decode_verbose | ( | const std::string & | raw,
|  | FILE * | out,
|  | const char * | fname = "(memory)",
|  | size_t | offset = 0 )

static

Parse an encoded BUFR message, printing decoding information.

Parameters

  buf | The buffer to decode
  out | Where the decoder information should be printed
  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

Returns
  The new bulletin with the decoded message

References wreport::Bulletin::fname, and wreport::Bulletin::offset.

## diff_details()

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

override virtual

Diff format-specific details.

Reimplemented from wreport::Bulletin.

## encode()

std::string wreport::CrexBulletin::encode | ( |  | ) | const

override virtual

Encode the message.

Implements wreport::Bulletin.

## encoding_name()

const char * wreport::CrexBulletin::encoding_name | ( |  | ) | const
throw | ( | ) |  |  |

inline override virtual

Type of source/target encoding.

Implements wreport::Bulletin.

## load_tables()

void wreport::CrexBulletin::load_tables | ( |  | ) |

override virtual

Load a new set of tables to use for encoding this message.

Implements wreport::Bulletin.

## print_details()

void wreport::CrexBulletin::print_details | ( | FILE * | out | ) | const

override virtual

Print format-specific details.

Reimplemented from wreport::Bulletin.

## read()

bool wreport::CrexBulletin::read | ( | FILE * | in,
|  | std::string & | buf,
|  | const char * | fname = 0,
|  | off_t * | offset = 0 )

static

Read an encoded BUFR message from a stream.

Parameters

  in | The stream to read from
  buf | The buffer where the data will be written
  fname | File name to use in error messages

Return values

  offset | The offset in the file of the beginning of the BUFR data

Returns
  true if a message was found, false on EOF

References wreport::Bulletin::fname, and wreport::Bulletin::offset.

## write()

void wreport::CrexBulletin::write | ( | const std::string & | buf,
|  | FILE * | out,
|  | const char * | fname = 0 )

static

Write an encoded BUFR message to a stream.

Parameters

  buf | The buffer with the data to write
  out | The stream to write to
  fname | File name to use in error messages

References wreport::Bulletin::fname.

## Field Documentation

## master_table_version_number

uint8_t wreport::CrexBulletin::master_table_version_number = 19

CREX master table version number.

See WMO Manual on Codes, FB95-XIV CREX, Specification of sections, note 3, for a list.

## master_table_version_number_bufr

uint8_t wreport::CrexBulletin::master_table_version_number_bufr = 19

BUFR master table version number.

See WMO Manual on Codes, Binary codes, FM94-XIV BUFR, Section 1 Identification section, note 5, for a list.

FIXME: I could not find any reference to why CREX edition 2 has a separate field for BUFR master table version number but not for BUFR master table version, or why it needs to reference BUFR master tables at all.

## master_table_version_number_local

uint8_t wreport::CrexBulletin::master_table_version_number_local = 0

Version number of local table used to augment the master table.

Local tables shall define those parts of the master table which are reserved for local use, thus version numbers of local tables may be changed at will by the originating centre. If no local table is used, the version number of the local table shall be encoded as 0.

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

- bulletin.h