00001 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 00002 // All rights reserved. 00003 // This component and the accompanying materials are made available 00004 // under the terms of "Eclipse Public License v1.0" 00005 // which accompanies this distribution, and is available 00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html". 00007 // 00008 // Initial Contributors: 00009 // Nokia Corporation - initial contribution. 00010 // 00011 // Contributors: 00012 // 00013 // Description: 00014 // Server shut down file 00015 // 00016 00017 00018 00023 #include "shutdownserver.h" 00024 00028 CDelayServerShutDown* CDelayServerShutDown::NewL() 00029 { 00030 CDelayServerShutDown* self = new(ELeave) CDelayServerShutDown; 00031 CleanupStack::PushL(self); 00032 self->ConstructL(); 00033 CleanupStack::Pop(); 00034 return self; 00035 } 00039 CDelayServerShutDown::CDelayServerShutDown() 00040 : CActive(EPriorityStandard) 00041 { 00042 } 00043 00044 void CDelayServerShutDown::ConstructL() 00045 { 00046 User::LeaveIfError(iShutDownTimer.CreateLocal()); 00047 CActiveScheduler::Add(this); 00048 } 00053 void CDelayServerShutDown::SetDelay(TTimeIntervalMicroSeconds32 aDelay) 00054 { 00055 __ASSERT_ALWAYS(!IsActive(), User::Panic(_L("CDelayedShutDown"), 1)); 00056 00057 // Request another wait 00058 iShutDownTimer.After(iStatus, aDelay); 00059 SetActive(); 00060 } 00064 CDelayServerShutDown::~CDelayServerShutDown() 00065 { 00066 Cancel(); 00067 // Close timer 00068 iShutDownTimer.Close(); 00069 } 00073 void CDelayServerShutDown::RunL() 00074 { 00075 // Stop the active scheduler 00076 CActiveScheduler::Stop(); 00077 } 00081 void CDelayServerShutDown::DoCancel() 00082 { 00083 iShutDownTimer.Cancel(); 00084 } 00085 00086 00087 //EOF
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.