loggingservices/eventlogger/LogServ/src/LogServOperationBase.cpp
changeset 0 08ec8eefde2f
child 40 b8bdbc8f59c7
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 2002-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 //
       
    15 
       
    16 #include "LogServOperationBase.h"
       
    17 #include "logservpanic.h"
       
    18 #include "LogServOperationManager.h"
       
    19 
       
    20 
       
    21 CLogServOperationBase::CLogServOperationBase(MLogServTaskInterface& aTaskInterface, 
       
    22 											 MLogServOperationManager& aOperationManager, 
       
    23 											 const RMessage2& aMessage, 
       
    24 											 CLogPackage& aPackage,
       
    25 					                         const TLogClientServerData& aClientServerData,
       
    26 					                         TLogServSessionId aSessionId) :
       
    27 	iTaskInterface(aTaskInterface), 
       
    28 	iOperationManager(aOperationManager), 
       
    29 	iPackage(aPackage), 
       
    30 	iMessage(aMessage),
       
    31 	iClientServerData(aClientServerData),
       
    32 	iSessionId(aSessionId)
       
    33 	{
       
    34 	// Queue this operations
       
    35 	OperationManager().OMOperationQueueAdd(*this);
       
    36 	}
       
    37 
       
    38 CLogServOperationBase::~CLogServOperationBase()
       
    39 	{
       
    40 	// Dequeue this operations
       
    41 	OperationManager().OMOperationQueueRemove(*this);
       
    42 	}
       
    43 
       
    44 //
       
    45 //	By default operations don't write back to the client
       
    46 //
       
    47 void CLogServOperationBase::WriteL(const RMessage2& /*aMessage*/)
       
    48 	{
       
    49 	}
       
    50 
       
    51 //
       
    52 //	Finish processing for this operation
       
    53 //
       
    54 CLogServOperationBase::TCompletionStatus CLogServOperationBase::CompleteProcessingL(TInt /*aFinalCompletionCode*/)
       
    55 	{
       
    56 	Complete(KErrNone);
       
    57 	//
       
    58 	return CLogServOperationBase::EOperationComplete;
       
    59 	}
       
    60 
       
    61 //
       
    62 //	Complete the client request
       
    63 //
       
    64 void CLogServOperationBase::Complete(TInt aCompletionCode)
       
    65 	{
       
    66 	__ASSERT_ALWAYS(iMessage != RMessage2(), Panic(ELogNoOutstandingAsyncRequest));
       
    67 	iMessage.Complete(aCompletionCode);
       
    68 
       
    69 	// Unnecessary?
       
    70 	iMessage = RMessage2();
       
    71 	}
       
    72 
       
    73 //
       
    74 //	Return the offset of this item within a containing queue
       
    75 //
       
    76 TUint CLogServOperationBase::QueueOffset()
       
    77 	{
       
    78 	return _FOFF(CLogServOperationBase, iServerLink);
       
    79 	}
       
    80