#include "wx/defs.h"
+#if wxUSE_SELECT_DISPATCHER
+
+#ifdef __WATCOMC__
+ #include <types.h>
+ #include <sys/ioctl.h>
+ #include <sys/time.h>
+ #include <sys/select.h>
+ #include <tcpustd.h>
+#else
+ #include <sys/types.h>
+#endif
+
#include "wx/private/fdiodispatcher.h"
// helper class storing all the select() fd sets
// same as SetFD() except it unsets the bits set in the flags for the given
// fd
- bool ClearFD(int fd, int flags)
+ bool ClearFD(int fd)
{
- return SetFD(fd, wxFDIO_ALL & ~flags);
+ return SetFD(fd, 0);
}
static Callback ms_handlers[Max];
};
-class WXDLLIMPEXP_BASE wxSelectDispatcher : public wxFDIODispatcher
+class WXDLLIMPEXP_BASE wxSelectDispatcher : public wxMappedFDIODispatcher
{
public:
- // returns the unique instance of this class, the pointer shouldn't be
- // deleted and is normally never NULL
- static wxSelectDispatcher *Get();
-
- // if we have any registered handlers, check for any pending events to them
- // and dispatch them -- this is used from wxX11 and wxDFB event loops
- // implementation
- static void DispatchPending();
+ // default ctor
+ wxSelectDispatcher() { m_maxFD = -1; }
// implement pure virtual methods of the base class
virtual bool RegisterFD(int fd, wxFDIOHandler *handler, int flags = wxFDIO_ALL);
virtual bool ModifyFD(int fd, wxFDIOHandler *handler, int flags = wxFDIO_ALL);
- virtual wxFDIOHandler *UnregisterFD(int fd, int flags = wxFDIO_ALL);
- virtual void RunLoop(int timeout = TIMEOUT_INFINITE);
-
-protected:
- wxSelectDispatcher();
+ virtual bool UnregisterFD(int fd);
+ virtual void Dispatch(int timeout = TIMEOUT_INFINITE);
private:
// common part of RegisterFD() and ModifyFD()
int m_maxFD;
};
+#endif // wxUSE_SELECT_DISPATCHER
#endif // _WX_PRIVATE_SOCKETEVTDISPATCH_H_