msg.h File Reference


Detailed Description

Intermediate representation of parsed values, ordered according to a BUFR or CREX message template.

#include <dballe/core/var.h>
#include <dballe/core/rawmsg.h>
#include <dballe/bufrex/dtable.h>
#include <dballe/bufrex/subset.h>

Go to the source code of this file.

Data Structures

struct  _bufrex_bufr_options
 BUFR-specific encoding options. More...
struct  _bufrex_crex_options
 CREX-specific encoding options. More...
struct  _bufrex_msg
 Storage for the decoded data of a BUFR or CREX message. More...

Typedefs

typedef enum _bufrex_type bufrex_type
 Encoding type (BUFR or CREX).
typedef _bufrex_msgbufrex_msg
 Storage for the decoded data of a BUFR or CREX message.

Enumerations

enum  _bufrex_type { BUFREX_BUFR, BUFREX_CREX }
 Encoding type (BUFR or CREX). More...

Functions

dba_err bufrex_msg_create (bufrex_type type, bufrex_msg *msg)
 Create a bufrex_msg.
void bufrex_msg_delete (bufrex_msg msg)
 Delete a bufrex_msg.
void bufrex_msg_reset (bufrex_msg msg)
 Delete all the contents of a bufrex_msg.
dba_err bufrex_msg_get_subset (bufrex_msg msg, int subsection, bufrex_subset *vars)
 Get a dba_subset item from the message.
dba_err bufrex_msg_get_table_id (bufrex_msg msg, const char **id)
 Get the ID of the table used by this bufrex_msg.
dba_err bufrex_msg_load_tables (bufrex_msg msg)
 Load a new set of tables to use for encoding this message.
dba_err bufrex_msg_query_btable (bufrex_msg msg, dba_varcode code, dba_varinfo *info)
 Query the WMO B table used for this BUFR/CREX data.
dba_err bufrex_msg_query_dtable (bufrex_msg msg, dba_varcode code, struct _bufrex_opcode **res)
 Query the WMO D table used for this BUFR/CREX data.
void bufrex_msg_reset_datadesc (bufrex_msg msg)
 Reset the data descriptor section for the message.
dba_err bufrex_msg_get_datadesc (bufrex_msg msg, struct _bufrex_opcode **res)
 Get the data descriptor section of this bufrex_msg.
dba_err bufrex_msg_append_datadesc (bufrex_msg msg, dba_varcode varcode)
 Append one dba_varcode to the data descriptor section of the message.
dba_err bufrex_msg_generate_datadesc (bufrex_msg msg)
 Try to generate a data description section by scanning the variable codes of the variables in the first data subset.
dba_err bufrex_msg_decode (bufrex_msg msg, dba_rawmsg raw)
 Parse an encoded message into a bufrex_msg.
dba_err bufrex_msg_encode (bufrex_msg msg, dba_rawmsg *raw)
 Encode the contents of the bufrex_msg.
dba_err bufr_encoder_encode (bufrex_msg in, dba_rawmsg out)
 Encode a BUFR message.
dba_err bufr_decoder_decode (dba_rawmsg in, bufrex_msg out)
 Decode a BUFR message.
dba_err crex_encoder_encode (bufrex_msg in, dba_rawmsg out)
 Encode a CREX message.
dba_err crex_decoder_decode (dba_rawmsg in, bufrex_msg out)
 Decode a CREX message.
void bufrex_msg_print (bufrex_msg msg, FILE *out)
 Dump the contents of this bufrex_msg.
void bufrex_msg_diff (bufrex_msg msg1, bufrex_msg msg2, int *diffs, FILE *out)
 Compute the differences between two bufrex_msg.


Enumeration Type Documentation

enum _bufrex_type

Encoding type (BUFR or CREX).

Enumerator:
BUFREX_BUFR  WMO BUFR.
BUFREX_CREX  WMO CREX.


Function Documentation

dba_err bufr_decoder_decode ( dba_rawmsg  in,
bufrex_msg  out 
)

Decode a BUFR message.

Parameters:
in The dba_msgraw with the data to decode
out The bufrex_msg that will hold the decoded data
Return values:
opt A newly created bufr_options with informations about the decoding process. If NULL is passed, nothing will be returned. If a bufr_options is returned, it will need to be deleted with bufr_options_delete().
Returns:
The error indicator for the function. See error.h

dba_err bufr_encoder_encode ( bufrex_msg  in,
dba_rawmsg  out 
)

Encode a BUFR message.

