os/ossrv/lowlevellibsandfws/apputils/src/BASCHED.CPP
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/lowlevellibsandfws/apputils/src/BASCHED.CPP	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,136 @@
     1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// Started by DWW, March 1997
    1.18 +// BAFL specialization of CActiveScheduler
    1.19 +// 
    1.20 +//
    1.21 +
    1.22 +#include <basched.h>
    1.23 +#include <baerrhan.h>
    1.24 +
    1.25 +/**
    1.26 + * @publishedAll
    1.27 + */
    1.28 +EXPORT_C CBaActiveScheduler::CBaActiveScheduler()
    1.29 +	{
    1.30 +	}
    1.31 +
    1.32 +/**
    1.33 + * @publishedAll
    1.34 + */
    1.35 +EXPORT_C CBaActiveScheduler::~CBaActiveScheduler()
    1.36 +	{
    1.37 +	}
    1.38 +
    1.39 +/**
    1.40 + * @internalAll
    1.41 + */
    1.42 +EXPORT_C void CBaActiveScheduler::Exit()
    1.43 +	{ // static
    1.44 +	User::Leave(KLeaveExit);
    1.45 +	}
    1.46 +
    1.47 +/**
    1.48 + * @internalAll
    1.49 + */
    1.50 +EXPORT_C void CBaActiveScheduler::Error(TInt aError) const
    1.51 +	{
    1.52 +	if (aError==KLeaveExit)
    1.53 +		User::Leave(KLeaveExit);
    1.54 +	DisplayError(aError);
    1.55 +	}
    1.56 +
    1.57 +/**
    1.58 + * @internalAll
    1.59 + */
    1.60 +EXPORT_C void CBaActiveScheduler::DisplayError(TInt /*aError*/) const
    1.61 +	{ // for subclassers to replace
    1.62 +	}
    1.63 +
    1.64 +/**
    1.65 + * @internalAll
    1.66 + */
    1.67 +EXPORT_C void CBaActiveScheduler::DisplayExtendedError(TUid aComponent,TInt aErrorNumber)
    1.68 +	{ // static
    1.69 +	CBaActiveScheduler* pS=((CBaActiveScheduler*)CActiveScheduler::Current());
    1.70 +	pS->iExtendedError.iInformation=EFalse;
    1.71 +	pS->iExtendedError.iComponent=aComponent;
    1.72 +	pS->iExtendedError.iErrorNumber=aErrorNumber;
    1.73 +	pS->DisplayError(KErrExtended);
    1.74 +	}
    1.75 +
    1.76 +EXPORT_C void CBaActiveScheduler::LeaveNoAlert()
    1.77 +	{ // static
    1.78 +	User::Leave(KLeaveWithoutAlert);
    1.79 +	}
    1.80 +
    1.81 +/**
    1.82 + * @internalAll
    1.83 + */
    1.84 +EXPORT_C void CBaActiveScheduler::LeaveForAlert(TUid aComponent,TInt aErrorNumber)
    1.85 +	{ // static
    1.86 +	ExtendedLeave(aComponent,aErrorNumber,EFalse);
    1.87 +	}
    1.88 +
    1.89 +/**
    1.90 + * @internalAll
    1.91 + */
    1.92 +EXPORT_C void CBaActiveScheduler::LeaveForInfoPrint(TUid aComponent,TInt aErrorNumber)
    1.93 +	{ // static
    1.94 +	ExtendedLeave(aComponent,aErrorNumber,ETrue);
    1.95 +	}
    1.96 +
    1.97 +/**
    1.98 + * @internalAll
    1.99 + */
   1.100 +EXPORT_C void CBaActiveScheduler::LeaveForErrorHandler(const CBaErrorHandler *aHandler)
   1.101 +	{ // static
   1.102 +	ExtendedLeave(KUidBaflErrorHandler,(TInt)(aHandler),EFalse);
   1.103 +	}
   1.104 +
   1.105 +void CBaActiveScheduler::ExtendedLeave(TUid aComponent,TInt aErrorNumber,TBool aLeaveForInfoPrint)
   1.106 +	{ // static
   1.107 +	CBaActiveScheduler* pS=((CBaActiveScheduler*)CActiveScheduler::Current());
   1.108 +	pS->iExtendedError.iInformation=aLeaveForInfoPrint;
   1.109 +	pS->iExtendedError.iComponent=aComponent;
   1.110 +	pS->iExtendedError.iErrorNumber=aErrorNumber;
   1.111 +	User::Leave(KErrExtended);
   1.112 +	}
   1.113 +
   1.114 +/**
   1.115 + * @internalAll
   1.116 + */
   1.117 +EXPORT_C const SExtendedError& CBaActiveScheduler::ExtendedError()
   1.118 +	{
   1.119 +	CBaActiveScheduler* pS=((CBaActiveScheduler*)CActiveScheduler::Current());
   1.120 +	return(pS->iExtendedError);
   1.121 +	}
   1.122 +
   1.123 +/**
   1.124 + * @internalAll
   1.125 + */
   1.126 +EXPORT_C void CBaActiveScheduler::Reserved_1()
   1.127 +//
   1.128 +// Reserved for future development
   1.129 +//
   1.130 +	{}
   1.131 +
   1.132 +/**
   1.133 + * @internalAll
   1.134 + */
   1.135 +EXPORT_C void CBaActiveScheduler::Reserved_2()
   1.136 +//
   1.137 +// Reserved for future development
   1.138 +//
   1.139 +	{}