|
1 // Copyright (c) 2008-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 #include <comms-infras/ss_msgintercept.h> |
|
17 |
|
18 #include "upnpctrlscprfactory.h" |
|
19 #include "upnpctrlscpr.h" |
|
20 #include "upnpctrldeftscpr.h" |
|
21 |
|
22 #if defined __CFLOG_ACTIVE || defined SYMBIAN_TRACE_ENABLE |
|
23 #define KUPnPSCprFactoryTag KESockSubConnectionTag |
|
24 #endif |
|
25 |
|
26 using namespace ESock; |
|
27 |
|
28 CUPnPControlSubConnectionProviderFactory* CUPnPControlSubConnectionProviderFactory::NewL(TAny* aParentContainer) |
|
29 { |
|
30 return new (ELeave) CUPnPControlSubConnectionProviderFactory( |
|
31 TUid::Uid(CUPnPControlSubConnectionProviderFactory::iUid), |
|
32 *reinterpret_cast<CSubConnectionFactoryContainer*>(aParentContainer)); |
|
33 } |
|
34 |
|
35 CUPnPControlSubConnectionProviderFactory::CUPnPControlSubConnectionProviderFactory(TUid aFactoryId, CSubConnectionFactoryContainer& aParentContainer) |
|
36 : CSubConnectionProviderFactoryBase(aFactoryId, aParentContainer) |
|
37 { |
|
38 //LOG_NODE_CREATE(KUPnPSCprFactoryTag, CUPnPControlSubConnectionProviderFactory); |
|
39 } |
|
40 |
|
41 ACommsFactoryNodeId* CUPnPControlSubConnectionProviderFactory::DoCreateObjectL(TFactoryQueryBase& aQuery) |
|
42 { |
|
43 const TDefaultSCPRFactoryQuery& query = static_cast<const TDefaultSCPRFactoryQuery&>(aQuery); |
|
44 CSubConnectionProviderBase* provider = NULL; |
|
45 if (query.iSCPRType == RSubConnection::EAttachToDefault) |
|
46 { |
|
47 provider = CUPnPControlDefaultSubConnectionProvider::NewL(*this); |
|
48 ESOCK_DEBUG_REGISTER_GENERAL_NODE(iUid, provider); |
|
49 } |
|
50 else if (query.iSCPRType == RSubConnection::ECreateNew) |
|
51 { |
|
52 provider = CUPnPControlSubConnectionProvider::NewL(*this); |
|
53 ESOCK_DEBUG_REGISTER_GENERAL_NODE(iUid, provider); |
|
54 } |
|
55 else |
|
56 { |
|
57 User::Leave(KErrNotSupported); |
|
58 } |
|
59 return provider; |
|
60 } |