libdballe  9.14
conversion.h
1 #ifndef DBALLE_CMDLINE_CONVERSION_H
2 #define DBALLE_CMDLINE_CONVERSION_H
3 
4 #include <dballe/cmdline/processor.h>
5 
6 namespace wreport {
7 struct Bulletin;
8 }
9 
10 namespace dballe {
11 struct File;
12 
13 namespace cmdline {
14 
15 struct Converter : public Action
16 {
17  File* file = nullptr;
18  const char* dest_rep_memo = nullptr;
19  const char* dest_template = nullptr;
20  bool bufr2netcdf_categories = false;
21 
22  Converter() {}
23  ~Converter();
24 
25  void set_exporter(dballe::Encoding encoding,
26  const impl::ExporterOptions& opts);
27 
32  bool operator()(const cmdline::Item& item) override;
33 
34 protected:
35  Exporter* exporter = nullptr;
36  const BulletinExporter* bexporter = nullptr;
37 
47  void process_bufrex_msg(const BinaryMessage& orig,
48  const wreport::Bulletin& msg);
49 
54  void
55  process_dba_msg(const BinaryMessage& orig,
56  const std::vector<std::shared_ptr<dballe::Message>>& msgs);
57 
63  const BinaryMessage& orig, const wreport::Bulletin& bulletin,
64  const std::vector<std::shared_ptr<dballe::Message>>& msgs);
65 };
66 
67 } // namespace cmdline
68 } // namespace dballe
69 
70 #endif
Binary message.
Definition: file.h:134
Definition: processor.h:108
void process_bufrex_msg(const BinaryMessage &orig, const wreport::Bulletin &msg)
Perform conversion at the encoding level only (e.g.
Message exporter interface.
Definition: exporter.h:64
Definition: cmdline.h:18
void process_dba_msg_from_bulletin(const BinaryMessage &orig, const wreport::Bulletin &bulletin, const std::vector< std::shared_ptr< dballe::Message >> &msgs)
Perform conversion of decded data, using the original bulletin for type/subtype/localsubtype informat...
Definition: processor.h:88
File object for doing I/O on binary message streams.
Definition: file.h:17
bool operator()(const cmdline::Item &item) override
Convert the item as configured in the Converter, and write it to the output file. ...
void process_dba_msg(const BinaryMessage &orig, const std::vector< std::shared_ptr< dballe::Message >> &msgs)
Perform conversion of decoded data, auto-inferring type/subtype/localsubtype from the Messages conten...
Definition: conversion.h:15
ExporterOptions with default constructor usable.
Definition: msg.h:38
Definition: exporter.h:110