os/ossrv/lowlevellibsandfws/pluginfw/Framework/LoadManagerTest/LoadManagerStateAccessor.inl
Update contrib.
1 // Copyright (c) 1997-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // The state accessor class implementations for the CLoadManager class
18 // ______________________________________________________________________________
20 _LIT(KTLoadManager_DumpName,"C:\\System\\Data\\Logs\\TLoadManager_StateDump.bin");
22 inline TInt TLoadManager_StateAccessor::InvariantTest(TAny* aTestObject)
27 // CLoadManager* LoadManager = REINTERPRET_CAST(CLoadManager*, aTestObject);
32 inline TInt TLoadManager_StateAccessor::Internalize(TAny* aTestObject)
34 TInt error = KErrNone;
37 CLoadManager* LoadManager = REINTERPRET_CAST(CLoadManager*, aTestObject);
38 TRAP(error,InternalizeL(LoadManager));
43 inline TInt TLoadManager_StateAccessor::Externalize(TAny* aTestObject)
45 TInt error = KErrNone;
48 CLoadManager* LoadManager = REINTERPRET_CAST(CLoadManager*, aTestObject);
49 TRAP(error,ExternalizeL(LoadManager));
54 inline void TLoadManager_StateAccessor::InternalizeL(RFileReadStream& /* aStream */, CLoadManager* /* aLoadManager */)
59 inline void TLoadManager_StateAccessor::ExternalizeL(RFileWriteStream& /* aStream */, CLoadManager* /* aLoadManager */)
65 inline void TLoadManager_StateAccessor::InternalizeL(CLoadManager* aLoadManager)
67 // Read in the dumped data
69 User::LeaveIfError(fs.Connect());
70 CleanupClosePushL(fs);
71 // Read the object dump
73 filename.Set(KTLoadManager_DumpName(),NULL,NULL);
74 RFileReadStream stream;
75 User::LeaveIfError(stream.Open(fs,filename.FullName(), EFileRead));
76 CleanupClosePushL(stream);
77 InternalizeL(stream, aLoadManager);
78 CleanupStack::PopAndDestroy(); // stream
79 CleanupStack::PopAndDestroy(); // fs
82 inline void TLoadManager_StateAccessor::ExternalizeL(CLoadManager* aLoadManager)
85 User::LeaveIfError(fs.Connect());
86 CleanupClosePushL(fs);
87 // Write out the object dump
89 filename.Set(KTLoadManager_DumpName(),NULL,NULL);
90 RFileWriteStream stream;
91 User::LeaveIfError(stream.Replace(fs,filename.FullName(), EFileWrite));
92 CleanupClosePushL(stream);
93 ExternalizeL(stream, aLoadManager);
94 CleanupStack::PopAndDestroy(); // stream
95 CleanupStack::PopAndDestroy(); // fs