Parameters:
in The bufrex_msg with the data to encode
out The dba_rawmsg that will hold the encoded data
Returns:
The error indicator for the function. See error.h

dba_err bufrex_msg_append_datadesc ( bufrex_msg  msg,
dba_varcode  varcode 
)

Append one dba_varcode to the data descriptor section of the message.

Parameters:
msg The message to act on
varcode The dba_varcode to append. See vartable.h
Returns:
The error indicator for the function. See error.h

dba_err bufrex_msg_create ( bufrex_type  type,
bufrex_msg msg 
)

Create a bufrex_msg.

Parameters:
type Message type (BUFR or CREX)
Return values:
msg Newly created bufrex_msg
Returns:
The error indicator for the function (See error.h)

void bufrex_msg_delete ( bufrex_msg  msg  ) 

Delete a bufrex_msg.

Parameters:
msg The bufrex_msg to delete

dba_err bufrex_msg_generate_datadesc ( bufrex_msg  msg  ) 

Try to generate a data description section by scanning the variable codes of the variables in the first data subset.

Parameters:
msg The message to act on
Returns:
The error indicator for the function. See error.h

dba_err bufrex_msg_get_datadesc ( bufrex_msg  msg,
struct _bufrex_opcode **  res 
)

Get the data descriptor section of this bufrex_msg.

Parameters:
msg The message to act on
Return values:
res A copy of the internal list of data descriptors for the data descriptor section. It must be deallocated by the caller using bufrex_opcode_delete()
Returns:
The error indicator for the function. See error.h

dba_err bufrex_msg_get_subset ( bufrex_msg  msg,
int  subsection,
bufrex_subset vars 
)

Get a dba_subset item from the message.

The subset will be created if it does not exist.

Parameters:
msg The bufrex_msg to query
subsection The subsection index (starting from 0)
Return values:
vars The subsection requested. It can be newly created if the message did not contain such a subsection before, but memory management is handled by the bufrex_msg structure.
Returns:
The error indicator for the function (See error.h)

dba_err bufrex_msg_get_table_id ( bufrex_msg  msg,
const char **  id 
)

Get the ID of the table used by this bufrex_msg.

Return values:
id The table id, as a pointer to an internal string. It must not be deallocated by the caller. It is set to NULL when no table has been set.
Returns:
The error indicator for the function (See error.h)

dba_err bufrex_msg_query_btable ( bufrex_msg  msg,
dba_varcode  code,
dba_varinfo info 
)

Query the WMO B table used for this BUFR/CREX data.

Parameters:
msg bufrex_msg to query
code code of the variable to query. See vartable.h
Return values:
info the dba_varinfo structure with the results of the query. The returned dba_varinfo needs to be deallocated using dba_varinfo_delete()
Returns:
The error status (See error.h)

dba_err bufrex_msg_query_dtable ( bufrex_msg  msg,
dba_varcode  code,
struct _bufrex_opcode **  res 
)

Query the WMO D table used for this BUFR/CREX data.

Parameters:
msg bufrex_msg to query
code code of the entry to query. See vartable.h
res the bufrex_opcode chain that contains the expansion elements (must be deallocated by the caller using bufrex_opcode_delete)
Returns:
The error status (See error.h)

void bufrex_msg_reset ( bufrex_msg  msg  ) 

Delete all the contents of a bufrex_msg.

This can be used to reuse the structure to encode/decode more than one message.

Parameters:
msg The bufrex_msg to reset

void bufrex_msg_reset_datadesc ( bufrex_msg  msg  ) 

Reset the data descriptor section for the message.

Parameters:
msg The message to act on

dba_err crex_decoder_decode ( dba_rawmsg  in,
bufrex_msg  out 
)

Decode a CREX message.

Parameters:
in The dba_msgraw with the data to decode
out The bufrex_msg that will hold the decoded data
Return values:
opt A newly created bufr_options with informations about the decoding process. If NULL is passed, nothing will be returned. If a bufr_options is returned, it will need to be deleted with bufr_options_delete().
Returns:
The error indicator for the function. See error.h

dba_err crex_encoder_encode ( bufrex_msg  in,
dba_rawmsg  out 
)

Encode a CREX message.

Parameters:
in The bufrex_msg with the data to encode
out The dba_rawmsg that will hold the encoded data
Returns:
The error indicator for the function. See error.h


Generated on Fri Jun 22 15:33:59 2007 for libdballe-msg by  doxygen 1.5.2