1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/private/epolldispatcher.h
3 // Purpose: wxEpollDispatcher class
4 // Authors: Lukasz Michalski
6 // Copyright: (c) Lukasz Michalski
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_PRIVATE_EPOLLDISPATCHER_H_
12 #define _WX_PRIVATE_EPOLLDISPATCHER_H_
16 #ifdef HAVE_SYS_EPOLL_H
18 #include "wx/private/fdiodispatcher.h"
20 class WXDLLIMPEXP_CORE wxEpollDispatcher
: public wxFDIODispatcher
23 // get pointer to the unique instance of this class, can return NULL if
24 // epoll() is not supported on this system
26 // do not delete the returned pointer
27 static wxEpollDispatcher
*Get();
29 // implement base class pure virtual methods
30 virtual bool RegisterFD(int fd
, wxFDIOHandler
* handler
, int flags
= wxFDIO_ALL
);
31 virtual bool ModifyFD(int fd
, wxFDIOHandler
* handler
, int flags
= wxFDIO_ALL
);
32 virtual bool UnregisterFD(int fd
, int flags
= wxFDIO_ALL
);
33 virtual void RunLoop(int timeout
= TIMEOUT_INFINITE
);
36 // ctor is private, use Get()
39 // return true if the object was successfully initialized
40 bool IsOk() const { return m_epollDescriptor
!= -1; }
42 int m_epollDescriptor
;
45 #endif // HAVE_SYS_EPOLL_H
47 #endif // _WX_PRIVATE_SOCKETEVTDISPATCH_H_