os/kernelhwsrv/kernel/eka/debug/crashMonitor/inc/scmconfig.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
sl@0
     2
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
// All rights reserved.
sl@0
     4
// This component and the accompanying materials are made available
sl@0
     5
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     6
// which accompanies this distribution, and is available
sl@0
     7
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
//
sl@0
     9
// Initial Contributors:
sl@0
    10
// Nokia Corporation - initial contribution.
sl@0
    11
//
sl@0
    12
// Contributors:
sl@0
    13
//
sl@0
    14
// Description:
sl@0
    15
//
sl@0
    16
// WARNING: This file contains some APIs which are internal and are subject
sl@0
    17
//          to change without notice. Such APIs should therefore not be used
sl@0
    18
//          outside the Kernel and Hardware Services package.
sl@0
    19
//
sl@0
    20
sl@0
    21
/**
sl@0
    22
 @file
sl@0
    23
 @internalTechnology
sl@0
    24
*/
sl@0
    25
#ifndef __SCMCONFIG_H_INCLUDED__
sl@0
    26
#define __SCMCONFIG_H_INCLUDED__
sl@0
    27
sl@0
    28
sl@0
    29
#include <e32def.h>
sl@0
    30
sl@0
    31
#include <scmbytestreamutil.h>
sl@0
    32
#include <scmconfigitem.h>
sl@0
    33
sl@0
    34
namespace Debug{
sl@0
    35
	
sl@0
    36
	//Note -- Changing the size of this requires a change in KScmConfigMaxSize
sl@0
    37
    _LIT8(KScmConfigHeaderString, "SCMCONFIG");
sl@0
    38
sl@0
    39
    /**
sl@0
    40
     * This class handles the configuration section of the crash partition.
sl@0
    41
     * It is responsible for reading and writing it
sl@0
    42
     */
sl@0
    43
	class SCMConfiguration : public MByteStreamSerializable
sl@0
    44
		{
sl@0
    45
		
sl@0
    46
		public:
sl@0
    47
			
sl@0
    48
			//The 9 here refers to the size of KScmConfigHeaderString which is serialised
sl@0
    49
			static const TInt KScmConfigMaxSize = TConfigItem::ELast * sizeof(TConfigItem) + 9;
sl@0
    50
			
sl@0
    51
			SCMConfiguration();		
sl@0
    52
			virtual ~SCMConfiguration();
sl@0
    53
			
sl@0
    54
			// from MByteStreamSerializable
sl@0
    55
			virtual TInt Serialize(TByteStreamWriter& aWriter);
sl@0
    56
			virtual TInt Deserialize(TByteStreamReader& aReader);
sl@0
    57
		 	virtual TInt GetSize() const;
sl@0
    58
			
sl@0
    59
		 	TConfigItem* GetNextItem();
sl@0
    60
			TInt SetDefaultConfig();
sl@0
    61
						
sl@0
    62
			TInt CreateConfigItem(const TConfigItem::TSCMDataType aDataType, const TUint8 aPriority, const TInt32 aSizeToDump);
sl@0
    63
			TInt ModifyConfigItemPriority(const TConfigItem::TSCMDataType aDataType, const TUint8 aPriority);
sl@0
    64
			
sl@0
    65
			void ResetToHighestPriority();
sl@0
    66
			
sl@0
    67
		 	TBool operator == (const SCMConfiguration& aOther) const;
sl@0
    68
			
sl@0
    69
		 	TConfigItem* ConfigList() const;
sl@0
    70
			TInt InsertToList(TConfigItem* aItem);
sl@0
    71
			void ClearList(); 		
sl@0
    72
		 	
sl@0
    73
		private:	
sl@0
    74
			
sl@0
    75
			/**
sl@0
    76
			 * This is an ordered linked list of TConfigItems. The first is the highest priority and so on until the lowest priority 
sl@0
    77
			 */			
sl@0
    78
			TConfigItem* iConfigList;
sl@0
    79
			
sl@0
    80
			/**
sl@0
    81
			 * Everytime GetNextItemToDump is called this moves down along the list 
sl@0
    82
			 */
sl@0
    83
			TConfigItem* iNextItem;   
sl@0
    84
			
sl@0
    85
		private:	
sl@0
    86
			TInt RemoveFromList(TConfigItem* aItem);
sl@0
    87
			
sl@0
    88
							
sl@0
    89
		};
sl@0
    90
	}
sl@0
    91
sl@0
    92
#endif /*__SCMCONFIG_H_INCLUDED__*/