mmresourcemgmt/mmresctrl/inc/mmrcserverstart.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef MMRCSERVERSTART_H
       
    17 #define MMRCSERVERSTART_H
       
    18 
       
    19 _LIT(KMMRCServerName,"MMRCServer");
       
    20 _LIT(KMMRCServerFileName,"mmrcserver");
       
    21 
       
    22 const TUid KMMRCServerUID3 = {0x102021d5};
       
    23 
       
    24 const TInt KMMRCServerStackSize=0x2000;			//  8KB
       
    25 const TInt KMMRCServerInitHeapSize=0x1000;		//  4KB
       
    26 const TInt KMMRCServerMaxHeapSize=0x1000000;		// 16MB
       
    27 
       
    28 const TUint KMMRCServerVersion=1;
       
    29 const TUint KMMRCServerMinorVersionNumber=0;
       
    30 const TUint KMMRCServerBuildVersionNumber=0;
       
    31 
       
    32 class TServerStart
       
    33 	{
       
    34 	public:
       
    35 	TServerStart() {};
       
    36 	TServerStart(TRequestStatus& aStatus);
       
    37 	TPtrC AsCommand() const;
       
    38 	TInt GetCommand();
       
    39 	void SignalL();
       
    40 	private:
       
    41 	TThreadId iId;
       
    42 	TRequestStatus* iStatus;
       
    43 	};
       
    44 
       
    45 inline TServerStart::TServerStart(TRequestStatus& aStatus)
       
    46 :iId(RThread().Id()),iStatus(&aStatus)
       
    47 	{
       
    48 	aStatus = KRequestPending;
       
    49 	}
       
    50 
       
    51 // Descriptorizes ’this’ to pass it from client to server
       
    52 inline TPtrC TServerStart::AsCommand() const
       
    53 	{
       
    54 	return TPtrC(reinterpret_cast<const TText*>(this),sizeof(TServerStart)/sizeof(TText));
       
    55 	}
       
    56 
       
    57 void TServerStart::SignalL()
       
    58 	{
       
    59 	RThread client;
       
    60 	User::LeaveIfError(client.Open(iId));
       
    61 	client.RequestComplete(iStatus, KErrNone);
       
    62 	client.Close();
       
    63 	}
       
    64 #endif //__MMRCSERVERSTART_H
       
    65