dbgagents/trkagent/dbgtrccomm/server/ostprotregistry.h
changeset 0 c6b0df440bee
equal deleted inserted replaced
-1:000000000000 0:c6b0df440bee
       
     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 #ifndef __OstProtRegistry_h__
       
    19 #define __OstProtRegistry_h__
       
    20 
       
    21 // System includes
       
    22 #include <e32base.h>
       
    23 #include "ostprotdefs.h"
       
    24 
       
    25 class CDbgTrcSrvSession;
       
    26 
       
    27 //
       
    28 // class TProtRegistryEntry
       
    29 //
       
    30 class TProtRegistryEntry
       
    31 {
       
    32 public:
       
    33 
       
    34 	inline TProtRegistryEntry(TOstProtIds aProtId, CDbgTrcSrvSession* aProtListener, TBool aNeedHeader)
       
    35 				: iProtId(aProtId),
       
    36 				  iProtListener(aProtListener),
       
    37 				  iNeedHeader(aNeedHeader) { }
       
    38 public:
       
    39 
       
    40 	TOstProtIds iProtId;
       
    41 	CDbgTrcSrvSession* iProtListener;
       
    42 	TBool iNeedHeader;	
       
    43 };
       
    44 
       
    45 class COstProtRegistry : public CBase
       
    46 {
       
    47 	public:
       
    48 		static 	COstProtRegistry*	NewL();
       
    49 				~COstProtRegistry();
       
    50 	
       
    51 	//private construct
       
    52 	private:
       
    53 				COstProtRegistry();
       
    54 
       
    55 	public:
       
    56 	
       
    57 		void RegisterProtocol(const TOstProtIds aProtId, CDbgTrcSrvSession* aProtMsgListener, TBool aStripHeader);
       
    58 		void UnRegisterProtocol(const TOstProtIds aProtId);
       
    59 		
       
    60 		TBool IsHeaderNeedForProtId(TOstProtIds aProtId);
       
    61 		CDbgTrcSrvSession* GetProtListenerForProtId(const TOstProtIds aProtId, TBool& aNeedHeader);
       
    62 		
       
    63 		TInt GetProtListenerCount();
       
    64 
       
    65 	// data members		
       
    66 	private:
       
    67 		RArray<TProtRegistryEntry> iProtListenerList;
       
    68 };
       
    69 
       
    70 #endif //__OstProtRegistry_h__