|
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 // IP SubConnection Provider factory class definition. |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 #include "ipdeftscprfactory.h" |
|
24 #include "ipdeftbasescpr.h" |
|
25 #include "IPMessages.h" |
|
26 #include <comms-infras/ss_log.h> |
|
27 |
|
28 #include <comms-infras/ss_msgintercept.h> |
|
29 |
|
30 #ifdef __CFLOG_ACTIVE |
|
31 #define KIpDeftSCprFactoryTag KESockSubConnectionTag |
|
32 // _LIT8(KIpDeftSCprFactorySubTag, "ipdeftscprfactory"); |
|
33 #endif // __CFLOG_ACTIVE |
|
34 |
|
35 using namespace ESock; |
|
36 |
|
37 //-========================================================= |
|
38 // |
|
39 // CIpDefaultSubConnectionProviderFactory methods |
|
40 // |
|
41 //-========================================================= |
|
42 EXPORT_C CIpDefaultSubConnectionProviderFactory* CIpDefaultSubConnectionProviderFactory::NewL(TAny* aParentContainer) |
|
43 { |
|
44 TCFIPMessage::RegisterL(); |
|
45 |
|
46 return new (ELeave) CIpDefaultSubConnectionProviderFactory(TUid::Uid(CIpDefaultSubConnectionProviderFactory::iUid), |
|
47 *reinterpret_cast<ESock::CSubConnectionFactoryContainer*>(aParentContainer)); |
|
48 } |
|
49 |
|
50 CIpDefaultSubConnectionProviderFactory::CIpDefaultSubConnectionProviderFactory(TUid aFactoryId, ESock::CSubConnectionFactoryContainer& aParentContainer) |
|
51 : CSubConnectionProviderFactoryBase(aFactoryId, aParentContainer) |
|
52 { |
|
53 } |
|
54 |
|
55 ESock::ACommsFactoryNodeId* CIpDefaultSubConnectionProviderFactory::DoCreateObjectL(ESock::TFactoryQueryBase& aQuery) |
|
56 { |
|
57 const TDefaultSCPRFactoryQuery& query = static_cast<TDefaultSCPRFactoryQuery&>(aQuery); |
|
58 CSubConnectionProviderBase* provider = NULL; |
|
59 if (query.iSCPRType == RSubConnection::EAttachToDefault) |
|
60 { |
|
61 provider = CIpDefaultBaseSubConnectionProvider::NewL(*this); |
|
62 ESOCK_DEBUG_REGISTER_GENERAL_NODE(iUid, provider); |
|
63 } |
|
64 else |
|
65 { |
|
66 User::Leave(KErrNotSupported); |
|
67 } |
|
68 return provider; |
|
69 } |
|
70 |
|
71 CIpDefaultSubConnectionProviderFactory::~CIpDefaultSubConnectionProviderFactory() |
|
72 { |
|
73 TCFIPMessage::DeRegister(); |
|
74 } |