DCL 4.0
Loading...
Searching...
No Matches
PollThread.h
Go to the documentation of this file.
1#ifndef __DCL_POLL_THREAD_H__
2#define __DCL_POLL_THREAD_H__ 20110224
3
4#ifndef __DCL_CONFIG_H__
5#include <dcl/Config.h>
6#endif
7
8#ifndef __DCL_POLL_ABLE_H__
9#include <dcl/PollAble.h>
10#endif
11#ifndef __DCL_THREAD_H__
12#include <dcl/Thread.h>
13#endif
14#ifndef __DCL_LIST_T_H__
15#include <dcl/ListT.h>
16#endif
17
18__DCL_BEGIN_NAMESPACE
19
34class DCLCAPI PollThread : public Thread
35{
36 DECLARE_CLASSINFO(IoPollThread)
37public:
38 PollThread(const char_t* _name = NULL);
39
47 virtual bool add(PollAble* _pPollAble, short _events)
49
55 virtual bool remove(PollAble* _pPollAble);
56
64 void terminate();
65
66protected:
67 virtual int run();
68
73 virtual void onRemoved(PollAble* _pPollAble);
74
75 struct Update
76 {
78 bool bAdd;
79
82 bAdd = false;
83 }
84
85 Update(PollAble* _pPollAble, bool _bAdd)
86 {
87 this->pPollAble = _pPollAble;
88 this->bAdd = _bAdd;
89 }
90 };
91#ifdef _MSC_VER
92#pragma warning (push)
93#pragma warning (disable: 4251)
94#endif
98#ifdef _MSC_VER
99#pragma warning (pop)
100#endif
101
102#if !__DCL_WINDOWS
104#endif
105 volatile bool __terminate;
106};
107
108__DCL_END_NAMESPACE
109
110#endif // __DCL_POLL_THREAD_H__
#define NULL
Definition Config.h:340
#define DCLCAPI
Definition Config.h:100
wchar_t char_t
Definition Config.h:275
#define __DCL_THROWS1(e)
Definition Config.h:167
#define DECLARE_CLASSINFO(class_name)
Definition Object.h:210
UpdateList __updateList
Definition PollThread.h:96
virtual void onRemoved(PollAble *_pPollAble)
List< Update > UpdateList
Definition PollThread.h:95
volatile bool __terminate
Definition PollThread.h:105
Thread::Event __pollInterrupt
Definition PollThread.h:103
Thread::Mutex __updateLock
Definition PollThread.h:97
virtual int run()=0
Update(PollAble *_pPollAble, bool _bAdd)
Definition PollThread.h:85
PollAble * pPollAble
Definition PollThread.h:77