os/kernelhwsrv/kernel/eka/debug/crashMonitor/inc/scmconfig.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kernel/eka/debug/crashMonitor/inc/scmconfig.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,92 @@
     1.4 +
     1.5 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// under the terms of the License "Eclipse Public License v1.0"
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +//
    1.19 +// WARNING: This file contains some APIs which are internal and are subject
    1.20 +//          to change without notice. Such APIs should therefore not be used
    1.21 +//          outside the Kernel and Hardware Services package.
    1.22 +//
    1.23 +
    1.24 +/**
    1.25 + @file
    1.26 + @internalTechnology
    1.27 +*/
    1.28 +#ifndef __SCMCONFIG_H_INCLUDED__
    1.29 +#define __SCMCONFIG_H_INCLUDED__
    1.30 +
    1.31 +
    1.32 +#include <e32def.h>
    1.33 +
    1.34 +#include <scmbytestreamutil.h>
    1.35 +#include <scmconfigitem.h>
    1.36 +
    1.37 +namespace Debug{
    1.38 +	
    1.39 +	//Note -- Changing the size of this requires a change in KScmConfigMaxSize
    1.40 +    _LIT8(KScmConfigHeaderString, "SCMCONFIG");
    1.41 +
    1.42 +    /**
    1.43 +     * This class handles the configuration section of the crash partition.
    1.44 +     * It is responsible for reading and writing it
    1.45 +     */
    1.46 +	class SCMConfiguration : public MByteStreamSerializable
    1.47 +		{
    1.48 +		
    1.49 +		public:
    1.50 +			
    1.51 +			//The 9 here refers to the size of KScmConfigHeaderString which is serialised
    1.52 +			static const TInt KScmConfigMaxSize = TConfigItem::ELast * sizeof(TConfigItem) + 9;
    1.53 +			
    1.54 +			SCMConfiguration();		
    1.55 +			virtual ~SCMConfiguration();
    1.56 +			
    1.57 +			// from MByteStreamSerializable
    1.58 +			virtual TInt Serialize(TByteStreamWriter& aWriter);
    1.59 +			virtual TInt Deserialize(TByteStreamReader& aReader);
    1.60 +		 	virtual TInt GetSize() const;
    1.61 +			
    1.62 +		 	TConfigItem* GetNextItem();
    1.63 +			TInt SetDefaultConfig();
    1.64 +						
    1.65 +			TInt CreateConfigItem(const TConfigItem::TSCMDataType aDataType, const TUint8 aPriority, const TInt32 aSizeToDump);
    1.66 +			TInt ModifyConfigItemPriority(const TConfigItem::TSCMDataType aDataType, const TUint8 aPriority);
    1.67 +			
    1.68 +			void ResetToHighestPriority();
    1.69 +			
    1.70 +		 	TBool operator == (const SCMConfiguration& aOther) const;
    1.71 +			
    1.72 +		 	TConfigItem* ConfigList() const;
    1.73 +			TInt InsertToList(TConfigItem* aItem);
    1.74 +			void ClearList(); 		
    1.75 +		 	
    1.76 +		private:	
    1.77 +			
    1.78 +			/**
    1.79 +			 * This is an ordered linked list of TConfigItems. The first is the highest priority and so on until the lowest priority 
    1.80 +			 */			
    1.81 +			TConfigItem* iConfigList;
    1.82 +			
    1.83 +			/**
    1.84 +			 * Everytime GetNextItemToDump is called this moves down along the list 
    1.85 +			 */
    1.86 +			TConfigItem* iNextItem;   
    1.87 +			
    1.88 +		private:	
    1.89 +			TInt RemoveFromList(TConfigItem* aItem);
    1.90 +			
    1.91 +							
    1.92 +		};
    1.93 +	}
    1.94 +
    1.95 +#endif /*__SCMCONFIG_H_INCLUDED__*/