equal
deleted
inserted
replaced
|
1 // wsp_scheduler.h |
|
2 // |
|
3 // Copyright (c) 2002 - 2010 Accenture. All rights reserved. |
|
4 // This component and the accompanying materials are made available |
|
5 // under the terms of the "Eclipse Public License v1.0" |
|
6 // which accompanies this distribution, and is available |
|
7 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 // |
|
9 // Initial Contributors: |
|
10 // Accenture - Initial contribution |
|
11 // |
|
12 |
|
13 #ifndef __WSP_SCHEDULER_H__ |
|
14 #define __WSP_SCHEDULER_H__ |
|
15 |
|
16 #include "wsp_active.h" |
|
17 |
|
18 const TInt KMaxWaitObjects = 64; // Should be MAXIMUM_WAIT_OBJECTS from windows.h, but this header doesn't sit happily with winsock2.h. |
|
19 |
|
20 |
|
21 class CWin32Scheduler : public CBase |
|
22 { |
|
23 public: |
|
24 static CWin32Scheduler* NewL(); |
|
25 ~CWin32Scheduler(); |
|
26 void Add(CWin32ActiveObject& aActiveObject); |
|
27 void Remove(CWin32ActiveObject& aActiveObject); |
|
28 TBool IsPresent(CWin32ActiveObject& aActiveObject) const; |
|
29 void Start(); |
|
30 void Stop(); |
|
31 private: |
|
32 CWin32Scheduler(); |
|
33 void RebuildEventList(); |
|
34 private: |
|
35 TBool iStopping; |
|
36 TInt iNumEvents; |
|
37 WIN32_HANDLE iEventList[KMaxWaitObjects]; |
|
38 CWin32ActiveObject* iActiveObjectList[KMaxWaitObjects]; |
|
39 TSglQue<CWin32ActiveObject> iActiveQue; |
|
40 }; |
|
41 |
|
42 |
|
43 #endif // __WSP_SCHEDULER_H__ |