File: EventLoop.h

package info (click to toggle)
ultracopier 2.2.6.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 40,480 kB
  • sloc: ansic: 60,903; cpp: 59,790; sh: 6,882; asm: 723; xml: 675; makefile: 320; perl: 264
file content (30 lines) | stat: -rwxr-xr-x 590 bytes parent folder | download | duplicates (3)
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