sysanadatacapture/piprofiler/piprofiler/engine/inc/WriterController.h
changeset 2 6a82cd05fb1e
parent 1 3ff3fecb12fe
equal deleted inserted replaced
1:3ff3fecb12fe 2:6a82cd05fb1e
     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 __WRITERCONTROLLER_H__
       
    20 #define __WRITERCONTROLLER_H__
       
    21 
       
    22 // system includes
       
    23 #include <utf.h>
       
    24 #include <e32cmn.h>
       
    25 
       
    26 
       
    27 // The user-interface to the sampling device driver sued by the profiling engine
       
    28 // user includes
       
    29 #include <piprofiler/ProfilerConfig.h>
       
    30 #include <piprofiler/ProfilerVersion.h>
       
    31 #include <piprofiler/WriterPluginInterface.h>
       
    32 
       
    33 #include "WriterPluginLoader.h"
       
    34 
       
    35 /*
       
    36  *	Forward declarations
       
    37  */
       
    38 class TBapBuf;
       
    39 class CWriterPluginLoader;
       
    40 class CWriterPluginInterface;
       
    41 
       
    42 /**
       
    43  * The writer controller for handling the available Data writer plugins.
       
    44  */
       
    45   
       
    46 class CWriterController : public CBase, MWriterPluginLoadObserver
       
    47 	{
       
    48 	
       
    49 public:
       
    50 	static CWriterController* NewL(CProfilerSampleStream& aStream);
       
    51 	void ConstructL();
       
    52 	
       
    53 	CWriterController(CProfilerSampleStream& aStream);
       
    54     ~CWriterController();
       
    55 	
       
    56 	/** 
       
    57 	 * 
       
    58 	 * Methods for user mode sampling
       
    59 	 * 
       
    60 	 **/
       
    61 	
       
    62 	/** Initialise the user mode samplers **/					
       
    63 	void InitialiseWriterListL();
       
    64 	
       
    65 	/* Overrider of MSamplerPluginLoaderObserver class **/
       
    66 	void HandlePluginLoaded( KWriterPluginLoaderStatus /*aStatus*/ );
       
    67 	
       
    68 	/* returns the matching plugin Uid */
       
    69 	TUid GetPluginUID(TInt traceId);
       
    70 	
       
    71 	CWriterPluginInterface* GetActiveWriter();
       
    72 	
       
    73 	 /** Returns the sampler type (kernel/user) **/
       
    74 	TUint32 GetWriterType(TUint32 samplerId);
       
    75 
       
    76 	/** Set additional settings for a trace **/			
       
    77 	TInt AdditionalUserTraceSettings(TInt traceId, TInt settings);
       
    78 
       
    79 	/** Set data stream for samplers **/
       
    80 	//void SetSampleStream(RProfilerSampleStream* iStream);
       
    81 
       
    82 	TInt StartSelectedPlugin();
       
    83 
       
    84 	void StopSelectedPlugin();
       
    85 
       
    86 	/** Set selected plugin active **/
       
    87 	void SetPluginActive(TUid uid, const TWriterPluginValueKeys aKey);
       
    88 
       
    89 	TInt SetPluginSettings(TUid aUid, TDes& aDes);
       
    90 	
       
    91 	/** Get settings for a specific plugin **/
       
    92 	void GetPluginSettings(TUid uid, TDes& aVal);
       
    93 	
       
    94 	/** Request stream read **/
       
    95 	//void FillThisStreamBuffer(TBapBuf* aBuffer, TRequestStatus& aStatus);
       
    96 	
       
    97 	CWriterPluginInterface* GetPlugin(TUid aUid);
       
    98 	
       
    99 	CArrayPtrFlat<CWriterPluginInterface>* GetPluginList();
       
   100 	
       
   101 	void InitialisePluginStream();
       
   102 public:
       
   103     CArrayPtrFlat<CWriterPluginInterface>* iPluginArray;
       
   104     
       
   105     // Asynchronous loader for the writer plug-ins.
       
   106     CWriterPluginLoader* iPluginLoader;
       
   107     
       
   108     // UID of the selected plugin in the container's lbx.
       
   109     TUid iSelectedPluginUid;
       
   110     
       
   111     CProfilerSampleStream& iStream;
       
   112 };
       
   113 
       
   114 	
       
   115 #endif	// __WRITERCONTROLLER_H__