libwreport  2.9
Public Member Functions | Static Public Member Functions | Data Fields
wreport::BufrBulletin Struct Reference

BUFR bulletin implementation. More...

#include <bulletin.h>

Inheritance diagram for wreport::BufrBulletin:
wreport::Bulletin

Public Member Functions

void clear ()
 Reset the bulletin.
 
virtual const char * encoding_name () const throw ()
 Type of source/target encoding.
 
virtual void load_tables ()
 Load a new set of tables to use for encoding this message.
 
virtual void decode_header (const std::string &raw, const char *fname="(memory)", size_t offset=0)
 Parse only the header of an encoded message. More...
 
virtual void decode (const std::string &raw, const char *fname="(memory)", size_t offset=0)
 Parse an encoded message. More...
 
virtual void encode (std::string &buf) const
 Encode the message.
 
virtual void print_details (FILE *out) const
 Print format-specific details.
 
virtual unsigned diff_details (const Bulletin &msg) const
 Diff format-specific details.
 
bulletin::BufrInputreset_raw_details (const std::string &buf)
 Create or reset the raw_details structure for this bulletin. More...
 
- Public Member Functions inherited from wreport::Bulletin
Subsetobtain_subset (unsigned subsection)
 Get a Subset from the message. More...
 
const Subsetsubset (unsigned subsection) const
 Get a Subset from the message. More...
 
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.
 
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...
 

Static Public Member Functions

static bool read (FILE *in, std::string &buf, const char *fname=0, long *offset=0)
 Read an encoded BUFR message from a stream. More...
 
static void write (const std::string &buf, FILE *out, const char *fname=0)
 Write an encoded BUFR message to a stream. More...
 
static std::auto_ptr
< BufrBulletin
create ()
 To prevent breaking ABI if new members are added to bulletins, direct construction is discouraged in favour of an allocator function.
 

Data Fields

int centre
 BUFR-specific encoding options. More...
 
int subcentre
 Centre-specific subcentre code.
 
int master_table
 Version number of master tables used.
 
int local_table
 Version number of local tables used to augment the master table.
 
int compression
 1 if the BUFR message uses compression, else 0
 
int update_sequence_number
 Update sequence number from octet 7 in section 1.
 
int optional_section_length
 0 if the BUFR message does not contain an optional section, else its length in bytes
 
char * optional_section
 Raw contents of the optional section.
 
bulletin::BufrInputraw_details
 Raw details about the message that has been decoded. More...
 
const BufrCodecOptionscodec_options
 Options used to customise encoding or decoding. More...
 
- Data Fields inherited from wreport::Bulletin
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 Vartablebtable
 vartable used to lookup B table codes
 
const DTabledtable
 dtable used to lookup D table codes
 
std::vector< Varcodedatadesc
 Parsed data descriptor section.
 
std::vector< Subsetsubsets
 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.
 

Detailed Description

BUFR bulletin implementation.

Member Function Documentation

virtual void wreport::BufrBulletin::decode ( const std::string &  buf,
const char *  fname = "(memory)",
size_t  offset = 0 
)
virtual

Parse an encoded message.

Parameters
bufThe buffer to decode
fnameThe file name to use for error messages
offsetThe offset inside the file of the start of the bulletin, used for error messages

Implements wreport::Bulletin.

virtual void wreport::BufrBulletin::decode_header ( const std::string &  buf,
const char *  fname = "(memory)",
size_t  offset = 0 
)
virtual

Parse only the header of an encoded message.

Parameters
bufThe buffer to decode
fnameThe file name to use for error messages
offsetThe offset inside the file of the start of the bulletin, used for error messages

Implements wreport::Bulletin.

static bool wreport::BufrBulletin::read ( FILE *  in,
std::string &  buf,
const char *  fname = 0,
long *  offset = 0 
)
static

Read an encoded BUFR message from a stream.

Parameters
inThe stream to read from
bufThe buffer where the data will be written
fnameFile name to use in error messages
Return values
offsetThe offset in the file of the beginning of the BUFR data
Returns
true if a message was found, false on EOF
bulletin::BufrInput& wreport::BufrBulletin::reset_raw_details ( const std::string &  buf)

Create or reset the raw_details structure for this bulletin.

This is only invoked during decoding.

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

Write an encoded BUFR message to a stream.

Parameters
bufThe buffer with the data to write
outThe stream to write to
fnameFile name to use in error messages

Field Documentation

int wreport::BufrBulletin::centre

BUFR-specific encoding options.

Common Code table C-1 identifying the originating centre

const BufrCodecOptions* wreport::BufrBulletin::codec_options

Options used to customise encoding or decoding.

It is NULL by default, in which case default options are used.

To configure it, set it to point to a BufrCodecOptions structure with the parameters you need. The caller is responsible for the memory management of the BufrCodecOptions structure.

bulletin::BufrInput* wreport::BufrBulletin::raw_details

Raw details about the message that has been decoded.

It is only filled in by a decoding operation: in all other cases it is NULL.


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