libdballe  6.8
conversion.h
1 /*
2  * Copyright (C) 2005--2013 ARPA-SIM <urpsim@smr.arpa.emr.it>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * Author: Enrico Zini <enrico@enricozini.com>
18  */
19 
20 #ifndef CONVERSION_H
21 #define CONVERSION_H
22 
23 #if 0
24 #include <dballe/core/file.h>
25 #include <dballe/core/rawmsg.h>
26 #include <dballe/msg/msgs.h>
27 #include <dballe/bufrex/msg.h>
28 #endif
29 #include <dballe/cmdline/processor.h>
30 
31 namespace wreport {
32 struct Bulletin;
33 }
34 
35 namespace dballe {
36 struct File;
37 
38 namespace msg {
39 struct Importer;
40 struct Exporter;
41 }
42 
43 namespace cmdline {
44 
45 struct Converter : public Action
46 {
47  File* file;
48  const char* dest_rep_memo;
49  const char* dest_template;
50  bool bufr2netcdf_categories;
51 
52  msg::Exporter* exporter;
53 
54  Converter() : file(0), dest_rep_memo(0), dest_template(0), bufr2netcdf_categories(false), exporter(0) {}
55  ~Converter();
56 
61  virtual bool operator()(const cmdline::Item& item);
62 
63 protected:
70  void process_bufrex_msg(const Rawmsg& orig, const wreport::Bulletin& msg);
71 
76  void process_dba_msg(const Rawmsg& orig, const Msgs& msgs);
77 
82  void process_dba_msg_from_bulletin(const Rawmsg& orig, const wreport::Bulletin& bulletin, const Msgs& msgs);
83 };
84 
85 }
86 }
87 
88 #endif
void process_dba_msg(const Rawmsg &orig, const Msgs &msgs)
Perform conversion of decoded data, auto-inferring type/subtype/localsubtype from the Msgs contents...
Definition: processor.h:117
File I/O for files containing meterorological messages.
Definition: cmdline.h:34
void process_bufrex_msg(const Rawmsg &orig, const wreport::Bulletin &msg)
Perform conversion at the encoding level only (e.g.
Definition: processor.h:100
Definition: file.h:46
In-memory storage of an encoded weather report.
Definition: conversion.h:31
Dynamic array of dba_msg.
Definition: msgs.h:38
Annotated string buffer for encoded messages.
Definition: rawmsg.h:38
void process_dba_msg_from_bulletin(const Rawmsg &orig, const wreport::Bulletin &bulletin, const Msgs &msgs)
Perform conversion of decded data, using the original bulletin for type/subtype/localsubtype informat...
Definition: conversion.h:45
virtual bool operator()(const cmdline::Item &item)
Convert the item as configured in the Converter, and write it to the output file. ...
Message exporter.
Definition: codec.h:111
Dynamic array of dba_msg.