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>;
17  : projector_{&projector}, config_{&config} {}
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
virtual void handleDefaultProjector() const =0
using a default projector is not allowed. The implementations define how this issue is handled...
Base class for all handlers (writers and parsers)
Definition: IoHandler.h:13
std::vector< std::string > ErrorMessages
Definition: Io.h:11
static constexpr const char * name()
returns the name of this handler. Must not be empty for child classes
Definition: IoHandler.h:32
io::Configuration config()
Definition: IoHandler.h:41
const Projector * projector_
Definition: IoHandler.h:47
std::map< std::string, Attribute > Configuration
Definition: Configuration.h:8
bool isDefault
The position of the origin.
Definition: Projection.h:17
const io::Configuration * config_
Definition: IoHandler.h:49
const Projector & projector() const
Definition: IoHandler.h:34
IOHandler(const Projector &projector, const io::Configuration &config=io::Configuration())
Definition: IoHandler.h:16
static constexpr const char * extension()
returns the extension supported by this parser
Definition: IoHandler.h:25
const Origin & origin() const
Obtain the internal origin.
Definition: Projection.h:41
std::shared_ptr< IOHandler > Ptr
Definition: IoHandler.h:15


lanelet2_io
Author(s): Fabian Poggenhans
autogenerated on Tue Jun 6 2023 02:23:45