IoHandler.h
Go to the documentation of this file.
1 #pragma once
2 #include <memory>
3 
6 
7 namespace lanelet {
8 using ErrorMessages = std::vector<std::string>;
9 namespace io_handlers {
13 class IOHandler { // NOLINT
14  public:
15  using Ptr = std::shared_ptr<IOHandler>;
18  virtual ~IOHandler() = default;
19 
25  static constexpr const char* extension() { return ""; }
26 
32  static constexpr const char* name() { return ""; }
33 
34  const Projector& projector() const {
35  if (projector_->origin().isDefault) {
37  }
38  return *projector_;
39  }
40 
42 
43  protected:
44  IOHandler() = default; // workaround for gcc5 bug
45 
46  private:
47  const Projector* projector_{};
48  const io::Configuration* config_{};
50 
54  virtual void handleDefaultProjector() const = 0;
55 };
56 } // namespace io_handlers
57 } // namespace lanelet
lanelet::io_handlers::IOHandler::config
io::Configuration config()
Definition: IoHandler.h:41
lanelet::ErrorMessages
std::vector< std::string > ErrorMessages
Definition: Io.h:11
lanelet::io_handlers::IOHandler::extension
static constexpr const char * extension()
returns the extension supported by this parser
Definition: IoHandler.h:25
lanelet
lanelet::io::Configuration
std::map< std::string, Attribute > Configuration
Definition: Configuration.h:8
lanelet::io_handlers::IOHandler::Ptr
std::shared_ptr< IOHandler > Ptr
Definition: IoHandler.h:15
lanelet::Projector::origin
const Origin & origin() const
Obtain the internal origin.
Definition: Projection.h:41
lanelet::io_handlers::IOHandler::IOHandler
IOHandler(const Projector &projector, const io::Configuration &config=io::Configuration())
Definition: IoHandler.h:16
lanelet::io_handlers::IOHandler::config_
const io::Configuration * config_
Definition: IoHandler.h:49
lanelet::io_handlers::IOHandler::projector_
const Projector * projector_
Definition: IoHandler.h:47
lanelet::io_handlers::IOHandler::handleDefaultProjector
virtual void handleDefaultProjector() const =0
using a default projector is not allowed. The implementations define how this issue is handled.
lanelet::Projector
Definition: Projection.h:22
lanelet::io_handlers::IOHandler::projector
const Projector & projector() const
Definition: IoHandler.h:34
lanelet::io_handlers::IOHandler::name
static constexpr const char * name()
returns the name of this handler. Must not be empty for child classes
Definition: IoHandler.h:32
lanelet::io_handlers::IOHandler::IOHandler
IOHandler()=default
lanelet::io_handlers::IOHandler::~IOHandler
virtual ~IOHandler()=default
lanelet::io_handlers::IOHandler
Base class for all handlers (writers and parsers)
Definition: IoHandler.h:13
Projection.h
lanelet::Origin::isDefault
bool isDefault
The position of the origin.
Definition: Projection.h:17
Configuration.h


lanelet2_io
Author(s): Fabian Poggenhans
autogenerated on Thu Mar 6 2025 03:26:03