secureswitools/swisistools/source/sisxlibrary/sharedcount.cpp
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2004-2009 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 the License "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: 
       
    15 * Note: This file may contain code to generate corrupt files for test purposes.
       
    16 * Such code is excluded from production builds by use of compiler defines;
       
    17 * it is recommended that such code should be removed if this code is ever published publicly.
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 /**
       
    23  @file 
       
    24  @internalComponent
       
    25  @released
       
    26 */
       
    27 
       
    28 #include "sharedcount.h"
       
    29 
       
    30 
       
    31 
       
    32 CSharedCount & CSharedCount::operator = (CSharedCount const& aInitialiser) 
       
    33 	{
       
    34     CCounterBase* tmp = aInitialiser.iBase;
       
    35     if (tmp != 0) 
       
    36 		{
       
    37 		tmp -> AddRef ();
       
    38 		}
       
    39     if (iBase != 0) 
       
    40 		{
       
    41 		iBase -> Release ();
       
    42 		}
       
    43     iBase = tmp;
       
    44     return *this;
       
    45 	}
       
    46 
       
    47 
       
    48 void CSharedCount::swap (CSharedCount & aSwap) 
       
    49 	{
       
    50     CCounterBase* tmp = aSwap.iBase;
       
    51     aSwap.iBase = iBase;
       
    52     iBase = tmp;
       
    53 	}
       
    54