omadrm/drmengine/server/inc/DRMPointerArray.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 16 Apr 2010 15:14:55 +0300
changeset 23 493788a4a8a4
parent 0 95b198f216e5
child 24 8cdda00a45da
permissions -rw-r--r--
Revision: 201011 Kit: 201015

/*
* 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