os/persistentdata/loggingservices/eventlogger/LogServ/inc/LogServOperationBase.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/loggingservices/eventlogger/LogServ/inc/LogServOperationBase.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,94 @@
     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 +#ifndef __LOGSERVOPERATIONBASE_H__
    1.20 +#define __LOGSERVOPERATIONBASE_H__
    1.21 +
    1.22 +#include <e32base.h>
    1.23 +#include "LogServDefs.h"
    1.24 +#include "LogCliServShared.h"
    1.25 +#include "logpackage.h"
    1.26 +
    1.27 +// Classes referenced
    1.28 +class MLogServTaskInterface;
    1.29 +class MLogServOperationManager;
    1.30 +
    1.31 +/**
    1.32 +Base class for LogEng server operations.
    1.33 +Maintains a copy of the original RMessage2 object.
    1.34 +
    1.35 +@see MLogServOperationManager
    1.36 +@see MLogServTaskInterface
    1.37 + 
    1.38 +@internalComponent
    1.39 +*/
    1.40 +class CLogServOperationBase : public CBase
    1.41 +	{
    1.42 +public:
    1.43 +	enum TCompletionStatus
    1.44 +		{
    1.45 +		EOperationComplete = 0,
    1.46 +		EOperationCompleteWaitForClient
    1.47 +		};
    1.48 +
    1.49 +protected:
    1.50 +	CLogServOperationBase(MLogServTaskInterface& aTaskInterface, 
    1.51 +                          MLogServOperationManager& aOperationManager, 
    1.52 +                          const RMessage2& aMessage, 
    1.53 +                          CLogPackage& aPackage,
    1.54 +                          const TLogClientServerData& aClientServerData,
    1.55 +                          TLogServSessionId aSessionId);
    1.56 +
    1.57 +public:
    1.58 +	~CLogServOperationBase();
    1.59 +
    1.60 +public: // FROM CLogServOperationBase
    1.61 +	virtual void StartL(TRequestStatus& aStatus)=0;
    1.62 +	virtual void WriteL(const RMessage2& aMessage);
    1.63 +	virtual TCompletionStatus CompleteProcessingL(TInt aFinalCompletionCode);
    1.64 +
    1.65 +public:
    1.66 +	void Complete(TInt aCompletionCode);
    1.67 +	inline const TLogClientServerData& ClientServerData() const;
    1.68 +	inline void Cancel();
    1.69 +	inline TBool HaveMessagePointer() const;
    1.70 +	inline void ClearMessagePointer();
    1.71 +	inline TLogOperationId Id() const;
    1.72 +	inline CLogPackage& Package();
    1.73 +	inline MLogServTaskInterface& TaskInterface() const;
    1.74 +	inline MLogServOperationManager& OperationManager() const;
    1.75 +	inline TLogOperationType Type() const;
    1.76 +	inline TLogServSessionId SessionId();
    1.77 +	static TUint QueueOffset();
    1.78 +	inline void SetMessageCompletion(const TBool aMessageCompletion);
    1.79 +
    1.80 +protected:
    1.81 +	inline RMessage2& Message();
    1.82 +
    1.83 +private:
    1.84 +	MLogServTaskInterface& iTaskInterface;
    1.85 +	MLogServOperationManager& iOperationManager;
    1.86 +	CLogPackage& iPackage;
    1.87 +	RMessage2 iMessage;
    1.88 +	TLogClientServerData iClientServerData;
    1.89 +	TLogServSessionId iSessionId;
    1.90 +	TSglQueLink iServerLink;
    1.91 +	TBool iMessageCompletion;
    1.92 +	};
    1.93 +
    1.94 +
    1.95 +#include "LogServOperationBase.inl"
    1.96 +
    1.97 +#endif