Update contrib.
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Test implementation of a session count server tests the base functionality
16 * will work for sessions, subsessions, and asynchronous requests.
27 #ifndef SCSTESTSERVER_H
28 #define SCSTESTSERVER_H
30 #include <scs/scsserver.h>
31 #include "scstestcommon.h"
33 // forward declarations
34 class CScsTestSession;
35 class CScsTestSubsession;
37 class CTrebleRequest : public CAsyncRequest
39 Trebles a client-side TInt. The request is completed asynchronously,
40 some time after it has been queued.
44 static CTrebleRequest* NewL(CScsTestSession* aSession, CScsTestSubsession* aSubsession, const RMessage2& aMessage);
45 virtual ~CTrebleRequest();
48 virtual void DoCancel();
49 // implement CActive, override CAsyncRequest
53 CTrebleRequest(CScsTestSession* aSession, CScsTestSubsession* aSubsession, const RMessage2& aMessage);
57 RTimer iTimer; ///< Provides the delay which makes this request asynchronous.
60 class CScsTestSession;
61 class CScsTestSubsession : public CScsSubsession
63 This subsession class is defined to ensure that requests are
64 routed to, and asynchronous requests associated with, the correct
69 static CScsTestSubsession* NewL(CScsTestSession &aSession, const RMessage2& aMessage);
70 virtual ~CScsTestSubsession();
72 // implement CScsSubsession
73 virtual TBool DoServiceL(TInt aFunction, const RMessage2& aMessage);
76 CScsTestSubsession(CScsTestSession &aSession);
79 TInt iValue; ///< Value on which this subsession is curried.
83 class CScsTestSession : public CScsSession
85 Tests the underlying session count session implementation by
86 handling requests, asynchronous requests, and creating subsessions.
90 static CScsTestSession* NewL(CScsTestServer &aServer);
91 virtual ~CScsTestSession();
93 // implement CScsSession
94 virtual TBool DoServiceL(TInt aFunction, const RMessage2& aMessage);
95 // override CScsSession
96 virtual CScsSubsession* DoCreateSubsessionL(TInt aFunction, const RMessage2& aMessage);
99 CScsTestSession(CScsTestServer &aServer);
102 class CScsTestServer : public CScsServer
104 This test implementation of the session count server provides
105 the functionality to create sessions and subsessions, and to
106 queue asynchronous requests on each of them.
110 static CScsTestServer* NewLC();
111 virtual ~CScsTestServer();
113 // implement CScsServer
114 virtual CScsSession* DoNewSessionL(const RMessage2& aMessage);
118 void ConstructL(TInt aShutdownPeriodUs);
121 #endif // #ifndef SCSTESTSERVER_H