libdballe 9.6
conversion.h
1#ifndef DBALLE_CMDLINE_CONVERSION_H
2#define DBALLE_CMDLINE_CONVERSION_H
3
4#include <dballe/cmdline/processor.h>
5
6namespace wreport {
7struct Bulletin;
8}
9
10namespace dballe {
11struct File;
12
13namespace cmdline {
14
15struct 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 virtual bool operator()(const cmdline::Item& item);
32
33protected:
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:131
Definition: exporter.h:110
Message exporter interface.
Definition: exporter.h:67
File object for doing I/O on binary message streams.
Definition: file.h:18
Definition: processor.h:119
Definition: conversion.h:16
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...
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...
virtual bool operator()(const cmdline::Item &item)
Convert the item as configured in the Converter, and write it to the output file.
void process_bufrex_msg(const BinaryMessage &orig, const wreport::Bulletin &msg)
Perform conversion at the encoding level only (e.g.
Definition: processor.h:99
ExporterOptions with default constructor usable.
Definition: msg.h:39