|
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 // ECOM Factory for Commdb Query Sets |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 |
|
24 #include "connectionqueryfactory.h" |
|
25 #include <comms-infras/connectionqueryset.h> |
|
26 |
|
27 |
|
28 using namespace ESock; |
|
29 |
|
30 // ---------------- Factory Methods ---------------- |
|
31 /** |
|
32 Creates an instance of a connection query based on the supplied type |
|
33 @param aConstructionParams A TUint identifying the type of connection query to create |
|
34 @return A pointer to the instance of a connection query |
|
35 @exception Leaves with KErrNoMemory if the object cannot be created, or KErrUnknown |
|
36 if unknown query type id is given |
|
37 */ |
|
38 XConnectionQueryBase* CConnectionQueryFactory::NewL(TAny* aConstructionParams) |
|
39 { |
|
40 TUint typeId = reinterpret_cast<TUint>(aConstructionParams); |
|
41 switch (typeId) |
|
42 { |
|
43 case XConnectionQueryBase::ENull: |
|
44 return new (ELeave) XConnectionQuerySet::XNullQuery(); |
|
45 //break; |
|
46 |
|
47 case XConnectionQueryBase::EBool: |
|
48 return new (ELeave) XBoolQuery(); |
|
49 //break; |
|
50 |
|
51 case XConnectionQueryBase::EInt: |
|
52 return new (ELeave) XIntQuery(); |
|
53 //break; |
|
54 |
|
55 case XConnectionQueryBase::EUint: |
|
56 return new (ELeave) XUintQuery(); |
|
57 //break; |
|
58 |
|
59 case XConnectionQueryBase::EText8: |
|
60 return new (ELeave) XText8Query(); |
|
61 //break; |
|
62 |
|
63 case XConnectionQueryBase::EText16: |
|
64 return new (ELeave) XText16Query(); |
|
65 //break; |
|
66 } |
|
67 |
|
68 User::Leave(KErrUnknown); |
|
69 return NULL; |
|
70 } |
|
71 |