exporters.h

00001 /*
00002  * DB-ALLe - Archive for punctual meteorological data
00003  *
00004  * Copyright (C) 2005,2006  ARPA-SIM <urpsim@smr.arpa.emr.it>
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00018  *
00019  * Author: Enrico Zini <enrico@enricozini.com>
00020  */
00021 
00022 #ifndef BUFREX_EXPORTERS_H
00023 #define BUFREX_EXPORTERS_H
00024 
00025 #ifdef  __cplusplus
00026 extern "C" {
00027 #endif
00028 
00029 #include <dballe/core/var.h>
00030 #include <dballe/msg/msg.h>
00031 #include <dballe/bufrex/msg.h>
00032 
00033 struct _bufrex_exporter;
00034     
00035 /*
00036  * Type can be:
00037  *  0: encode a BUFR
00038  *  1: encode a CREX
00039  * TODO: replace with the enum from bufrex_msg
00040  */
00041 
00045 typedef dba_err (*bufrex_exporter_func)(dba_msg src, bufrex_msg bmsg, bufrex_subset dst, int type);
00046 
00050 typedef dba_err (*bufrex_datadesc_func)(struct _bufrex_exporter* exp, dba_msg src, bufrex_msg dst);
00051 
00055 struct _bufrex_exporter
00056 {
00058     int type;
00060     int subtype;
00061 
00063     dba_msg_type accept_type;
00064 
00066     dba_varcode* ddesc;
00067 
00069     bufrex_datadesc_func datadesc;
00070 
00072     bufrex_exporter_func exporter;
00073 };
00075 typedef struct _bufrex_exporter* bufrex_exporter;
00076 
00080 dba_err bufrex_standard_datadesc_func(bufrex_exporter exp, dba_msg src, bufrex_msg dst);
00081 
00085 dba_err bufrex_infer_type_subtype(dba_msg msg, int* type, int* subtype);
00086 
00091 dba_err bufrex_get_exporter(dba_msg src, int type, int subtype, bufrex_exporter* exp);
00092 
00094 #define ORIG_CENTRE_ID 255
00095 
00096 #define ORIG_APP_ID 0
00097 
00098 #ifdef  __cplusplus
00099 }
00100 #endif
00101 
00102 /* vim:set ts=4 sw=4: */
00103 #endif

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