diff -r 000000000000 -r 3553901f7fa8 telephonyprotocols/rawipnif/inc/BinderBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/telephonyprotocols/rawipnif/inc/BinderBase.h Tue Feb 02 01:41:59 2010 +0200 @@ -0,0 +1,89 @@ +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// This file defines the base class for the protocol interface classes. +// +// + +/** + @file +*/ + +#ifndef BINDERBASE_H__ +#define BINDERBASE_H__ + +#include +#include +#include +#include +#include "Constants.h" +#include + +class CRawIPFlow; +class CBttLogger; +class CRawIpProvision; +class CRawIPFlow; + +class CBinderBase : public CBase, public ESock::MLowerDataSender, public ESock::MLowerControl + { +public: + friend class CRawIPFlow; + CBinderBase(CRawIPFlow& aFlow, CBttLogger* aTheLogger); + virtual ~CBinderBase(); + +public: + // from ESock::MLowerControl + virtual TInt BlockFlow(ESock::MLowerControl::TBlockOption aOption); + virtual void ChangeFlow(CRawIPFlow& aNewFlow); + + // + // Utility calls from Flow during binding + // + ESock::MLowerDataSender* Bind(ESock::MUpperDataReceiver* aUpperReceiver, ESock::MUpperControl* aUpperControl); + void Unbind(ESock::MUpperDataReceiver* aUpperReceiver, ESock::MUpperControl* aUpperControl); + + // + virtual void StartSending(); + virtual void SetProvision(const CIPConfig& aProvision) = 0; + +public: + virtual void UpdateContextConfigL(const TPacketDataConfigBase& aConfig); + virtual void UpdateConnectionSpeed(TUint aConnectionSpeed); + + virtual TBool WantsProtocol(TUint16 aProtocolCode)=0; + virtual void Process(RMBufChain& aPdu) = 0; + +public: + inline CRawIPFlow& GetFlow(); + +protected: + CRawIPFlow* iFlow; + ESock::MUpperControl* iUpperControl; + ESock::MUpperDataReceiver* iUpperReceiver; + + CBttLogger* iTheLogger; + }; + + +CRawIPFlow& CBinderBase::GetFlow() +/** + * Returns to reference to RawIPFlow + * + * @return reference to CRawIPFlow class + */ + { + ASSERT(iFlow); + return *iFlow; + } + +#endif