22 #ifndef WREPORT_BULLETIN_H
23 #define WREPORT_BULLETIN_H
121 virtual void clear();
174 virtual
void decode(const std::
string& buf, const
char*
fname="(memory)",
size_t offset=0) = 0;
179 virtual
void encode(std::
string& buf) const = 0;
191 void visit(bulletin::Visitor& out) const;
196 void print(FILE* out) const;
257 static std::auto_ptr<BufrCodecOptions> create();
315 virtual void decode(
const std::string& raw,
const char*
fname=
"(memory)",
size_t offset=0);
316 virtual void encode(std::string& buf)
const;
341 static bool read(FILE* in, std::string& buf,
const char*
fname = 0,
long*
offset = 0);
353 static void write(
const std::string& buf, FILE* out,
const char*
fname = 0);
359 static std::auto_ptr<BufrBulletin> create();
381 virtual void decode(
const std::string& raw,
const char*
fname=
"(memory)",
size_t offset=0);
382 virtual void encode(std::string& buf)
const;
400 static bool read(FILE* in, std::string& buf,
const char*
fname = 0,
long*
offset = 0);
412 static void write(
const std::string& buf, FILE* out,
const char*
fname = 0);
418 static std::auto_ptr<CrexBulletin> create();
Options used to configure BUFR decoding.
Definition: bulletin.h:237
char * optional_section
Raw contents of the optional section.
Definition: bulletin.h:287
virtual void print_details(FILE *out) const
Print format-specific details.
int master_table_number
Master table number.
Definition: bulletin.h:94
int rep_hour
Hour.
Definition: bulletin.h:101
virtual unsigned diff(const Bulletin &msg) const
Compute the differences between two bulletins.
size_t offset
File offset of the start of the message.
Definition: bulletin.h:81
Implement wreport::Var, an encapsulation of a measured variable.
bulletin::BufrInput * raw_details
Raw details about the message that has been decoded.
Definition: bulletin.h:295
std::vector< Subset > subsets
Decoded variables.
Definition: bulletin.h:115
const char * fname
Input file name (optional).
Definition: bulletin.h:72
void visit_datadesc(opcode::Visitor &e) const
Walk the structure of the data descriptor section sending events to an opcode::Explorer.
int rep_minute
Minute.
Definition: bulletin.h:102
int localsubtype
Local message subcategory.
Definition: bulletin.h:88
virtual void load_tables()=0
Load a new set of tables to use for encoding this message.
int table
CREX-specific encoding options.
Definition: bulletin.h:373
virtual void clear()
Reset the bulletin.
void print_structured(FILE *out) const
Dump the contents of this bulletin, in a more structured way.
int subcentre
Centre-specific subcentre code.
Definition: bulletin.h:273
virtual const char * encoding_name() const
Type of source/target encoding.
Definition: bulletin.h:312
virtual const char * encoding_name() const
Type of source/target encoding.
Definition: bulletin.h:378
void print_datadesc(FILE *out, unsigned indent=0) const
Pretty-print the data descriptor section.
Storage for the decoded data of a BUFR or CREX message.
Definition: bulletin.h:63
Holds a variable information table.
Definition: vartable.h:84
int update_sequence_number
Update sequence number from octet 7 in section 1.
Definition: bulletin.h:282
virtual void encode(std::string &buf) const =0
Encode the message.
const Subset & subset(unsigned subsection) const
Get a Subset from the message.
int rep_day
Day.
Definition: bulletin.h:100
int subtype
International message subcategory.
Definition: bulletin.h:86
D-table with Dxxyyy aggregate code expansions.
Definition: dtable.h:59
Handling of a BUFR/CREX data subset as a list of decoded variables.
bool decode_adds_undef_attrs
By default (false) undefined attributes are not added to variables, and there is no difference betwee...
Definition: bulletin.h:248
CREX bulletin implementation.
Definition: bulletin.h:368
int rep_month
Month.
Definition: bulletin.h:99
bool has_check_digit
True if the CREX message uses the check digit feature.
Definition: bulletin.h:375
int centre
BUFR-specific encoding options.
Definition: bulletin.h:271
int compression
1 if the BUFR message uses compression, else 0
Definition: bulletin.h:280
virtual unsigned diff_details(const Bulletin &msg) const
Diff format-specific details.
const Vartable * btable
vartable used to lookup B table codes
Definition: bulletin.h:107
int local_table
Version number of local tables used to augment the master table.
Definition: bulletin.h:277
virtual void decode(const std::string &buf, const char *fname="(memory)", size_t offset=0)=0
Parse an encoded message.
const BufrCodecOptions * codec_options
Options used to customise encoding or decoding.
Definition: bulletin.h:306
int master_table
Version number of master tables used.
Definition: bulletin.h:275
Represent a BUFR/CREX data subset as a list of decoded variables.
Definition: subset.h:40
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.
int type
Message category.
Definition: bulletin.h:84
int rep_second
Second.
Definition: bulletin.h:103
int rep_year
Representative datetime for this data.
Definition: bulletin.h:98
Subset & obtain_subset(unsigned subsection)
Get a Subset from the message.
BUFR bulletin implementation.
Definition: bulletin.h:266
const DTable * dtable
dtable used to lookup D table codes
Definition: bulletin.h:109
int optional_section_length
0 if the BUFR message does not contain an optional section, else its length in bytes ...
Definition: bulletin.h:285
void print(FILE *out) const
Dump the contents of this bulletin.
std::vector< Varcode > datadesc
Parsed data descriptor section.
Definition: bulletin.h:112
virtual const char * encoding_name() const =0
Type of source/target encoding.
void visit(bulletin::Visitor &out) const
Run the Data Descriptor Section interpreter, sending commands to executor.
int edition
Edition number.
Definition: bulletin.h:91