1 #ifndef DBALLE_MSG_WR_CODEC_H 2 #define DBALLE_MSG_WR_CODEC_H 4 #include <dballe/importer.h> 5 #include <dballe/exporter.h> 6 #include <dballe/core/fwd.h> 7 #include <dballe/msg/msg.h> 31 std::vector<std::shared_ptr<dballe::Message>> from_bulletin(
const wreport::Bulletin& msg)
const override;
45 bool foreach_decoded_bulletin(
const wreport::Bulletin& msg, std::function<
bool(std::unique_ptr<dballe::Message>)> dest)
const;
54 Encoding
encoding()
const override {
return Encoding::BUFR; }
56 bool foreach_decoded(
const BinaryMessage& msg, std::function<
bool(std::unique_ptr<dballe::Message>)> dest)
const override;
65 Encoding
encoding()
const override {
return Encoding::CREX; }
67 bool foreach_decoded(
const BinaryMessage& msg, std::function<
bool(std::unique_ptr<dballe::Message>)> dest)
const override;
82 std::unique_ptr<wreport::Bulletin> to_bulletin(
const std::vector<std::shared_ptr<dballe::Message>>& msgs)
const override;
87 std::unique_ptr<wr::Template> infer_template(
const Messages& msgs)
const;
96 virtual std::string to_binary(
const Messages& msgs)
const;
97 virtual std::unique_ptr<wreport::Bulletin> make_bulletin()
const;
106 virtual std::string to_binary(
const Messages& msgs)
const;
107 virtual std::unique_ptr<wreport::Bulletin> make_bulletin()
const;
112 struct TemplateRegistry;
134 void do_ecmwf_past_wtr()
const;
135 void do_station_height()
const;
137 void do_D01001()
const;
138 void do_D01004()
const;
140 void do_D01011()
const;
142 int do_D01012()
const;
144 void do_D01013()
const;
146 void do_D01021()
const;
147 void do_D01022()
const;
149 void do_D01023()
const;
153 const Messages& msgs;
159 : opts(opts), msgs(msgs) {}
162 virtual const char* name()
const = 0;
163 virtual const char* description()
const = 0;
169 typedef std::function<std::unique_ptr<Template>(
const dballe::ExporterOptions& opts,
const Messages& msgs)> factory_func;
171 unsigned data_category = MISSING_INT;
173 std::string description;
174 factory_func factory;
176 TemplateFactory(
unsigned data_category, std::string name, std::string description, factory_func factory)
177 : data_category(data_category), name(name), description(description), factory(factory) {}
185 void register_factory(
186 unsigned data_category,
187 const std::string& name,
188 const std::string& desc,
189 TemplateFactory::factory_func fac);
Binary message.
Definition: file.h:130
Definition: wr_codec.h:23
Message importer interface.
Definition: importer.h:62
Definition: wr_codec.h:167
Definition: wr_codec.h:114
Information on how a value has been sampled or computed with regards to time.
Definition: types.h:686
Message exporter interface.
Definition: exporter.h:66
Options to control message export.
Definition: exporter.h:24
Definition: wr_codec.h:48
Definition: wr_codec.h:59
Options to control message import.
Definition: importer.h:24
Encoding encoding() const override
Return the encoding for this importer.
Definition: wr_codec.h:65
Vertical level or layer.
Definition: types.h:624
Store an array of physical data all on the same level.
Definition: context.h:23
Definition: wr_codec.h:90
Definition: shortcuts.h:11
static const ImporterOptions defaults
Default importer options.
Definition: importer.h:45
Definition: wr_codec.h:100
Definition: wr_codec.h:180
Storage for related physical data.
Definition: msg.h:130
Encoding encoding() const override
Return the encoding for this importer.
Definition: wr_codec.h:54
Collection of Value objects, indexed by wreport::Varcode.
Definition: values.h:176
Definition: wr_codec.h:74