telephonyprotocols/rawipnif/inc/BinderBase.h
changeset 0 3553901f7fa8
child 19 630d2f34d719
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2006-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 // This file defines the base class for the protocol interface classes.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20 */
       
    21 
       
    22 #ifndef BINDERBASE_H__
       
    23 #define BINDERBASE_H__
       
    24 
       
    25 #include <comms-infras/nifif.h>
       
    26 #include <es_mbuf.h>
       
    27 #include <comms-infras/ss_flowbinders.h>
       
    28 #include <comms-infras/linkprovision.h>
       
    29 #include "Constants.h"
       
    30 #include <comms-infras/es_protbinder.h>
       
    31 
       
    32 class CRawIPFlow;
       
    33 class CBttLogger;
       
    34 class CRawIpProvision;
       
    35 class CRawIPFlow;
       
    36 
       
    37 class CBinderBase : public CBase, public ESock::MLowerDataSender, public ESock::MLowerControl
       
    38 	{
       
    39 public:
       
    40 	friend class CRawIPFlow;
       
    41 	CBinderBase(CRawIPFlow& aFlow, CBttLogger* aTheLogger);
       
    42 	virtual ~CBinderBase();
       
    43 
       
    44 public:
       
    45 	// from ESock::MLowerControl
       
    46 	virtual TInt BlockFlow(ESock::MLowerControl::TBlockOption aOption);
       
    47 	virtual void ChangeFlow(CRawIPFlow& aNewFlow);
       
    48 
       
    49 	//
       
    50 	// Utility calls from Flow during binding
       
    51 	//
       
    52 	ESock::MLowerDataSender* Bind(ESock::MUpperDataReceiver* aUpperReceiver, ESock::MUpperControl* aUpperControl);
       
    53 	void Unbind(ESock::MUpperDataReceiver* aUpperReceiver, ESock::MUpperControl* aUpperControl);
       
    54 
       
    55 	//
       
    56 	virtual void StartSending();
       
    57 	virtual void SetProvision(const CIPConfig& aProvision) = 0;
       
    58 
       
    59 public:
       
    60 	virtual void UpdateContextConfigL(const TPacketDataConfigBase& aConfig);
       
    61 	virtual void UpdateConnectionSpeed(TUint aConnectionSpeed);
       
    62 
       
    63 	virtual TBool WantsProtocol(TUint16 aProtocolCode)=0;
       
    64 	virtual void Process(RMBufChain& aPdu) = 0; 
       
    65 
       
    66 public:
       
    67 	inline CRawIPFlow& GetFlow();
       
    68 
       
    69 protected:
       
    70 	CRawIPFlow* iFlow;
       
    71 	ESock::MUpperControl* iUpperControl;
       
    72 	ESock::MUpperDataReceiver* iUpperReceiver;
       
    73 
       
    74 	CBttLogger* iTheLogger;
       
    75 	};
       
    76 
       
    77 
       
    78 CRawIPFlow& CBinderBase::GetFlow()
       
    79 /**
       
    80  * Returns to reference to RawIPFlow
       
    81  *
       
    82  * @return reference to CRawIPFlow class
       
    83  */
       
    84 	{
       
    85 	ASSERT(iFlow);
       
    86 	return *iFlow;
       
    87 	}
       
    88 
       
    89 #endif