datacommsserver/esockserver/ssock/ss_sapfactshim.cpp
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2004-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 /**
       
    17  @file SS_SAPFACTSHIM.CPP
       
    18 */
       
    19 
       
    20 #define SYMBIAN_NETWORKING_UPS
       
    21 
       
    22 #include "ss_sapfactshim.h"
       
    23 #include <comms-infras/ss_log.h>
       
    24 #include <ss_glob.h>
       
    25 #include <comms-infras/ss_sapshim.h>
       
    26 
       
    27 #include <comms-infras/ss_nodemessages_serviceprovider.h>
       
    28 
       
    29 using namespace ESock;
       
    30 using namespace Factories;
       
    31 using namespace Messages;
       
    32 
       
    33 MFactoryQuery::TMatchResult XProviderFactoryQueryProvider::Match(TFactoryObjectInfo& aProviderInfo)
       
    34 	{
       
    35 	CTransportFlowShim* prov = static_cast<CTransportFlowShim*>(aProviderInfo.iInfo.iFactoryObject);
       
    36 	return prov->Provider() == &iSSP ? EMatch : EContinue;
       
    37 	}
       
    38 
       
    39 // ==============================================================================================
       
    40 
       
    41 CTransportFlowShimFactory* CTransportFlowShimFactory::NewL(TUid aFactoryId, CSubConnectionFlowFactoryContainer& aParentContainer)
       
    42 	{
       
    43 	CTransportFlowShimFactory* fact = new (ELeave) CTransportFlowShimFactory(aFactoryId, aParentContainer);
       
    44 	CleanupStack::PushL(fact);
       
    45 	fact->ConstructL();
       
    46 	CleanupStack::Pop(fact);
       
    47 	return fact;
       
    48 	}
       
    49 
       
    50 CTransportFlowShimFactory::CTransportFlowShimFactory(TUid aFactoryId, CSubConnectionFlowFactoryContainer& aParentContainer)
       
    51  : CSubConnectionFlowFactoryBase(aFactoryId, aParentContainer)
       
    52  	{
       
    53  	}
       
    54 
       
    55 CTransportFlowShimFactory::~CTransportFlowShimFactory()
       
    56 	{
       
    57  	}
       
    58 
       
    59 CSubConnectionFlowBase* CTransportFlowShimFactory::DoCreateFlowL(CProtocolIntfBase* aProtocolIntf, TFactoryQueryBase& aQuery)
       
    60 	{
       
    61 	const TDefaultFlowFactoryQuery& query = static_cast<const TDefaultFlowFactoryQuery&>(aQuery);
       
    62 #ifdef SYMBIAN_NETWORKING_UPS	
       
    63 	return CUpsTransportFlowShim::NewL(*this, query.iSCprId, aProtocolIntf);
       
    64 #else
       
    65 	return CTransportFlowShim::NewL(*this, query.iSCprId, aProtocolIntf);
       
    66 #endif
       
    67 	}
       
    68 
       
    69 ACommsFactoryNodeId* CTransportFlowShimFactory::DoFindOrCreateObjectL(TFactoryQueryBase& aQuery)
       
    70 	{
       
    71 	const TDefaultFlowFactoryQuery& query = static_cast<const TDefaultFlowFactoryQuery&>(aQuery);	
       
    72 
       
    73 	if(query.iMessageId == TCFServiceProvider::TCommsBinderRequest::Id())
       
    74 		{
       
    75 		return DoCreateObjectL(aQuery);
       
    76 		}
       
    77 	return NULL;
       
    78 	}
       
    79 
       
    80