blob: 55368fca3e0a918fb0d41f205c71a3844772fa4a [file] [log] [blame]
Jon Medhurst15ce78d2014-04-10 09:02:02 +01001/**
Jon Medhurstb1d07442015-05-08 12:04:18 +01002 * Copyright (C) ARM Limited 2013-2015. All rights reserved.
Jon Medhurst15ce78d2014-04-10 09:02:02 +01003 *
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
14class Monitor {
15public:
16 Monitor();
17 ~Monitor();
18
Jon Medhurste31266f2014-08-04 15:47:44 +010019 void close();
Jon Medhurst15ce78d2014-04-10 09:02:02 +010020 bool init();
21 bool add(const int fd);
22 int wait(struct epoll_event *const events, int maxevents, int timeout);
23
24private:
25
26 int mFd;
27
28 // Intentionally unimplemented
29 Monitor(const Monitor &);
30 Monitor &operator=(const Monitor &);
31};
32
33#endif // MONITOR_H