General: separation of marav-io as a library
[marnav.git] / include / marnav-io / default_nmea_reader.hpp
blob47698a3d957ad4d1eb12f41ba14643cb85d8bdcb
1 #ifndef MARNAV_IO_DEFAULT_NMEA_READER_HPP
2 #define MARNAV_IO_DEFAULT_NMEA_READER_HPP
4 #include <marnav-io/nmea_reader.hpp>
6 namespace marnav
8 namespace io
10 /// This is a very simple NMEA sentence reader, meant for synchronous
11 /// and single threaded reading from a serial port or a device.
12 ///
13 /// @example nmea_multiplexer.cpp
14 class default_nmea_reader : public nmea_reader
16 public:
17 virtual ~default_nmea_reader();
19 default_nmea_reader() = delete;
20 default_nmea_reader(std::unique_ptr<device> &&);
21 default_nmea_reader(const default_nmea_reader &) = delete;
22 default_nmea_reader(default_nmea_reader &&) = default;
24 default_nmea_reader & operator=(const default_nmea_reader &) = delete;
25 default_nmea_reader & operator=(default_nmea_reader &&) = default;
27 bool read_sentence(std::string & s);
29 protected:
30 virtual void process_sentence(const std::string & s) override;
32 private:
33 bool received_;
34 std::string sentence_;
39 #endif