kernel/eka/debug/crashMonitor/inc/scmconfig.h
changeset 296 94f2adf59133
parent 293 0659d0e1a03c
child 297 b2826f67641f
equal deleted inserted replaced
293:0659d0e1a03c 296:94f2adf59133
     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 the License "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 // WARNING: This file contains some APIs which are internal and are subject
       
    17 //          to change without notice. Such APIs should therefore not be used
       
    18 //          outside the Kernel and Hardware Services package.
       
    19 //
       
    20 
       
    21 /**
       
    22  @file
       
    23  @internalTechnology
       
    24 */
       
    25 #ifndef __SCMCONFIG_H_INCLUDED__
       
    26 #define __SCMCONFIG_H_INCLUDED__
       
    27 
       
    28 
       
    29 #include <e32def.h>
       
    30 
       
    31 #include <scmbytestreamutil.h>
       
    32 #include <scmconfigitem.h>
       
    33 
       
    34 namespace Debug{
       
    35 	
       
    36 	//Note -- Changing the size of this requires a change in KScmConfigMaxSize
       
    37     _LIT8(KScmConfigHeaderString, "SCMCONFIG");
       
    38 
       
    39     /**
       
    40      * This class handles the configuration section of the crash partition.
       
    41      * It is responsible for reading and writing it
       
    42      */
       
    43 	class SCMConfiguration : public MByteStreamSerializable
       
    44 		{
       
    45 		
       
    46 		public:
       
    47 			
       
    48 			//The 9 here refers to the size of KScmConfigHeaderString which is serialised
       
    49 			static const TInt KScmConfigMaxSize = TConfigItem::ELast * sizeof(TConfigItem) + 9;
       
    50 			
       
    51 			SCMConfiguration();		
       
    52 			virtual ~SCMConfiguration();
       
    53 			
       
    54 			// from MByteStreamSerializable
       
    55 			virtual TInt Serialize(TByteStreamWriter& aWriter);
       
    56 			virtual TInt Deserialize(TByteStreamReader& aReader);
       
    57 		 	virtual TInt GetSize() const;
       
    58 			
       
    59 		 	TConfigItem* GetNextItem();
       
    60 			TInt SetDefaultConfig();
       
    61 						
       
    62 			TInt CreateConfigItem(const TConfigItem::TSCMDataType aDataType, const TUint8 aPriority, const TInt32 aSizeToDump);
       
    63 			TInt ModifyConfigItemPriority(const TConfigItem::TSCMDataType aDataType, const TUint8 aPriority);
       
    64 			
       
    65 			void ResetToHighestPriority();
       
    66 			
       
    67 		 	TBool operator == (const SCMConfiguration& aOther) const;
       
    68 			
       
    69 		 	TConfigItem* ConfigList() const;
       
    70 			TInt InsertToList(TConfigItem* aItem);
       
    71 			void ClearList(); 		
       
    72 		 	
       
    73 		private:	
       
    74 			
       
    75 			/**
       
    76 			 * This is an ordered linked list of TConfigItems. The first is the highest priority and so on until the lowest priority 
       
    77 			 */			
       
    78 			TConfigItem* iConfigList;
       
    79 			
       
    80 			/**
       
    81 			 * Everytime GetNextItemToDump is called this moves down along the list 
       
    82 			 */
       
    83 			TConfigItem* iNextItem;   
       
    84 			
       
    85 		private:	
       
    86 			TInt RemoveFromList(TConfigItem* aItem);
       
    87 			
       
    88 							
       
    89 		};
       
    90 	}
       
    91 
       
    92 #endif /*__SCMCONFIG_H_INCLUDED__*/