#include <sigc++/sigc++.h>
#include "mode.h"
#include "poll.h"
-#include "types.h"
namespace Msp {
namespace IO {
+struct Handle;
+
/**
Common interface for all I/O objects.
Mode get_mode() const { return mode; }
protected:
- virtual unsigned do_write(const char *, unsigned) =0;
- virtual unsigned do_read(char *, unsigned) =0;
+ virtual unsigned do_write(const char *, unsigned) = 0;
+ virtual unsigned do_read(char *, unsigned) = 0;
public:
/** Writes data from a buffer. Subject to blocking. Returns the number of
/** Returns a handle for polling. Should throw if the object does not have
an event handle. */
- virtual Handle get_event_handle() =0;
+ virtual const Handle &get_event_handle() = 0;
/** Notifies the object of an event. Used by EventDispatcher. */
void event(PollEvent);