libdballe  9.11
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, const impl::ExporterOptions& opts);
26 
31  bool operator()(const cmdline::Item& item) override;
32 
33 protected:
34  Exporter* exporter = nullptr;
35  const BulletinExporter* bexporter = nullptr;
36 
45  void process_bufrex_msg(const BinaryMessage& orig, const wreport::Bulletin& msg);
46 
51  void process_dba_msg(const BinaryMessage& orig, const std::vector<std::shared_ptr<dballe::Message>>& msgs);
52 
57  void process_dba_msg_from_bulletin(const BinaryMessage& orig, const wreport::Bulletin& bulletin, const std::vector<std::shared_ptr<dballe::Message>>& msgs);
58 };
59 
60 }
61 }
62 
63 #endif
Binary message.
Definition: file.h:130
Definition: processor.h:118
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:66
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:98
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:109