sdkcreationmw/sdkruntimes/new_wsock_3pc/src/winsockflowfactory.cpp
changeset 2 82fb8aa91b2c
equal deleted inserted replaced
1:ac50fd48361b 2:82fb8aa91b2c
       
     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 the License "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 // Implements the factory class which is used to instantiate the WINSOCK NIF.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20 */
       
    21 
       
    22 #include "WinsockFlowFactory.h"
       
    23 #include "WinsockFlow.h"
       
    24 #include "../inc/winsockUid.h"
       
    25 #include <es_mbuf.h>
       
    26 //#include "bttlog.h"
       
    27 
       
    28 using namespace ESock;
       
    29 
       
    30 // =====================================================================================
       
    31 //
       
    32 // RawIP Flow Factory
       
    33 //
       
    34 
       
    35 CWinsockFlowFactory* CWinsockFlowFactory::NewL(TAny* aConstructionParameters)
       
    36 /**
       
    37 Constructs a Default SubConnection Flow Factory
       
    38 
       
    39 @param aConstructionParameters construction data passed by ECOM
       
    40 
       
    41 @returns pointer to a constructed factory
       
    42 */
       
    43 	{
       
    44 	
       
    45 		CWinsockFlowFactory* ptr = new (ELeave) CWinsockFlowFactory(TUid::Uid(KWinsockFlowUid), *(reinterpret_cast<CSubConnectionFlowFactoryContainer*>(aConstructionParameters)));
       
    46 	return ptr;
       
    47 	}
       
    48 
       
    49 
       
    50 CWinsockFlowFactory::CWinsockFlowFactory(TUid aFactoryId, CSubConnectionFlowFactoryContainer& aParentContainer)
       
    51 	: CSubConnectionFlowFactoryBase(aFactoryId, aParentContainer)
       
    52 /**
       
    53 Default SubConnection Flow Factory Constructor
       
    54 
       
    55 @param aFactoryId ECOM Implementation Id
       
    56 @param aParentContainer Object Owner
       
    57 */
       
    58 	{
       
    59 	}
       
    60 
       
    61 
       
    62 CSubConnectionFlowBase* CWinsockFlowFactory::DoCreateFlowL(ESock::CProtocolIntfBase* aProtocol, ESock::TFactoryQueryBase& aQuery)
       
    63 	{
       
    64     const TDefaultFlowFactoryQuery& query = static_cast<const TDefaultFlowFactoryQuery&>(aQuery);
       
    65     CWinsockFlow* s = new (ELeave) CWinsockFlow(*this, query.iSCprId, aProtocol);
       
    66     return s;
       
    67 	}
       
    68