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 wxUSE_EPOLL_DISPATCHER
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
);
33 virtual void Dispatch(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 // wxUSE_EPOLL_DISPATCHER
47 #endif // _WX_PRIVATE_SOCKETEVTDISPATCH_H_