Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame] | 1 | /** |
Jon Medhurst | b1d0744 | 2015-05-08 12:04:18 +0100 | [diff] [blame] | 2 | * Copyright (C) ARM Limited 2013-2015. All rights reserved. |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame] | 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | */ |
| 8 | |
| 9 | #ifndef MONITOR_H |
| 10 | #define MONITOR_H |
| 11 | |
| 12 | #include <sys/epoll.h> |
| 13 | |
| 14 | class Monitor { |
| 15 | public: |
| 16 | Monitor(); |
| 17 | ~Monitor(); |
| 18 | |
Jon Medhurst | e31266f | 2014-08-04 15:47:44 +0100 | [diff] [blame] | 19 | void close(); |
Jon Medhurst | 15ce78d | 2014-04-10 09:02:02 +0100 | [diff] [blame] | 20 | bool init(); |
| 21 | bool add(const int fd); |
| 22 | int wait(struct epoll_event *const events, int maxevents, int timeout); |
| 23 | |
| 24 | private: |
| 25 | |
| 26 | int mFd; |
| 27 | |
| 28 | // Intentionally unimplemented |
| 29 | Monitor(const Monitor &); |
| 30 | Monitor &operator=(const Monitor &); |
| 31 | }; |
| 32 | |
| 33 | #endif // MONITOR_H |