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

Message importer interface. More...

#include <importer.h>

Inheritance diagram for dballe::Importer:
dballe::BulletinImporter dballe::impl::msg::JsonImporter dballe::impl::msg::WRImporter dballe::impl::msg::BufrImporter dballe::impl::msg::CrexImporter

Public Member Functions

 Importer (const Importer &)=delete
 
 Importer (Importer &&)=delete
 
Importeroperator= (const Importer &)=delete
 
Importeroperator= (Importer &&)=delete
 
virtual Encoding encoding () const =0
 Return the encoding for this importer.
 
std::vector< std::shared_ptr< Message > > from_binary (const BinaryMessage &msg) const
 Decode a message from its raw encoded representation. More...
 
virtual std::vector< std::shared_ptr< Message > > from_bulletin (const wreport::Bulletin &msg) const
 Import a decoded BUFR/CREX message.
 
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. More...
 

Static Public Member Functions

static std::unique_ptr< Importercreate (Encoding type, const ImporterOptions &opts=ImporterOptions::defaults)
 Instantiate an importer. More...
 
static std::unique_ptr< Importercreate (Encoding type, const std::string &opts)
 Instantiate an importer. More...
 

Protected Member Functions

 Importer (const ImporterOptions &opts)
 

Protected Attributes

ImporterOptions opts
 

Detailed Description

Message importer interface.

Member Function Documentation

◆ create() [1/2]

static std::unique_ptr<Importer> dballe::Importer::create ( Encoding  type,
const ImporterOptions opts = ImporterOptions::defaults 
)
static

Instantiate an importer.

Parameters
typeThe input file type
optsOptions controlling import behaviour

◆ create() [2/2]

static std::unique_ptr<Importer> dballe::Importer::create ( Encoding  type,
const std::string &  opts 
)
static

Instantiate an importer.

Parameters
typeThe input file type
optsOptions controlling import behaviour

◆ foreach_decoded()

virtual bool dballe::Importer::foreach_decoded ( const BinaryMessage msg,
std::function< bool(std::shared_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.
destThe function that consumes the decoded messages.
Returns
true if it got to the end of decoding, false if dest returned false.

◆ from_binary()

std::vector<std::shared_ptr<Message> > dballe::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: