networkcontrol/ipnetworklayer/src/IPProtoSCPRFactory.cpp
changeset 0 af10295192d8
child 37 052078dda061
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     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 // ipprotodeftscprfactory.cpp
       
    15 // IPProto SubConnection Provider factory class definition.
       
    16 // 
       
    17 //
       
    18 
       
    19 /**
       
    20  @file
       
    21  @internalComponent
       
    22 */
       
    23 
       
    24 #include "ipprotomessages.h"
       
    25 #include "IPProtoSCPRFactory.h"
       
    26 #include "ipprotodeftscpr.h"
       
    27 #include "IPProtoSCPR.h"
       
    28 #include <comms-infras/ss_msgintercept.h>
       
    29 
       
    30 using namespace ESock;
       
    31 
       
    32 //-=========================================================
       
    33 //
       
    34 // CIPProtoSubConnectionProviderFactory methods
       
    35 //
       
    36 //-=========================================================	
       
    37 CIPProtoSubConnectionProviderFactory* CIPProtoSubConnectionProviderFactory::NewL(TAny* aParentContainer)
       
    38     {
       
    39     return new (ELeave) CIPProtoSubConnectionProviderFactory(TUid::Uid(CIPProtoSubConnectionProviderFactory::iUid), 
       
    40                                             *reinterpret_cast<ESock::CSubConnectionFactoryContainer*>(aParentContainer));
       
    41     }
       
    42     
       
    43 CIPProtoSubConnectionProviderFactory::CIPProtoSubConnectionProviderFactory(TUid aFactoryId, ESock::CSubConnectionFactoryContainer& aParentContainer)
       
    44 	: CSubConnectionProviderFactoryBase(aFactoryId, aParentContainer)
       
    45     {  
       
    46     }
       
    47 
       
    48 CIPProtoSubConnectionProviderFactory::~CIPProtoSubConnectionProviderFactory()
       
    49     {
       
    50     }
       
    51 
       
    52 ACommsFactoryNodeId* CIPProtoSubConnectionProviderFactory::DoCreateObjectL(TFactoryQueryBase& aQuery)
       
    53     {
       
    54     const TDefaultSCPRFactoryQuery& query = static_cast<const TDefaultSCPRFactoryQuery&>(aQuery);
       
    55     CSubConnectionProviderBase* provider = NULL;
       
    56     if (query.iSCPRType == RSubConnection::EAttachToDefault)
       
    57         {
       
    58         provider = CIPProtoDeftSubConnectionProvider::NewL(*this);
       
    59 		ESOCK_DEBUG_REGISTER_GENERAL_NODE(iUid, provider);
       
    60         }
       
    61     else if (query.iSCPRType == RSubConnection::ECreateNew)
       
    62         {
       
    63         provider = CIPProtoSubConnectionProvider::NewL(*this);
       
    64 		ESOCK_DEBUG_REGISTER_GENERAL_NODE(iUid, provider);
       
    65         }
       
    66     else
       
    67         {
       
    68         User::Leave(KErrNotSupported);
       
    69         }
       
    70     return provider;
       
    71     }
       
    72 
       
    73