2 * Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
25 #ifndef __RMPOINTERARRAY_H__
26 #define __RMPOINTERARRAY_H__
30 * An array of pointers to objects, that adds close type behaviour.
32 * For use with M class pointers, which have a release method and are owned by
33 * the array. When the array is closed, the objects will be released.
38 template<class T> class RMPointerArray : public RPointerArray<T>
42 inline RMPointerArray();
43 /** Frees all resources, calling Release() on the contents of the array */
47 /** Default constructor. */
49 inline RMPointerArray<T>::RMPointerArray()
54 * Closes the array and frees all resources; this includes deleting the objects
55 * whose pointers are held by the array.
58 inline void RMPointerArray<T>::Close()
60 TInt count = this->Count();
61 for (TInt ii = 0; ii < count; ii++)
62 (*this)[ii]->Release();