sl@0: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include "ComponentInfo.h" sl@0: sl@0: sl@0: CComponentInfo::CComponentInfo() sl@0: : CBase() sl@0: { sl@0: } sl@0: sl@0: sl@0: CComponentInfo::~CComponentInfo() sl@0: { sl@0: iComponentTesterGlobalCreationFuncLC = NULL; sl@0: // We took ownership of these objects at construction, therefore we delete them sl@0: if(iUnitTestsInfo) sl@0: { sl@0: iUnitTestsInfo->ResetAndDestroy(); sl@0: delete iUnitTestsInfo; sl@0: } sl@0: } sl@0: sl@0: sl@0: CComponentInfo* CComponentInfo::NewLC(ComponentTesterInitialiserLC aEntryFunc, RPointerArray* aUnitTestsInfo) sl@0: { sl@0: CComponentInfo* self = new (ELeave) CComponentInfo(); sl@0: CleanupStack::PushL(self); sl@0: sl@0: // There must be no Leave'able functions following the Construct sl@0: // as we take control of the objects on exit. sl@0: self->Construct(aEntryFunc, aUnitTestsInfo); sl@0: return self; sl@0: } sl@0: sl@0: sl@0: EXPORT_C CComponentInfo* CComponentInfo::NewL(ComponentTesterInitialiserLC aEntryFunc, RPointerArray* aUnitTestsInfo) sl@0: { sl@0: CComponentInfo* self = NewLC(aEntryFunc, aUnitTestsInfo); sl@0: CleanupStack::Pop(); sl@0: return self; sl@0: } sl@0: sl@0: sl@0: void CComponentInfo::Construct(ComponentTesterInitialiserLC aEntryFunc, RPointerArray* aUnitTestsInfo) sl@0: { sl@0: // NOTE these must be the final lines of code. sl@0: // There must be NO Leave'able code following this sl@0: // as we take control of these objects on exit. sl@0: iComponentTesterGlobalCreationFuncLC = aEntryFunc; sl@0: iUnitTestsInfo = aUnitTestsInfo; sl@0: } sl@0: sl@0: