|
1 /* |
|
2 * Copyright (c) 2005-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * @file |
|
16 * This contains TestServer2.h |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef __TEST_SERVER_2_H__ |
|
22 #define __TEST_SERVER_2_H__ |
|
23 |
|
24 #include <test/testexecuteserverbase.h> |
|
25 #include <test/blockitems.h> |
|
26 #include <test/activecallback.h> |
|
27 #include <test/testblockcontroller.h> |
|
28 #include <test/datadictionary.h> |
|
29 |
|
30 class CTestServer2 : public CTestServer, public MSharedData |
|
31 /** |
|
32 * @publishedPartner |
|
33 * @test |
|
34 * |
|
35 * @see CTestServer |
|
36 * @see MSharedData |
|
37 * |
|
38 * Test server that includes test block processing |
|
39 */ |
|
40 { |
|
41 private: |
|
42 struct TDataElement |
|
43 { |
|
44 TAny* iAny; |
|
45 TCleanupOperation iCleanupOperation; |
|
46 }; |
|
47 typedef RHashMap<TDataDictionaryName, TDataElement> RDataStore; |
|
48 typedef THashMapIter<TDataDictionaryName, TDataElement> TDataIter; |
|
49 |
|
50 public: |
|
51 IMPORT_C CTestServer2(); |
|
52 IMPORT_C virtual ~CTestServer2(); |
|
53 IMPORT_C void ConstructL(); |
|
54 |
|
55 /** |
|
56 * Create a test block |
|
57 * |
|
58 * @see CTestBlockController |
|
59 */ |
|
60 IMPORT_C virtual CTestBlockController* CreateTestBlock() =0; |
|
61 |
|
62 // CTestServer implementation |
|
63 IMPORT_C virtual CTestStep* CreateTestStep(const TDesC& aStepName); |
|
64 |
|
65 // MSharedData implementation |
|
66 IMPORT_C virtual void CreateActiveSchedulerL(); |
|
67 IMPORT_C virtual void DeleteActiveSchedulerL(); |
|
68 IMPORT_C virtual TAny* GetObjectAndOwnL(const TDesC& aName); |
|
69 IMPORT_C virtual void PutAndDisownL(const TDesC& aName, TAny* aAny, TCleanupOperation aCleanupOperation); |
|
70 |
|
71 private: |
|
72 static TUint32 Hash(const TDataDictionaryName& aName); |
|
73 static TBool Identity(const TDataDictionaryName& aName1, const TDataDictionaryName& aName2); |
|
74 |
|
75 private: |
|
76 RDataStore iStore; |
|
77 CActiveScheduler* iActiveScheduler; |
|
78 }; |
|
79 |
|
80 #endif // __TEST_SERVER_2_H__ |