Go to the documentation of this file.
6 namespace io_handlers {
8 std::string format(
const std::vector<std::string>& strings,
const std::string& delim =
", ") {
10 for (
const auto& str : strings) {
11 if (!formatted.empty()) {
26 auto it = inst.
registry_.find(parserName);
28 auto newObj = std::shared_ptr<Parser>(it->second(projector, config));
40 auto newObj = std::shared_ptr<Parser>(it->second(projector, config));
48 std::vector<std::string> parsers;
50 parsers.push_back(parser.first);
52 std::sort(parsers.begin(), parsers.end());
57 std::vector<std::string> extensions;
59 extensions.push_back(parser.first);
61 std::sort(extensions.begin(), extensions.end());
73 if (!extension.empty()) {
84 auto it = inst.
registry_.find(writerName);
86 auto newObj = std::shared_ptr<Writer>(it->second(projector, config));
98 auto newObj = std::shared_ptr<Writer>(it->second(projector, config));
106 std::vector<std::string> writers;
108 writers.push_back(
writer.first);
110 std::sort(writers.begin(), writers.end());
115 std::vector<std::string> extensions;
117 extensions.push_back(
writer.first);
119 std::sort(extensions.begin(), extensions.end());
131 if (!extension.empty()) {
static std::vector< std::string > availableExtensions()
returns all available extensions as vector
std::map< std::string, WriterCreationFcn > extensionRegistry_
std::map< std::string, WriterCreationFcn > registry_
Error for an unsupported extension.
std::function< Parser *(const Projector &, const io::Configuration &)> ParserCreationFcn
static std::vector< std::string > availableParsers()
returns all available parsers as vector
static Parser::Ptr createFromExtension(const std::string &extension, const Projector &projector, const io::Configuration &config=io::Configuration())
creates a matching parser for the given file extension
Factory class for all suppored lanelet map parsers.
std::map< std::string, Attribute > Configuration
void registerParser(const std::string &strategy, const std::string &extension, const ParserCreationFcn &factoryFunction)
std::function< Writer *(const Projector &, const io::Configuration &)> WriterCreationFcn
Factory class for all supported lanelet map writers.
std::map< std::string, ParserCreationFcn > extensionRegistry_
static WriterFactory & instance()
std::map< std::string, ParserCreationFcn > registry_
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.
static ParserFactory & instance()
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
static Parser::Ptr create(const std::string &parserName, const Projector &projector, const io::Configuration &config=io::Configuration())
creates a parser that matches the given name.
std::shared_ptr< Parser > Ptr
Error thrown if an unsupported handler (parser/writer) has been specified.
static std::vector< std::string > availableExtensions()
returns all available extensions as vector
std::shared_ptr< Writer > Ptr
void registerWriter(const std::string &strategy, const std::string &extension, const WriterCreationFcn &factoryFunction)
static std::vector< std::string > availableWriters()
returns all available writers as vector
lanelet2_io
Author(s): Fabian Poggenhans
autogenerated on Thu Mar 6 2025 03:26:03