os/ossrv/genericopenlibs/openenvcore/backend/inc/signalclient.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2008-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 * Name        : signalclient.h
    16 * Part of     : Signal server
    17 * 
    18 *
    19 */
    20 
    21 
    22 
    23 #ifndef SIGNALSESSION_H
    24 #define SIGNALSESSION_H
    25 
    26 // INCLUDES
    27 #include <e32std.h>
    28 #include <e32base.h>
    29 #include "rpipe.h"
    30 
    31 // CLASS DECLARATION
    32 
    33 /**
    34  *  RSignalSession
    35  *
    36  */
    37 class RSignalSession : public RSessionBase
    38 	{
    39 public:
    40 	RSignalSession():iIsConnected(EFalse)
    41 				{iLock.CreateLocal();}
    42 
    43 	TInt SendPipe(RPipe& aPipe);
    44 	TInt SendSignal(TInt aPid,TInt aSignal);
    45 	TInt SendSignalValue(TInt aPid,TInt aSignal,TInt aValue);
    46 	inline void Close()
    47 	    {
    48 	    iLock.Close();
    49 	    RSessionBase::Close();
    50 	    }
    51 
    52 private:
    53 	TInt OnDemandConnection();
    54 
    55 	void Lock() { iLock.Wait(); }
    56 
    57 	void UnLock() { iLock.Signal(); }
    58 	RFastLock iLock;
    59 	TInt Connect();
    60 	TInt iIsConnected;
    61 	//todo put a lock around this list
    62 	};
    63 
    64 #endif // SIGNALSESSION_H