diff -r 000000000000 -r 094583676ce7 wvuing/Utils/RCAPointerArray.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wvuing/Utils/RCAPointerArray.h Thu Dec 17 08:41:52 2009 +0200 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Wrapper for RPointerArray that destructs it's contents automatically +* +*/ + + +#ifndef RCAPOINTERARRAY_H +#define RCAPOINTERARRAY_H + +// INCLUDES +#include + +// CLASS DECLARATION + +/** + * Wrapper for RPointerArray. + * Destructs it's contents automatically. + * + * @lib none + * @since Series 60 3.0 + */ +template +class RCAPointerArray : public RPointerArray + { + public: // Constructors and destructor + + /** + * C++ default constructor. + */ + inline RCAPointerArray( TBool aOwnsItems = EFalse ) + : iOwnsItems( aOwnsItems ) {}; + + /** + * Destructor. + */ + inline virtual ~RCAPointerArray() + { + iOwnsItems ? RPointerArray::ResetAndDestroy() : RPointerArray::Close(); + } + + public: // new function + + /** + * Set item ownership + */ + inline void SetItemOwnership( TBool aOwnsItems ) + { + iOwnsItems = aOwnsItems; + } + + private: // data + + TBool iOwnsItems; + + }; + +#endif // RCAPOINTERARRAY_H + +// End of File