sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // e32test\resourceman\resourceman_psl\rescontrol_extended_psl.h sl@0: // sl@0: // sl@0: sl@0: #ifndef __RESCONTROL_EXTENDED_PSL_H__ sl@0: #define __RESCONTROL_EXTENDED_PSL_H__ sl@0: sl@0: //Macro to establish dependency between the specified resource sl@0: #define CREATE_DEPENDENCY_BETWEEN_NODES(pN1, pN2, pRes1, pRes2, priRes1, priRes2) \ sl@0: pN1->iPriority = priRes1; \ sl@0: pN1->iResource = pRes1; \ sl@0: pN1->iPropagatedLevel = 0; \ sl@0: pN1->iVisited = EFalse; \ sl@0: pN2->iPriority = priRes2; \ sl@0: pN2->iResource = pRes2; \ sl@0: pN2->iPropagatedLevel = 0; \ sl@0: pN2->iVisited = EFalse; \ sl@0: pN1->iResource->AddNode(pN2); \ sl@0: pN2->iResource->AddNode(pN1); sl@0: sl@0: //class definition for multilevel single positive sense dependent resource sl@0: NONSHARABLE_CLASS(DMLSLGLSPDependResource) : public DStaticPowerResourceD sl@0: { sl@0: public: sl@0: DMLSLGLSPDependResource(); sl@0: TInt DoRequest(TPowerRequest &req); sl@0: TInt GetInfo(TDes8* aInfo) const; sl@0: TChangePropagationStatus TranslateDependentState(TInt aDepId, TInt aDepState, TInt& aResState); sl@0: private: sl@0: TInt iMinLevel; sl@0: TInt iMaxLevel; sl@0: TInt iCurrentLevel; sl@0: TInt iBlockTime; //Time duration the thread will be blocked. sl@0: }; sl@0: sl@0: //class definition for multilevel single negative sense dependent resource sl@0: NONSHARABLE_CLASS(DMLSIGLSNDependResource) : public DStaticPowerResourceD sl@0: { sl@0: public: sl@0: DMLSIGLSNDependResource(); sl@0: TInt DoRequest(TPowerRequest &req); sl@0: TInt GetInfo(TDes8* aInfo) const; sl@0: TChangePropagationStatus TranslateDependentState(TInt aDepId, TInt aDepState, TInt& aResState); sl@0: private: sl@0: TInt iMinLevel; sl@0: TInt iMaxLevel; sl@0: TInt iCurrentLevel; sl@0: TInt iBlockTime; //Time duration the thread will be blocked. sl@0: }; sl@0: sl@0: //class definition for binary single postive sense dependent resource sl@0: NONSHARABLE_CLASS(DBSIGLSPDependResource) : public DStaticPowerResourceD sl@0: { sl@0: public: sl@0: DBSIGLSPDependResource(); sl@0: TInt DoRequest(TPowerRequest &req); sl@0: TInt GetInfo(TDes8* aInfo) const; sl@0: TChangePropagationStatus TranslateDependentState(TInt aDepId, TInt aDepState, TInt& aResState); sl@0: private: sl@0: TInt iMinLevel; sl@0: TInt iMaxLevel; sl@0: TInt iCurrentLevel; sl@0: TInt iBlockTime; //Time duration the thread will be blocked. sl@0: }; sl@0: sl@0: //class definition for multilevel shared postive sense dependent resource sl@0: NONSHARABLE_CLASS(DMLSHIGLSPDependResource) : public DStaticPowerResourceD sl@0: { sl@0: public: sl@0: DMLSHIGLSPDependResource(); sl@0: TInt DoRequest(TPowerRequest &req); sl@0: TInt GetInfo(TDes8* aInfo) const; sl@0: TChangePropagationStatus TranslateDependentState(TInt aDepId, TInt aDepState, TInt& aResState); sl@0: private: sl@0: TInt iMinLevel; sl@0: TInt iMaxLevel; sl@0: TInt iCurrentLevel; sl@0: TInt iBlockTime; //Time duration the thread will be blocked. sl@0: }; sl@0: sl@0: //class definition for binary shared negative sense dependent resource sl@0: NONSHARABLE_CLASS(DBSHLGLSNDependResource) : public DStaticPowerResourceD sl@0: { sl@0: public: sl@0: DBSHLGLSNDependResource(); sl@0: TInt DoRequest(TPowerRequest &req); sl@0: TInt GetInfo(TDes8* aInfo) const; sl@0: TChangePropagationStatus TranslateDependentState(TInt aDepId, TInt aDepState, TInt& aResState); sl@0: private: sl@0: TInt iMinLevel; sl@0: TInt iMaxLevel; sl@0: TInt iCurrentLevel; sl@0: TInt iBlockTime; //Time duration the thread will be blocked. sl@0: }; sl@0: sl@0: //class definition for multilevel shared negative sense dependent resource sl@0: NONSHARABLE_CLASS(DMLSHLGLSNDependResource) : public DStaticPowerResourceD sl@0: { sl@0: public: sl@0: DMLSHLGLSNDependResource(); sl@0: TInt DoRequest(TPowerRequest &req); sl@0: TInt GetInfo(TDes8* aInfo) const; sl@0: TChangePropagationStatus TranslateDependentState(TInt aDepId, TInt aDepState, TInt& aResState); sl@0: private: sl@0: TInt iMinLevel; sl@0: TInt iMaxLevel; sl@0: TInt iCurrentLevel; sl@0: TInt iBlockTime; //Time duration the thread will be blocked. sl@0: }; sl@0: sl@0: //class definition for multilevel shared custom sense dependent resource sl@0: NONSHARABLE_CLASS(DMLSHLGLSCDependResource) : public DStaticPowerResourceD sl@0: { sl@0: public: sl@0: DMLSHLGLSCDependResource(); sl@0: TInt DoRequest(TPowerRequest &req); sl@0: TInt GetInfo(TDes8* aInfo) const; sl@0: TChangePropagationStatus TranslateDependentState(TInt aDepId, TInt aDepState, TInt& aResState); sl@0: private: sl@0: TInt iMinLevel; sl@0: TInt iMaxLevel; sl@0: TInt iCurrentLevel; sl@0: TInt iBlockTime; //Time duration the thread will be blocked. sl@0: }; sl@0: sl@0: #endif //__RESCONTROL_EXTENDED_PSL_H__