]> git.tdb.fi Git - libs/core.git/blobdiff - source/io/serial.h
Use EventReader in Serial as well
[libs/core.git] / source / io / serial.h
index dba62fbf955e5db860f763c2a233cb3e130d75fe..39ca27ab78a4e97b353e88b3ab419f9f2e8ff426 100644 (file)
@@ -1,13 +1,14 @@
 #ifndef MSP_IO_SERIAL_H_
 #define MSP_IO_SERIAL_H_
 
-#include "base.h"
+#include "eventobject.h"
+#include "eventreader.h"
 #include "handle.h"
 
 namespace Msp {
 namespace IO {
 
-class Serial: public Base
+class Serial: public EventObject
 {
 public:
        enum Parity
@@ -19,6 +20,7 @@ public:
 
 private:
        Handle handle;
+       EventReader reader;
 
 public:
        Serial(const std::string &);
@@ -41,7 +43,7 @@ private:
        virtual unsigned do_read(char *, unsigned);
 
 public:
-       virtual const Handle &get_event_handle();
+       virtual const Handle &get_event_handle() { return reader.get_event(); }
 };
 
 } // namespace IO