os/persistentdata/loggingservices/eventlogger/LogServ/inc/LogServOperationBase.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     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 #ifndef __LOGSERVOPERATIONBASE_H__
    17 #define __LOGSERVOPERATIONBASE_H__
    18 
    19 #include <e32base.h>
    20 #include "LogServDefs.h"
    21 #include "LogCliServShared.h"
    22 #include "logpackage.h"
    23 
    24 // Classes referenced
    25 class MLogServTaskInterface;
    26 class MLogServOperationManager;
    27 
    28 /**
    29 Base class for LogEng server operations.
    30 Maintains a copy of the original RMessage2 object.
    31 
    32 @see MLogServOperationManager
    33 @see MLogServTaskInterface
    34  
    35 @internalComponent
    36 */
    37 class CLogServOperationBase : public CBase
    38 	{
    39 public:
    40 	enum TCompletionStatus
    41 		{
    42 		EOperationComplete = 0,
    43 		EOperationCompleteWaitForClient
    44 		};
    45 
    46 protected:
    47 	CLogServOperationBase(MLogServTaskInterface& aTaskInterface, 
    48                           MLogServOperationManager& aOperationManager, 
    49                           const RMessage2& aMessage, 
    50                           CLogPackage& aPackage,
    51                           const TLogClientServerData& aClientServerData,
    52                           TLogServSessionId aSessionId);
    53 
    54 public:
    55 	~CLogServOperationBase();
    56 
    57 public: // FROM CLogServOperationBase
    58 	virtual void StartL(TRequestStatus& aStatus)=0;
    59 	virtual void WriteL(const RMessage2& aMessage);
    60 	virtual TCompletionStatus CompleteProcessingL(TInt aFinalCompletionCode);
    61 
    62 public:
    63 	void Complete(TInt aCompletionCode);
    64 	inline const TLogClientServerData& ClientServerData() const;
    65 	inline void Cancel();
    66 	inline TBool HaveMessagePointer() const;
    67 	inline void ClearMessagePointer();
    68 	inline TLogOperationId Id() const;
    69 	inline CLogPackage& Package();
    70 	inline MLogServTaskInterface& TaskInterface() const;
    71 	inline MLogServOperationManager& OperationManager() const;
    72 	inline TLogOperationType Type() const;
    73 	inline TLogServSessionId SessionId();
    74 	static TUint QueueOffset();
    75 	inline void SetMessageCompletion(const TBool aMessageCompletion);
    76 
    77 protected:
    78 	inline RMessage2& Message();
    79 
    80 private:
    81 	MLogServTaskInterface& iTaskInterface;
    82 	MLogServOperationManager& iOperationManager;
    83 	CLogPackage& iPackage;
    84 	RMessage2 iMessage;
    85 	TLogClientServerData iClientServerData;
    86 	TLogServSessionId iSessionId;
    87 	TSglQueLink iServerLink;
    88 	TBool iMessageCompletion;
    89 	};
    90 
    91 
    92 #include "LogServOperationBase.inl"
    93 
    94 #endif