lowlevellibsandfws/apputils/src/BASCHED.CPP
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Started by DWW, March 1997
       
    15 // BAFL specialization of CActiveScheduler
       
    16 // 
       
    17 //
       
    18 
       
    19 #include <basched.h>
       
    20 #include <baerrhan.h>
       
    21 
       
    22 /**
       
    23  * @publishedAll
       
    24  */
       
    25 EXPORT_C CBaActiveScheduler::CBaActiveScheduler()
       
    26 	{
       
    27 	}
       
    28 
       
    29 /**
       
    30  * @publishedAll
       
    31  */
       
    32 EXPORT_C CBaActiveScheduler::~CBaActiveScheduler()
       
    33 	{
       
    34 	}
       
    35 
       
    36 /**
       
    37  * @internalAll
       
    38  */
       
    39 EXPORT_C void CBaActiveScheduler::Exit()
       
    40 	{ // static
       
    41 	User::Leave(KLeaveExit);
       
    42 	}
       
    43 
       
    44 /**
       
    45  * @internalAll
       
    46  */
       
    47 EXPORT_C void CBaActiveScheduler::Error(TInt aError) const
       
    48 	{
       
    49 	if (aError==KLeaveExit)
       
    50 		User::Leave(KLeaveExit);
       
    51 	DisplayError(aError);
       
    52 	}
       
    53 
       
    54 /**
       
    55  * @internalAll
       
    56  */
       
    57 EXPORT_C void CBaActiveScheduler::DisplayError(TInt /*aError*/) const
       
    58 	{ // for subclassers to replace
       
    59 	}
       
    60 
       
    61 /**
       
    62  * @internalAll
       
    63  */
       
    64 EXPORT_C void CBaActiveScheduler::DisplayExtendedError(TUid aComponent,TInt aErrorNumber)
       
    65 	{ // static
       
    66 	CBaActiveScheduler* pS=((CBaActiveScheduler*)CActiveScheduler::Current());
       
    67 	pS->iExtendedError.iInformation=EFalse;
       
    68 	pS->iExtendedError.iComponent=aComponent;
       
    69 	pS->iExtendedError.iErrorNumber=aErrorNumber;
       
    70 	pS->DisplayError(KErrExtended);
       
    71 	}
       
    72 
       
    73 EXPORT_C void CBaActiveScheduler::LeaveNoAlert()
       
    74 	{ // static
       
    75 	User::Leave(KLeaveWithoutAlert);
       
    76 	}
       
    77 
       
    78 /**
       
    79  * @internalAll
       
    80  */
       
    81 EXPORT_C void CBaActiveScheduler::LeaveForAlert(TUid aComponent,TInt aErrorNumber)
       
    82 	{ // static
       
    83 	ExtendedLeave(aComponent,aErrorNumber,EFalse);
       
    84 	}
       
    85 
       
    86 /**
       
    87  * @internalAll
       
    88  */
       
    89 EXPORT_C void CBaActiveScheduler::LeaveForInfoPrint(TUid aComponent,TInt aErrorNumber)
       
    90 	{ // static
       
    91 	ExtendedLeave(aComponent,aErrorNumber,ETrue);
       
    92 	}
       
    93 
       
    94 /**
       
    95  * @internalAll
       
    96  */
       
    97 EXPORT_C void CBaActiveScheduler::LeaveForErrorHandler(const CBaErrorHandler *aHandler)
       
    98 	{ // static
       
    99 	ExtendedLeave(KUidBaflErrorHandler,(TInt)(aHandler),EFalse);
       
   100 	}
       
   101 
       
   102 void CBaActiveScheduler::ExtendedLeave(TUid aComponent,TInt aErrorNumber,TBool aLeaveForInfoPrint)
       
   103 	{ // static
       
   104 	CBaActiveScheduler* pS=((CBaActiveScheduler*)CActiveScheduler::Current());
       
   105 	pS->iExtendedError.iInformation=aLeaveForInfoPrint;
       
   106 	pS->iExtendedError.iComponent=aComponent;
       
   107 	pS->iExtendedError.iErrorNumber=aErrorNumber;
       
   108 	User::Leave(KErrExtended);
       
   109 	}
       
   110 
       
   111 /**
       
   112  * @internalAll
       
   113  */
       
   114 EXPORT_C const SExtendedError& CBaActiveScheduler::ExtendedError()
       
   115 	{
       
   116 	CBaActiveScheduler* pS=((CBaActiveScheduler*)CActiveScheduler::Current());
       
   117 	return(pS->iExtendedError);
       
   118 	}
       
   119 
       
   120 /**
       
   121  * @internalAll
       
   122  */
       
   123 EXPORT_C void CBaActiveScheduler::Reserved_1()
       
   124 //
       
   125 // Reserved for future development
       
   126 //
       
   127 	{}
       
   128 
       
   129 /**
       
   130  * @internalAll
       
   131  */
       
   132 EXPORT_C void CBaActiveScheduler::Reserved_2()
       
   133 //
       
   134 // Reserved for future development
       
   135 //
       
   136 	{}