|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Codec to pack and unpack data objects. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef XIMPAPIDATAOBJFACTORY_H |
|
19 #define XIMPAPIDATAOBJFACTORY_H |
|
20 |
|
21 #include <e32base.h> |
|
22 #include "ximptypehelpers.h" |
|
23 |
|
24 class CXIMPApiDataObjBase; |
|
25 class RReadStream; |
|
26 class RWriteStream; |
|
27 |
|
28 |
|
29 /** |
|
30 * Codec to pack and unpack data object arrays. |
|
31 * |
|
32 * @lib ximpdatamodel.dll |
|
33 * @since S60 v3.2 |
|
34 */ |
|
35 NONSHARABLE_CLASS( XIMPApiDataObjFactory ) |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Unpacks a request parameter array from a |
|
41 * descriptor back to array format. |
|
42 * @param aDataObjArrayData The packed array |
|
43 * @param aArray The array which to fill |
|
44 */ |
|
45 IMPORT_C static void InternalizeL( |
|
46 RReadStream& aStream, |
|
47 RPrReqParamArray& aArray |
|
48 ); |
|
49 |
|
50 /** |
|
51 * Packs a given request parameter array into |
|
52 * a stream. |
|
53 * @param aWs The stream to pack into |
|
54 * @param aArray The array to pack |
|
55 */ |
|
56 IMPORT_C static void ExternalizeL( |
|
57 RWriteStream& aWs, |
|
58 const RPrReqParamArray& aArray |
|
59 ); |
|
60 |
|
61 /** |
|
62 * Internalize a CXIMPApiDataObjBase-derived object |
|
63 * from the given stream, ownership is returned to the caller. |
|
64 * @param aStream The stream |
|
65 * @return The object instance |
|
66 */ |
|
67 IMPORT_C static CXIMPApiDataObjBase* InternalizeLC( |
|
68 RReadStream& aStream ); |
|
69 |
|
70 /** |
|
71 * Externalize a CXIMPApiDataObjBase-derived object |
|
72 * to the given stream. |
|
73 * @param aWs The write stream |
|
74 * @param aDataObj The data object |
|
75 */ |
|
76 IMPORT_C static void ExternalizeL( |
|
77 RWriteStream& aWs, |
|
78 const CXIMPApiDataObjBase& aDataObj ); |
|
79 |
|
80 /* |
|
81 * Packs a given array into a stream. |
|
82 * @param aStream The stream |
|
83 * @param aArray The array |
|
84 */ |
|
85 template< class INFOIMP> |
|
86 static inline void InternalizeL( |
|
87 RReadStream& aStream, |
|
88 RPointerArray<INFOIMP>& aArray |
|
89 ); |
|
90 |
|
91 /** |
|
92 * Unpacks an array of info fields back to array format. |
|
93 * @param aWs The stream |
|
94 * @param aArray The array which to fill |
|
95 */ |
|
96 template< class INFOIMP > |
|
97 static inline void ExternalizeL( |
|
98 RWriteStream& aWs, |
|
99 const RPointerArray<INFOIMP>& aArray |
|
100 ); |
|
101 |
|
102 private: |
|
103 |
|
104 XIMPApiDataObjFactory(); |
|
105 ~XIMPApiDataObjFactory(); |
|
106 |
|
107 |
|
108 |
|
109 }; |
|
110 |
|
111 // template methods need inline implementation |
|
112 #include "ximpapidataobjfactory.inl" |
|
113 |
|
114 #endif // XIMPAPIDATAOBJFACTORY_H |