libdballe  7.21
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
dballe::msg::Importer Class Referenceabstract

Message importer. More...

#include <codec.h>

Inheritance diagram for dballe::msg::Importer:
dballe::msg::AOFImporter dballe::msg::WRImporter dballe::msg::BufrImporter dballe::msg::CrexImporter

Classes

struct  Options
 

Public Member Functions

 Importer (const Options &opts)
 
Messages from_binary (const BinaryMessage &msg) const
 Decode a message from its raw encoded representation. More...
 
virtual bool foreach_decoded (const BinaryMessage &msg, std::function< bool(std::unique_ptr< Message > &&)> dest) const =0
 Decode a message from its raw encoded representation, calling dest on each resulting Message. More...
 
virtual Messages from_bulletin (const wreport::Bulletin &msg) const =0
 Import a decoded BUFR/CREX message.
 

Static Public Member Functions

static std::unique_ptr< Importercreate (File::Encoding type, const Options &opts=Options())
 Instantiate the right importer for the given type.
 

Protected Attributes

Options opts
 

Detailed Description

Message importer.

This class is designed like a configurable virtual functor.

Importers of various kinds can provide their implementations.

Member Function Documentation

◆ foreach_decoded()

virtual bool dballe::msg::Importer::foreach_decoded ( const BinaryMessage msg,
std::function< bool(std::unique_ptr< Message > &&)>  dest 
) const
pure virtual

Decode a message from its raw encoded representation, calling dest on each resulting Message.

Return false from dest to stop decoding.

Parameters
msgEncoded message.
Return values
destThe function that consumes the decoded messages.
Returns
true if it got to the end of decoding, false if dest returned false.

Implemented in dballe::msg::AOFImporter, dballe::msg::CrexImporter, and dballe::msg::BufrImporter.

◆ from_binary()

Messages dballe::msg::Importer::from_binary ( const BinaryMessage msg) const

Decode a message from its raw encoded representation.

Parameters
msgEncoded message
Return values
msgsThe resulting Messages

The documentation for this class was generated from the following file: