1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#ifndef EVENTLOOP_H
#define EVENTLOOP_H
#include "Variable.h"
#ifdef ASYNCFILEMANIP
#include <QThread>
#include "CallBackEventLoop.h"
#include <sys/epoll.h>
#define MAXEVENTS 64
class EventLoop : public QThread
{
public:
EventLoop();
~EventLoop();
static EventLoop eventLoop;
void watchSource(CallBackEventLoop * const object,const int &fd);
void watchDestination(CallBackEventLoop * const object,const int &fd);
protected:
void run();
void stop();
private:
epoll_event events[MAXEVENTS];
int efd;
bool stopIt;
};
#endif
#endif // EVENTLOOP_H
|