os/security/cryptomgmtlibs/securitycommonutils/test/source/scstestserver/treblerequest.cpp
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 * Implements CTrebleRequest. See class and function definitions for information.
24 #include "scstestserver.h"
27 CTrebleRequest* CTrebleRequest::NewL(CScsTestSession* aSession, CScsTestSubsession* aSubsession, const RMessage2& aMessage)
29 Factory function allocates new instance of CTrebleRequest which and queues a timer.
30 When the timer expires it trebles the value of an integer in client space to complete
33 @param aSession Session on which this request was launched.
34 @param aSubsession Subsession on which this request was launched.
35 @param aMessage Standard server-side handle to message.
38 CTrebleRequest* self = new(ELeave) CTrebleRequest(aSession, aSubsession, aMessage);
39 CleanupStack::PushL(self);
41 CleanupStack::Pop(self);
45 CTrebleRequest::CTrebleRequest(CScsTestSession* aSession, CScsTestSubsession* aSubsession, const RMessage2& aMessage)
47 This private constructor is defined to initialize the CAsyncRequest base class with
48 the supplied arguments.
50 @param aSession Session on which this request was launched.
51 @param aSubsession Subsession on which this request was launched.
52 @param aMessage Standard server-side handle to message.
54 : CAsyncRequest(aSession, aSubsession, aMessage)
59 void CTrebleRequest::ConstructL()
61 Second-phase constructor initializes and launches the timer.
64 TInt r = iTimer.CreateLocal();
65 User::LeaveIfError(r);
67 CAsyncRequest::TransferToScsFrameworkL();
69 iTimer.After(iStatus, ScsTestImpl::KTrebleTimerDelayUs);
73 CTrebleRequest::~CTrebleRequest()
75 Close the timer which this object used to create a delay.
81 void CTrebleRequest::RunL()
83 Treble the value passed by the client and complete
87 // if these descriptor functions leave then RunError
88 // will be called by the active object framework.
89 TPckgBuf<TInt> valBuf;
90 iMessagePtr2.ReadL(0, valBuf);
92 iMessagePtr2.WriteL(0, valBuf);
94 // CompleteAndMarkForDeletion(KErrNone);
95 // Call base class to call CompleteAndMarkForDeletion as this
96 // improves code coverage
97 CAsyncRequest::RunL();
100 void CTrebleRequest::DoCancel()
102 Implement CActive by cancelling the outstanding activity.
103 This does not complete the client request or mark this object