os/ossrv/genericopenlibs/openenvcore/backend/inc/signalserver.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        : signalserver.h
    16 * Part of     : Signal server
    17 * 
    18 *
    19 */
    20 
    21 
    22 
    23 #ifndef SIGNALSERVER_H
    24 #define SIGNALSERVER_H
    25 
    26 // INCLUDES
    27 #include <e32std.h>
    28 #include <e32base.h>
    29 #include "signalshutdown.h"
    30 #include "rpipe.h"
    31 
    32 /*
    33 server name
    34 */
    35 _LIT(KServerName,"SignalServer");
    36 /*
    37 A version must be specified when creating a session with the server
    38 */
    39 const TUint KSignalServMajorVersionNumber=1;
    40 const TUint KSignalServMinorVersionNumber=0;
    41 const TUint KSignalServBuildVersionNumber=0;
    42 
    43 // CLASS DECLARATION
    44 class CSignalServer : public CServer2
    45 	{
    46 public:
    47 	virtual ~CSignalServer();
    48 	static CServer2* NewL();
    49 	void AddSession();
    50 	void RemoveSession();
    51 	void ServiceL(const RMessage2&);
    52 
    53 private:
    54 	CSignalServer(CActive::TPriority aPriority);
    55 	CSession2* NewSessionL(const TVersion&,const RMessage2&) const;
    56 	void ConstructL();
    57 	TInt CheckForCapability(const RMessage2&);
    58 	TInt iSessionCount;
    59 	CSigShutDown *iShutDown;
    60 	struct TOeProcessHdl
    61 		{
    62 		TInt 	mPid;
    63 		RPipe	mPipe;
    64 
    65 		static TBool MatchByPid(const TOeProcessHdl& aProc1, const TOeProcessHdl& aProc2)
    66 			{
    67 			if (aProc1.mPid == aProc2.mPid)
    68 				{
    69 				return ETrue;
    70 				}
    71 			return EFalse;
    72 			}
    73 		};
    74 	RArray<TOeProcessHdl>	iProcessHdlList;
    75 	};
    76 
    77 #endif // SIGNALSERVER_H