1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "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 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This file contains the header file of the |
|
15 * TestServerThreadStarter class. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef TESTSERVERTHREADSTARTER_H_ |
|
21 #define TESTSERVERTHREADSTARTER_H_ |
|
22 |
|
23 // INCLUDES |
|
24 #include "e32base.h" |
|
25 |
|
26 |
|
27 // CONSTANTS |
|
28 // None |
|
29 |
|
30 // MACROS |
|
31 // None |
|
32 |
|
33 // DATA TYPES |
|
34 // None |
|
35 |
|
36 // FUNCTION PROTOTYPES |
|
37 // None |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 class CTestThreadContainerRunnerFactory; |
|
41 |
|
42 // CLASS DECLARATION |
|
43 |
|
44 // DESCRIPTION |
|
45 // Class used to create thread in which testserver execution code is placed. |
|
46 class CTestServerThreadStarter: public CActive |
|
47 { |
|
48 public: // Enumerations |
|
49 // None |
|
50 |
|
51 private: // Enumerations |
|
52 // None |
|
53 |
|
54 public: // Constructors and destructor |
|
55 /** |
|
56 * C++ destructor. |
|
57 */ |
|
58 ~CTestServerThreadStarter(); |
|
59 |
|
60 public: // New functions |
|
61 /** |
|
62 * NewL is first phase of two-phased constructor. |
|
63 */ |
|
64 static CTestServerThreadStarter* NewL(); |
|
65 |
|
66 /** |
|
67 * Performs testserver execution request. |
|
68 */ |
|
69 TInt RunTestServerThread( CTestThreadContainerRunnerFactory* aTestThreadContainerRunnerFactory ); |
|
70 public: // Functions from base classes |
|
71 /** |
|
72 * RunL derived from CActive handles the completed requests. |
|
73 */ |
|
74 void RunL(); |
|
75 |
|
76 /** |
|
77 * DoCancel derived from CActive handles the Cancel. |
|
78 */ |
|
79 void DoCancel(); |
|
80 |
|
81 protected: // New functions |
|
82 // None |
|
83 |
|
84 protected: // Functions from base classes |
|
85 // None |
|
86 |
|
87 private: // New functions |
|
88 /** |
|
89 * Thread function in which testserver execution code is placed. |
|
90 */ |
|
91 static TInt TestServerStarterThreadFunction( TAny* aParameters ); |
|
92 |
|
93 /** |
|
94 * C++ default constructor. |
|
95 */ |
|
96 CTestServerThreadStarter(); |
|
97 |
|
98 /** |
|
99 * By default Symbian OS constructor is private. |
|
100 */ |
|
101 void ConstructL(); |
|
102 |
|
103 public: //Data |
|
104 // None |
|
105 |
|
106 protected: // Data |
|
107 // None |
|
108 |
|
109 private: // Data |
|
110 RTimer iTimer; // Timer which complets testserver execution request |
|
111 CTestThreadContainerRunnerFactory* iTestThreadContainerRunnerFactory; // Pointer to test thread container |
|
112 // runner factory passed as a parameter |
|
113 // to function which executes testserver |
|
114 TThreadId iMainThreadId; // UITestServerStarter main thread id |
|
115 TInt iReturnCode; // TestServer execution return code |
|
116 RSemaphore iServerThreadStartedSemaphore; // Semaphore which indicates that testserver execution thread |
|
117 // was successfully created |
|
118 public: // Friend classes |
|
119 // None |
|
120 |
|
121 protected: // Friend classes |
|
122 // None |
|
123 |
|
124 private: // Friend classes |
|
125 // None |
|
126 }; |
|
127 |
|
128 |
|
129 |
|
130 #endif // TESTSERVERTHREADSTARTER_H_ |
|
131 |
|
132 // End of File |
|