|
1 // Copyright (c) 2001-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 // The definition of the accessor class upon the CWspHeaderWriter |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file WspHeaderWriterStateAccessor.h |
|
20 */ |
|
21 |
|
22 #ifndef __WSPHEADERWRITERSTATEACCESSOR_H__ |
|
23 #define __WSPHEADERWRITERSTATEACCESSOR_H__ |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <f32file.h> |
|
27 #include <s32stor.h> |
|
28 #include <s32file.h> |
|
29 |
|
30 #include "TestUtilities.h" |
|
31 #include "TestBedDefinitions.h" |
|
32 #include "StateAccessor.h" |
|
33 #include "CWspHeaderWriter.h" |
|
34 |
|
35 // ______________________________________________________________________________ |
|
36 // |
|
37 /** |
|
38 @internal |
|
39 @class TWspHeaderWriter_StateAccessor |
|
40 @Depends CWspHeaderWriter & MStateAccessor |
|
41 |
|
42 Comments : State accessor for the CWspHeaderWriter object under test. |
|
43 Please Note : There are a number of overloads for the Internalize and Externalize methods. |
|
44 This allows other classes to aggregate state accessors for their internal classes, providing |
|
45 the ability to capture the complete state of an instantiation hierarchy. |
|
46 */ |
|
47 class TWspHeaderWriter_StateAccessor : public MStateAccessor |
|
48 { |
|
49 public: |
|
50 /** |
|
51 @fn InvariantTest(TAny* aTestObject) |
|
52 Intended Usage : To check CWspHeaderWriter for invariant violation. |
|
53 @since 7.0 |
|
54 @param aTestObject A pointer to the object under test. |
|
55 @return KErrNone if the invariants were valid, error code otherwise. |
|
56 @pre TWspHeaderWriter_StateAccessor is fully constructed. |
|
57 @post The CWspHeaderWriter class under test has been checked for |
|
58 for invariance. |
|
59 */ |
|
60 inline TInt InvariantTest(TAny* aTestObject); |
|
61 |
|
62 /** |
|
63 @fn Internalize(TAny* aTestObject) |
|
64 Intended Usage : @todo Implemented by the developer to restore the state of the object under test. |
|
65 @since 7.0 |
|
66 @param aTestObject The object being tested |
|
67 @return KErrNone if the internalize was successful. |
|
68 @return One of the EPOC standard error codes indicating the reason |
|
69 for the failure to load the object state. |
|
70 @pre TWspHeaderWriter_StateAccessor is fully constructed, and |
|
71 valid test object must be passed in. |
|
72 @post The CWspHeaderWriter class under test has internalized its |
|
73 persistent stream data. |
|
74 */ |
|
75 inline virtual TInt Internalize(TAny* aTestObject); |
|
76 |
|
77 /** |
|
78 @fn Externalize(TAny* aTestObject) |
|
79 Intended Usage : @todo Implemented by the developer to persist the state of the |
|
80 CWspHeaderWriter object under test. |
|
81 @since 7.0 |
|
82 @param aTestObject The object being tested |
|
83 @return KErrNone if the externalize was successful. |
|
84 @return One of the EPOC standard error codes indicating the reason |
|
85 for the failure to externalize the object. |
|
86 @pre TWspHeaderWriter_StateAccessor is fully constructed, and |
|
87 valid test object must be passed in. |
|
88 @post The CWspHeaderWriter class under test has externalized its |
|
89 persistent stream data. |
|
90 */ |
|
91 inline virtual TInt Externalize(TAny* aTestObject); |
|
92 |
|
93 /** |
|
94 @fn InternalizeL(RFileReadStream& aStream, CWspHeaderWriter* aWspHeaderWriter) |
|
95 Intended Usage : Implemented by the developer to set the state of the |
|
96 CWspHeaderWriter object under test. |
|
97 Error Condition : Leaves with an error code. |
|
98 @exception KErrNoMemory |
|
99 @exception @see RFileReadStream |
|
100 @since 7.0 |
|
101 @param aStream The filestream to read from . |
|
102 @param aWspHeaderWriter A pointer to the CWspHeaderWriter object under test. |
|
103 @return None. |
|
104 @pre TWspHeaderWriter_StateAccessor is fully constructed. |
|
105 @post The CWspHeaderWriter class under test has internalized its persisted state. |
|
106 */ |
|
107 inline void InternalizeL(RFileReadStream& aStream, CWspHeaderWriter* aWspHeaderWriter); |
|
108 |
|
109 /** |
|
110 @fn ExternalizeL(RFileWriteStream& aStream, CWspHeaderWriter* aWspHeaderWriter) |
|
111 Intended Usage : Implemented by the developer to persist the state of the |
|
112 CWspHeaderWriter object under test. |
|
113 Error Condition : Leaves with an error code. |
|
114 @exception KErrNoMemory |
|
115 @exception @see RFileWriteStream |
|
116 @since 7.0 |
|
117 @param aStream The filestream to persist into. |
|
118 @param aWspHeaderWriter A pointer to the CWspHeaderWriter object under test. |
|
119 @return None. |
|
120 @pre TWspHeaderWriter_StateAccessor is fully constructed. |
|
121 @post No change to the CWspHeaderWriter class under test, its internal state. |
|
122 is persisted. |
|
123 */ |
|
124 inline void ExternalizeL(RFileWriteStream& aStream, CWspHeaderWriter* aWspHeaderWriter); |
|
125 |
|
126 private: |
|
127 /** |
|
128 @fn InternalizeL(CWspHeaderWriter* aWspHeaderWriter) |
|
129 Intended Usage : Implemented by the developer to set the state of the |
|
130 CWspHeaderWriter object under test. |
|
131 Error Condition : Leaves with an error code. |
|
132 @exception KErrNoMemory |
|
133 @exception @see RFileReadStream |
|
134 @since 7.0 |
|
135 @param aWspHeaderWriter A pointer to the CWspHeaderWriter object under test. |
|
136 @pre TWspHeaderWriter_StateAccessor is fully constructed. |
|
137 @post The CWspHeaderWriter class under test has internalized its persisted state. |
|
138 */ |
|
139 inline void InternalizeL(CWspHeaderWriter* aWspHeaderWriter); |
|
140 |
|
141 /** |
|
142 @fn ExternalizeL(CWspHeaderWriter* aWspHeaderWriter) |
|
143 Intended Usage : Implemented by the developer to persist the state of the |
|
144 CWspHeaderWriter object under test. |
|
145 Error Condition : Leaves with an error code. |
|
146 @exception KErrNoMemory |
|
147 @exception @see RFileWriteStream |
|
148 @since 7.0 |
|
149 @param aWspHeaderWriter A pointer to the CWspHeaderWriter object under test. |
|
150 @pre TWspHeaderWriter_StateAccessor is fully constructed. |
|
151 @post No change to the CWspHeaderWriter class under test, its internal state. |
|
152 is persisted. |
|
153 */ |
|
154 inline void ExternalizeL(CWspHeaderWriter* aWspHeaderWriter); |
|
155 }; // TWspHeaderWriter_StateAccessor |
|
156 |
|
157 #include "WspHeaderWriterStateAccessor.inl" |
|
158 |
|
159 #endif // __WSPHEADERWRITERSTATEACCESSOR_H__ |
|
160 |