1 #ifndef DBALLE_IMPORTER_H 2 #define DBALLE_IMPORTER_H 5 #include <dballe/fwd.h> 27 bool simplified =
true;
29 enum class DomainErrors {
34 } domain_errors = DomainErrors::THROW;
40 void print(FILE* out);
46 static std::unique_ptr<ImporterOptions>
create();
49 static std::unique_ptr<ImporterOptions>
create(
const std::string& s);
86 virtual Encoding
encoding()
const = 0;
96 std::vector<std::shared_ptr<Message>>
102 virtual std::vector<std::shared_ptr<Message>>
120 std::function<
bool(std::shared_ptr<Message>)> dest)
const = 0;
130 static std::unique_ptr<Importer>
142 static std::unique_ptr<Importer>
create(Encoding type,
143 const std::string& opts);
149 using Importer::Importer;
154 std::vector<std::shared_ptr<Message>>
std::vector< std::shared_ptr< Message > > from_binary(const BinaryMessage &msg) const
Decode a message from its raw encoded representation.
Binary message.
Definition: file.h:134
void print(FILE *out)
Print a summary of the options to out.
virtual std::vector< std::shared_ptr< Message > > from_bulletin(const wreport::Bulletin &msg) const
Import a decoded BUFR/CREX message.
Message importer interface.
Definition: importer.h:68
static std::unique_ptr< ImporterOptions > create()
Create with default values.
Definition: importer.h:146
static std::unique_ptr< Importer > create(Encoding type, const ImporterOptions &opts=ImporterOptions::defaults)
Instantiate an importer.
Options to control message import.
Definition: importer.h:24
std::string to_string() const
Generate a string summary of import options.
virtual Encoding encoding() const =0
Return the encoding for this importer.
static const ImporterOptions defaults
Default importer options.
Definition: importer.h:52
virtual bool foreach_decoded(const BinaryMessage &msg, std::function< bool(std::shared_ptr< Message >)> dest) const =0
Decode a message from its raw encoded representation, calling dest on each resulting Message...
std::vector< std::shared_ptr< Message > > from_bulletin(const wreport::Bulletin &msg) const override=0
Import a decoded BUFR/CREX message.