1 #ifndef DBALLE_MSG_WR_CODEC_H
2 #define DBALLE_MSG_WR_CODEC_H
92 virtual std::unique_ptr<wreport::Bulletin>
make_bulletin()
const;
102 virtual std::unique_ptr<wreport::Bulletin>
make_bulletin()
const;
107 struct TemplateRegistry;
127 void do_ecmwf_past_wtr()
const;
128 void do_station_height()
const;
130 void do_D01001()
const;
131 void do_D01004()
const;
133 void do_D01011()
const;
135 int do_D01012()
const;
137 void do_D01013()
const;
139 void do_D01021()
const;
140 void do_D01022()
const;
142 void do_D01023()
const;
153 : opts(opts), msgs(msgs) {}
156 virtual const char* name()
const = 0;
157 virtual const char* description()
const = 0;
165 unsigned data_category = MISSING_INT;
167 std::string description;
168 factory_func factory;
170 TemplateFactory(
unsigned data_category, std::string name, std::string description, factory_func factory)
171 : data_category(data_category), name(name), description(description), factory(factory) {}
179 void register_factory(
180 unsigned data_category,
181 const std::string& name,
182 const std::string& desc,
183 TemplateFactory::factory_func fac);
Store an array of physical data all on the same level.
Definition: context.h:44
bool foreach_decoded(const BinaryMessage &msg, std::function< bool(std::unique_ptr< Message > &&)> dest) const override
Decode a message from its raw encoded representation, calling dest on each resulting Message...
Definition: wr_codec.h:161
Definition: wr_codec.h:22
virtual std::unique_ptr< wreport::Bulletin > make_bulletin() const
Create a bulletin that works with this exporter.
Storage for related physical data.
Definition: msg.h:70
virtual std::string to_binary(const Messages &msgs) const
Encode a message.
Information on how a value has been sampled or computed with regards to time.
Definition: types.h:587
Message importer.
Definition: codec.h:33
bool foreach_decoded_bulletin(const wreport::Bulletin &msg, std::function< bool(std::unique_ptr< Message > &&)> dest) const
Build Message objects a decoded bulletin, calling dest on each resulting Message. ...
Definition: wr_codec.h:174
Vertical level or layer.
Definition: types.h:532
Definition: wr_codec.h:109
Messages from_bulletin(const wreport::Bulletin &msg) const override
Import a decoded BUFR/CREX message.
virtual std::unique_ptr< wreport::Bulletin > make_bulletin() const
Create a bulletin that works with this exporter.
Binary message.
Definition: file.h:132
Definition: wr_codec.h:56
Ordered collection of messages.
Definition: message.h:67
Definition: wr_codec.h:95
Definition: wr_codec.h:47
Definition: wr_codec.h:85
bool foreach_decoded(const BinaryMessage &msg, std::function< bool(std::unique_ptr< Message > &&)> dest) const override
Decode a message from its raw encoded representation, calling dest on each resulting Message...
std::unique_ptr< wreport::Bulletin > to_bulletin(const Messages &msgs) const override
Import a decoded BUFR/CREX message.
Message exporter.
Definition: codec.h:105
Definition: wr_codec.h:69
virtual std::string to_binary(const Messages &msgs) const
Encode a message.
const wreport::Var * find_station_var(wreport::Varcode code) const
Find a variable in c_station, or nullptr if not found.
std::unique_ptr< wr::Template > infer_template(const Messages &msgs) const
Infer a template name from the message contents.