cmmanager/cmmgr/Framework/Inc/cmmanagerimpl.inl
changeset 20 9c97ad6591ae
parent 18 fcbbe021d614
child 21 b8e8e15e80f2
child 23 7ec726f93df1
child 28 860702281757
equal deleted inserted replaced
18:fcbbe021d614 20:9c97ad6591ae
     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:  Implementation of connection method manager
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CMMANAGERIMPL_INL
       
    19 #define CMMANAGERIMPL_INL
       
    20 
       
    21 public:
       
    22         /**
       
    23         * The cm have been updated if it was a new cm
       
    24         * than the zero id must be changed to the new one 
       
    25         *
       
    26         * @param aCM - the cm to change
       
    27         */         
       
    28         inline void ConnMethodUpdatedL( CCmPluginBaseEng* aCM )
       
    29             {
       
    30             iObjectPool->ConnMethodUpdatedL( aCM );
       
    31             iPluginImpl->ResetIfInMemory( aCM );
       
    32             }
       
    33 
       
    34 public:
       
    35         template<typename TArrayToCleanup>
       
    36         /*
       
    37         * Pushes an array to the CleanupStack, calling it's ResetAndDestroy
       
    38         * when destroying it.
       
    39         */
       
    40         static void CleanupResetAndDestroyPushL(TArrayToCleanup& aPtr)
       
    41             {
       
    42             void (*p)(TAny*) = CCmManagerImpl::ResetAndDestroy<TArrayToCleanup>;
       
    43             CleanupStack::PushL( TCleanupItem(p, (void*)(&aPtr)) );
       
    44             }
       
    45 private:
       
    46         /**
       
    47         * A cleanup function for TCleanupItem construction for
       
    48         * cleanup of pointers in an RPointerArray
       
    49         * usage: 
       
    50         * CleanupStack::PushL( TCleanupItem( CCmManagerImpl::DestroyRPointerArray<ItemTypeName>, (void*)(PointerToArray)) )
       
    51         * @return TInt
       
    52         */        
       
    53         template<typename TArrayToCleanup>
       
    54         static void ResetAndDestroy(TAny* aPtr)
       
    55         {
       
    56         TArrayToCleanup *p = static_cast <TArrayToCleanup*> (aPtr);
       
    57         p->ResetAndDestroy();
       
    58         }   
       
    59 #endif // CMMANAGERIMPL_H