ncdengine/inc/catalogsarray.inl
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Contains definition of Catalogs interface pointer array 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef R_CATALOGS_ARRAY_INL
       
    20 #define R_CATALOGS_ARRAY_INL
       
    21 
       
    22 template< class T >
       
    23 RCatalogsArray< T >::RCatalogsArray() 
       
    24     : RPointerArray<T>()
       
    25     {
       
    26     }
       
    27 
       
    28 
       
    29 template< class T >
       
    30 RCatalogsArray< T >::RCatalogsArray( TInt aGranularity ) 
       
    31     : RPointerArray<T>( aGranularity )
       
    32     {
       
    33     }
       
    34 
       
    35 /**
       
    36  *  Empties the array and releases the referenced objects.
       
    37  *
       
    38  *  It frees all memory allocated to the array and resets the internal state so
       
    39  *  that it is ready to be reused. The function also calls Release() on all of
       
    40  *  the objects whose pointers are contained by the array.
       
    41  *  This array object can be allowed to go out of scope after a call to this
       
    42  *  function.
       
    43  */
       
    44 template< class T >
       
    45 void RCatalogsArray< T >::ResetAndDestroy()
       
    46     {
       
    47     for( TInt i=0; i<RPointerArray< T >::Count(); i++ )
       
    48         {
       
    49         (*this)[i]->Release();
       
    50         }
       
    51     RPointerArray< T >::Reset();
       
    52     }
       
    53 
       
    54 #endif // R_CATALOGS_ARRAY_INL