natplugins/natpnatfwsdpprovider/tsrc/ut_NatFwSdpProvider/src/nsptls.cpp
changeset 0 1bce908db942
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2004 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:
       
    15 *
       
    16 */
       
    17 
       
    18 #include <e32std.h>
       
    19 #include <digia/eunit/CEunitAllocTestCaseDecorator.h>
       
    20 #include "nsptls.h"
       
    21 
       
    22 // METHODS:
       
    23 // ---------------------------------------------------------------------------
       
    24 // TNSPStorage::TNSPStorage
       
    25 // ---------------------------------------------------------------------------
       
    26 // 
       
    27 TNSPStorage::TNSPStorage()
       
    28 	: iOOMService( CEUnitTestCaseDecorator::ActiveTestCaseDecorator(
       
    29      		KEUnitAllocTestCaseDecoratorName ) ? ETrue : EFalse ),
       
    30 	  iLeaveService( KErrNone ),
       
    31 	  iLastAction( TNSPStorage::ENone )
       
    32     {
       
    33     }
       
    34 
       
    35 // ---------------------------------------------------------------------------
       
    36 // TNSPStorage::TNSPStorage
       
    37 // ---------------------------------------------------------------------------
       
    38 // 
       
    39 TNSPStorage::~TNSPStorage()
       
    40     {
       
    41     }
       
    42 
       
    43 // ---------------------------------------------------------------------------
       
    44 // NSPTls::OpenL
       
    45 // ---------------------------------------------------------------------------
       
    46 // 
       
    47 void NSPTls::OpenL()
       
    48     {
       
    49     Dll::SetTls( new (ELeave) TNSPStorage() );
       
    50     }
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 // NSPTls::Close()
       
    54 // ---------------------------------------------------------------------------
       
    55 // 
       
    56 void NSPTls::Close()
       
    57     {
       
    58     delete Storage();
       
    59     Dll::SetTls( NULL );
       
    60     }
       
    61 
       
    62 // ---------------------------------------------------------------------------
       
    63 // NSPTls::Storage
       
    64 // ---------------------------------------------------------------------------
       
    65 // 
       
    66 TNSPStorage* NSPTls::Storage()
       
    67     {
       
    68     return ( static_cast<TNSPStorage*>( Dll::Tls() ) );
       
    69     }
       
    70 
       
    71 // End of file