www.pudn.com > symbianex.rar > CMemoryManagement.cpp


/* Copyright (c) 2006, Nokia Mobile Phones. All rights reserved */ 
 
 
#include "CMemoryManagement.h" 
#include  
 
////////////////////////////////////////////////////////////////////////////// 
// 
// -----> CMemoryManagement (implementation) 
// 
////////////////////////////////////////////////////////////////////////////// 
 
CMemoryManagement* CMemoryManagement::NewL(CConsoleBase* aConsole, TText aTText,TInt aTInt, TReal aTReal) 
{ 
    CMemoryManagement* self = NewLC(aConsole,aTText,aTInt,aTReal); 
    CleanupStack::Pop(self); 
    return self; 
} 
 
CMemoryManagement* CMemoryManagement::NewLC(CConsoleBase* aConsole, TText aTText,TInt aTInt, TReal aTReal) 
{ 
    CMemoryManagement* self = new(ELeave)CMemoryManagement(); 
    CleanupStack::PushL(self); 
	self->ConstructL(aConsole,aTText,aTInt,aTReal); 
    return self; 
} 
 
void CMemoryManagement::ConstructL(CConsoleBase* aConsole, TText aTText,TInt aTInt, TReal aTReal) 
{ 
	iConsole = aConsole; 
	iTInt = aTInt; 
	iTReal = aTReal; 
	iTText = aTText;	 
} 
 
CMemoryManagement::CMemoryMamagement() 
{ 
} 
CMemoryManagement::~CMemoryManagement() 
{ 
} 
 
TReal CMemoryManagement::Division() 
{ 
   return iTReal/2; 
} 
 
TAny CMemoryManagement::Print()   //void CMemoryManagement::Print(); 
{ 
 
   _LIT(KTINT,"The TInt value is %d"); 
   iConsole->Printf(KTINT,iTInt); 
   iConsole->Printf(_L("\n")); 
 
   _LIT(KTREAL,"The TReal value is %f"); 
   iConsole->Printf(KTREAL,iTReal); 
   iConsole->Printf(_L("\n")); 
 
   _LIT(KTTEXT,"The TTEXT value is %c"); 
   iConsole->Printf(KTTEXT,iTText); 
   iConsole->Printf(_L("\n")); 
 
   TRAPD(error,Division()) 
	   if (error) 
	   { 
		   iConsole->Printf(_L("This is a error!!")); 
	       iConsole->Printf(_L("\n")); 
	   } 
	   else  
	   { 
		   _LIT(KRIGHT,"No ELeave!! Value is %f"); 
		   TReal i; 
		   i = Division(); 
		   iConsole->Printf(KRIGHT,i); 
		   iConsole->Printf(_L("\n")); 
	   } 
};