]> git.saurik.com Git - wxWidgets.git/blob - include/wx/unix/private/epolldispatcher.h
don't include wx/unix/private/timer.h from evtloop.h, it's only needed in .cpp
[wxWidgets.git] / include / wx / unix / private / epolldispatcher.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/private/epolldispatcher.h
3 // Purpose: wxEpollDispatcher class
4 // Authors: Lukasz Michalski
5 // Created: April 2007
6 // Copyright: (c) Lukasz Michalski
7 // RCS-ID: $Id$
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_PRIVATE_EPOLLDISPATCHER_H_
12 #define _WX_PRIVATE_EPOLLDISPATCHER_H_
13
14 #include "wx/defs.h"
15
16 #ifdef HAVE_SYS_EPOLL_H
17
18 #include "wx/private/fdiodispatcher.h"
19
20 class WXDLLIMPEXP_CORE wxEpollDispatcher : public wxFDIODispatcher
21 {
22 public:
23 // get pointer to the unique instance of this class, can return NULL if
24 // epoll() is not supported on this system
25 //
26 // do not delete the returned pointer
27 static wxEpollDispatcher *Get();
28
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);
34
35 private:
36 // ctor is private, use Get()
37 wxEpollDispatcher();
38
39 // return true if the object was successfully initialized
40 bool IsOk() const { return m_epollDescriptor != -1; }
41
42 int m_epollDescriptor;
43 };
44
45 #endif // HAVE_SYS_EPOLL_H
46
47 #endif // _WX_PRIVATE_SOCKETEVTDISPATCH_H_