1#ifndef DBALLE_EXPORTER_H
2#define DBALLE_EXPORTER_H
47 static std::unique_ptr<ExporterOptions>
create();
51 friend class Exporter;
74 Exporter(
const Exporter&) =
delete;
75 Exporter(Exporter&&) =
delete;
78 Exporter& operator=(
const Exporter&) =
delete;
79 Exporter& operator=(Exporter&&) =
delete;
89 virtual std::string
to_binary(
const std::vector<std::shared_ptr<Message>>& messages)
const = 0;
94 virtual std::unique_ptr<wreport::Bulletin>
to_bulletin(
const std::vector<std::shared_ptr<Message>>& msgs)
const;
112 using Exporter::Exporter;
117 std::unique_ptr<wreport::Bulletin>
to_bulletin(
const std::vector<std::shared_ptr<Message>>& msgs)
const override = 0;
Definition exporter.h:110
std::unique_ptr< wreport::Bulletin > to_bulletin(const std::vector< std::shared_ptr< Message > > &msgs) const override=0
Export to a Bulletin.
Options to control message export.
Definition exporter.h:25
std::string to_string() const
Generate a string summary of export options.
std::string template_name
Name of template to use for output (leave empty to autodetect)
Definition exporter.h:28
int centre
Originating centre.
Definition exporter.h:30
int subcentre
Originating subcentre.
Definition exporter.h:32
ExporterOptions()=default
Create new Options initialised with default values.
int application
Originating application ID.
Definition exporter.h:34
static std::unique_ptr< ExporterOptions > create()
Create with default values.
void print(FILE *out)
Print a summary of the options to out.
virtual std::string to_binary(const std::vector< std::shared_ptr< Message > > &messages) const =0
Encode a message.
static std::unique_ptr< Exporter > create(Encoding type, const ExporterOptions &opts=ExporterOptions::defaults)
Instantiate the right importer for the given type.
virtual std::unique_ptr< wreport::Bulletin > to_bulletin(const std::vector< std::shared_ptr< Message > > &msgs) const
Export to a Bulletin.
virtual std::unique_ptr< wreport::Bulletin > make_bulletin() const
Create a bulletin that works with this exporter.