Class WriterFactory

Class Documentation

class WriterFactory

Factory class for all supported lanelet map writers.

Public Types

using WriterCreationFcn = std::function<Writer*(const Projector&, const io::Configuration&)>

Public Static Functions

static WriterFactory &instance()
static Writer::Ptr create(const std::string &writerName, const Projector &projector, const io::Configuration &config = io::Configuration())

creates a writer that matches the given name.

Parameters:
  • writerName – name of the writer (one of availableParsers())

  • projector – projection object passed to the writer

  • config – config object passed to the writer

Throws:

a – lanelet2::UnsupportedIOHandlerError if handler is not registered

Returns:

created writer

static Writer::Ptr createFromExtension(const std::string &extension, const Projector &projector, const io::Configuration &config = io::Configuration())

creates a matching writer for the given file extension

Parameters:
  • extension – extension to look for (including the dot!)

  • projector – projection object passed to the writer

  • config – config object passed to the writer

Throws:

a – lanelet2::UnsupportedExtensionError if extension is not registered

Returns:

created writer

static std::vector<std::string> availableWriters()

returns all available writers as vector

Returns:

vector of writer names

static std::vector<std::string> availableExtensions()

returns all available extensions as vector

Returns:

vector of extensions (including the dot)

Friends

friend class RegisterWriter