genericopenlibs/posixrealtimeextensions/inc/timerclient.h
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 /*
       
     2 * Copyright (c) 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 "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:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __TIMERCLIENT_H__
       
    20 #define __TIMERCLIENT_H__
       
    21 
       
    22 #include <e32std.h> //RSessionBase
       
    23 #include <e32def.h> //Varargs
       
    24 
       
    25 class RTimerSession : public RSessionBase
       
    26 	{
       
    27 	public:
       
    28 		RTimerSession():iIsConnected(EFalse)
       
    29 			{iLock.CreateLocal();}
       
    30 		TInt Connect(RServer2 aServer);
       
    31 		TInt DeleteTimer(const TInt);
       
    32 		TInt OnDemandConnect(RServer2 aServer);
       
    33 		TInt SetTime(const TInt);
       
    34 		void ResetConnectionFlag()
       
    35 			{
       
    36 			iIsConnected = EFalse;
       
    37 			}
       
    38 	private:
       
    39 		void Lock()
       
    40 			{
       
    41 			iLock.Wait();
       
    42 			}
       
    43 		void UnLock()
       
    44 			{
       
    45 			iLock.Signal();
       
    46 			}
       
    47 		RFastLock iLock;
       
    48 		TInt iIsConnected;
       
    49 	};	
       
    50 	
       
    51 #endif //__TIMERCLIENT_H__