omadrm/drmengine/server/inc/DRMPointerArray.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 17 Dec 2009 08:52:27 +0200
changeset 0 95b198f216e5
child 12 8a03a285ab14
permissions -rw-r--r--
Revision: 200949 Kit: 200951

/*
* Copyright (c) 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:
*
*/


#ifndef DRMPOINTERARRAY_H
#define DRMPOINTERARRAY_H

#include <e32base.h>
#include <e32cmn.h>

template < class T > NONSHARABLE_CLASS( RDRMPointerArray ) : public RPointerArray< T >
    {
    public:
        inline explicit RDRMPointerArray( TInt aGranularity );
        inline RDRMPointerArray( TInt aMinGrowBy, TInt aFactor );
        inline RDRMPointerArray();
        virtual ~RDRMPointerArray();
        
        // If set to ETrue, RPointerArray::ResetAndDestroy() is called 
        // automatically in destructor. Otherwise only RPointerArrary::Close()
        // is called.
        inline void SetAutoCleanup( const TBool aCleanup );
                
    protected:
        TBool iDoResetAndDestroy;
    };

template < class T > NONSHARABLE_CLASS( CDRMPointerArray ) : public CBase, public RDRMPointerArray< class T >
    {
    public:
        static CDRMPointerArray* NewLC( TInt aGranularity );
        static CDRMPointerArray* NewL( TInt aGranularity );
        static CDRMPointerArray* NewLC( TInt aMinGrowBy, TInt aFactor );
        static CDRMPointerArray* NewL( TInt aMinGrowBy, TInt aFactor );
        static CDRMPointerArray* NewLC();
        static CDRMPointerArray* NewL();
        
        // Note: Does not do ResetAndDestroy() by default. 
        // Use SetAutoCleanup to do reallyclean.
        ~CDRMPointerArray();
        
        
    protected:
        explicit CDRMPointerArray( TInt aGranularity );
        CDRMPointerArray( TInt aMinGrowBy, TInt aFactor );
        CDRMPointerArray();        
        
    private:
    };


#include "drmpointerarray.inl"

#endif // DRMPOINTERARRAY_H