PECengine/StorageManager2/ServerSrc/CPEngTimer.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2002 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:  Listen change of the event request handler
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CPENGTIMER_H__
       
    21 #define __CPENGTIMER_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include "MPEngStorageServer.h"
       
    26 
       
    27 // CLASS DECLARATION
       
    28 /**
       
    29  *  timer for delaying of the Storage Server shut down
       
    30  *
       
    31  *  @lib PEngStorageServer
       
    32  *  @since
       
    33  */
       
    34 class CPEngTimer : public CTimer
       
    35     {
       
    36     public:  // Constructors and destructor
       
    37 
       
    38         /**
       
    39          * Two-phased constructor.
       
    40          */
       
    41         inline static CPEngTimer* NewL( MPEngStorageServer& aServer )
       
    42             {
       
    43             CPEngTimer* self = new( ELeave ) CPEngTimer( aServer );
       
    44             CleanupStack::PushL( self );
       
    45             self->ConstructL();
       
    46             CleanupStack::Pop( self );
       
    47             return self;
       
    48             }
       
    49 
       
    50         /**
       
    51          * Destructor.
       
    52          */
       
    53         virtual ~CPEngTimer()
       
    54             {
       
    55             Cancel();
       
    56             }
       
    57 
       
    58 
       
    59     public: // Function from CPEngRequestHandler
       
    60 
       
    61         /**
       
    62          *	Notify client about new event
       
    63          *
       
    64          *	@since 3.0
       
    65          *	@param aNewEvent new event which has occurred
       
    66          */
       
    67         inline void RunL()
       
    68             {
       
    69             iServer.TimeExpired();
       
    70             }
       
    71 
       
    72         /**
       
    73          *  Notify Client about error
       
    74          *
       
    75          *  @since 3.0
       
    76          *  @param aErrorCode error code to be notified
       
    77          */
       
    78         inline TInt RunError( TInt /*aErrorCode*/ )
       
    79             {
       
    80             return KErrNone;
       
    81             }
       
    82 
       
    83     private:
       
    84 
       
    85         /**
       
    86          * C++ default constructor.
       
    87          */
       
    88         inline CPEngTimer( MPEngStorageServer& aServer )
       
    89                 : CTimer( CActive::EPriorityStandard ),
       
    90                 iServer( aServer )
       
    91             {
       
    92             }
       
    93 
       
    94 
       
    95         /**
       
    96          *
       
    97          */
       
    98         inline void ConstructL( )
       
    99             {
       
   100             CActiveScheduler::Add( this );
       
   101             CTimer::ConstructL();
       
   102             }
       
   103 
       
   104     private:    // Data
       
   105 
       
   106         /// Storage server to inform about time out
       
   107         MPEngStorageServer& 		iServer;
       
   108 
       
   109     };
       
   110 
       
   111 #endif      // __CPEngTimer_H__
       
   112 
       
   113 // End of File