debugsrv/runmodedebug/tsrc/rm_debug/multi_agent_tests/t_multi_agent.h
changeset 56 aa2539c91954
equal deleted inserted replaced
54:a151135b0cf9 56:aa2539c91954
       
     1 // Copyright (c) 2006-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 // Definitions for the run mode debug tests
       
    15 // 
       
    16 //
       
    17 
       
    18 
       
    19 #ifndef RMDEBUG_MULTI_AGENT_H
       
    20 #define RMDEBUG_MULTI_AGENT_H
       
    21 
       
    22 #include <u32hal.h>
       
    23 #include <f32file.h>
       
    24 #include <rm_debug_api.h>
       
    25 
       
    26 using namespace Debug;
       
    27 
       
    28 _LIT(KLaunchSemaphoreName, "t_rmdebug_launch_semaphore");
       
    29 _LIT(KLaunchSemaphoreSearchString, "t_rmdebug_launch_semaphore*");
       
    30 
       
    31 // Currently the targets are instances of t_rmdebug_app.exe
       
    32 _LIT(KTargetExe,"z:\\sys\\bin\\t_rmdebug_app%d.exe");
       
    33 
       
    34 _LIT(KTargetOptions,"-f%d -a%d");
       
    35 
       
    36 // If changing this, make sure there are enough apps built/in the rom 
       
    37 const TInt KNumApps = 5;
       
    38 
       
    39 // Default CPU execution for Agent
       
    40 const TInt KAgentCpu = 0;
       
    41 
       
    42 // Workaround to ensure we have the same agent binary when running multiple agents
       
    43 const TInt KTargetOffset = 0;
       
    44 
       
    45 class CAgentAsyncEvent;
       
    46 
       
    47 /**
       
    48   @Class CRunModeAgent
       
    49   
       
    50   The basic run mode agent
       
    51   */
       
    52 class CMultiAgent : public CBase
       
    53 	{
       
    54 	public:
       
    55 	static CMultiAgent* NewL();
       
    56 	~CMultiAgent();
       
    57 	void ClientAppL();  
       
    58 	RSecuritySvrSession&  DebugDriver() { return iServSession; };	
       
    59 	void HandleEvent(TEventInfo& aSEventInfo);
       
    60 
       
    61 	public:
       
    62 	TInt GetLaunchCompleted() const { return iLaunchCompleted; }
       
    63 	TInt GetNumApps() const { return iNumApps; }
       
    64 	TInt GetTargetOffset() const { return iTargetNameOffset; }
       
    65 
       
    66 	private:
       
    67 	CMultiAgent();
       
    68 	void ConstructL();
       
    69 	TInt StartTest();
       
    70 	TInt LaunchProcess(RProcess& aProcess, const TDesC& aExeName, const TDesC& aCommandLine);
       
    71 	
       
    72 	private:
       
    73 
       
    74 	/**
       
    75 	 * CPU agent executes on; by default this is 0 
       
    76 	 */
       
    77 	TInt iAgentCpuNo;
       
    78 
       
    79 	/*
       
    80 	 * Offset for running multiple targets using the same agent
       
    81 	 */
       
    82 	TInt iTargetNameOffset;
       
    83 
       
    84 	/** 
       
    85 	 * Number of applications/targets per agent
       
    86 	 */
       
    87 	TInt iNumApps;
       
    88 
       
    89 	/**
       
    90 	 * Flag used for terminating the event handling for a target 
       
    91 	 */	
       
    92 	TInt iLaunchCompleted;
       
    93 
       
    94 	/*
       
    95 	 * Handle to DSS
       
    96 	 */
       
    97 	RSecuritySvrSession iServSession;
       
    98 	
       
    99 	/**
       
   100 	 * Array to target parameters required by the agent
       
   101 	 */	
       
   102 	RPointerArray<CAgentAsyncEvent> iTargetList;
       
   103 	};
       
   104 
       
   105 #endif // RMDEBUG_MULTI_AGENT_H