PECengine/CoreUtilsLib2/Inc/RObjectArray.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Object Pointer array.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __ROBJECTARRAY_H
       
    19 #define __ROBJECTARRAY_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include  <E32Base.h>
       
    23 
       
    24 
       
    25 /**
       
    26  * Object Pointer array.
       
    27  *
       
    28  * Array members are owned by the array.
       
    29  * CleanupClosePushL() can be used to
       
    30  * push array to CleanupStack and
       
    31  * destroy objects in case of leave.
       
    32  *
       
    33  * @since 3.0
       
    34  */
       
    35 template<class T>
       
    36 class RObjectArray : public RPointerArray<T>
       
    37     {
       
    38     public: //Overwritten functions
       
    39 
       
    40 
       
    41         /**
       
    42          * Overloaded close function.
       
    43          *
       
    44          * Array members are owned by the array,
       
    45          * and calling close thus deletes
       
    46          * the holded objects.
       
    47          *
       
    48          * @since 3.0
       
    49          */
       
    50         inline void Close()
       
    51             {
       
    52             RPointerArray<T>::ResetAndDestroy();
       
    53             }
       
    54     };
       
    55 
       
    56 #endif      // __ROBJECTARRAY_H
       
    57 
       
    58 // End of File
       
    59