]> git.tdb.fi Git - libs/core.git/blobdiff - source/pollable.h
Add files
[libs/core.git] / source / pollable.h
diff --git a/source/pollable.h b/source/pollable.h
new file mode 100644 (file)
index 0000000..46cfb23
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+This file is part of libmspframework
+Copyright © 2006 Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+#ifndef MSP_FRAMEWORK_POLLABLE_H_
+#define MSP_FRAMEWORK_POLLABLE_H_
+
+#include <sigc++/sigc++.h>
+
+namespace Msp {
+
+class Pollable
+{
+public:
+       sigc::signal<void> signal_deleted;
+
+       virtual short poll(short, int =0);
+       virtual ~Pollable() { signal_deleted.emit(); }
+protected:
+       virtual int get_fd()=0;
+
+       friend class Poller;
+};
+
+}
+
+#endif