os/persistentdata/loggingservices/eventlogger/LogWrap/src/LOGACT.CPP
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/loggingservices/eventlogger/LogWrap/src/LOGACT.CPP	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,79 @@
     1.4 +// Copyright (c) 2002-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 +//
    1.18 +
    1.19 +#include <logwrap.h>
    1.20 +#include "LOGPANIC.H"
    1.21 +
    1.22 +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS 
    1.23 +/**
    1.24 +@internalAll
    1.25 +*/
    1.26 +const TInt KLogActiveDoNotCompleteIfActive = KMaxTInt-1;
    1.27 +
    1.28 +#endif
    1.29 +
    1.30 +EXPORT_C CLogActive::CLogActive(TInt aPriority)
    1.31 +: CActive(aPriority)
    1.32 +	{
    1.33 +	CActiveScheduler::Add(this);
    1.34 +	}
    1.35 +
    1.36 +
    1.37 +EXPORT_C CLogActive::~CLogActive()
    1.38 +	{
    1.39 +	}
    1.40 +
    1.41 +EXPORT_C void CLogActive::Queue(TRequestStatus& aStatus)
    1.42 +	{
    1.43 +	__ASSERT_DEBUG(iReport==NULL, Panic(ELogAlreadyActive));
    1.44 +
    1.45 +	aStatus=KRequestPending;
    1.46 +	iReport=&aStatus;
    1.47 +	}
    1.48 +
    1.49 +EXPORT_C void CLogActive::DoCancel()
    1.50 +	{
    1.51 +	TInt result=KErrCancel;
    1.52 +	Complete(result);
    1.53 +	}
    1.54 +
    1.55 +EXPORT_C void CLogActive::RunL()
    1.56 +	{
    1.57 +	TInt status=iStatus.Int();
    1.58 +	if (status>=KErrNone)
    1.59 +		{
    1.60 +		TRAPD(error,DoRunL());
    1.61 +		__ASSERT_DEBUG(error==KErrNone || !IsActive(), User::Invariant());
    1.62 +		if (IsActive())	
    1.63 +			return;
    1.64 +		status=error;
    1.65 +		}
    1.66 +	Complete(status);
    1.67 +	}
    1.68 +
    1.69 +EXPORT_C void CLogActive::Complete(TInt aStatus)
    1.70 +	{
    1.71 +	if (iReport)
    1.72 +		{
    1.73 +		DoComplete(aStatus);
    1.74 +		if (IsActive() && aStatus == KLogActiveDoNotCompleteIfActive)
    1.75 +			return;
    1.76 +		User::RequestComplete(iReport, aStatus);
    1.77 +		}
    1.78 +	}
    1.79 +
    1.80 +EXPORT_C void CLogActive::DoComplete(TInt&)
    1.81 +	{
    1.82 +	}