uThreads  0.3.0
EpollIOHandler.h
1 /*
2  * EpollIOHandler.h
3  *
4  * Created on: May 20, 2016
5  * Author: saman
6  */
7 
8 #ifndef SRC_IO_EPOLLIOHANDLER_H_
9 #define SRC_IO_EPOLLIOHANDLER_H_
10 
11 
12 /* epoll wrapper */
13 class IOPoller {
14  friend IOHandler;
15 private:
16  static const int MAXEVENTS = 32;//Maximum number of events this thread can monitor, TODO: do we want this to be modified?
17  int epoll_fd = -1;
18  struct epoll_event* events;
19  IOHandler& ioh;
20 
21  int _Open(int fd, PollData& pd);
22  int _Close(int fd);
23  ssize_t _Poll(int timeout);
24 
25 protected:
26  IOPoller(IOHandler&);
27  virtual ~IOPoller();
28 };
29 
30 
31 
32 #endif /* SRC_IO_EPOLLIOHANDLER_H_ */
Definition: EpollIOHandler.h:13