networkcontrol/commsuserpromptmgr/utils/src/netupsconnectionentry.cpp
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // netupsconnectionentry.pp
       
    15 // This file defines the CConnectionEntry a structure which
       
    16 // specifies the number of connections associated with a CommsId. 
       
    17 // @internalAll
       
    18 // 
       
    19 //
       
    20 	
       
    21 #include <e32const.h>
       
    22 #include "netupsconnectionentry.h"
       
    23 #include "netupsassert.h"
       
    24 
       
    25 namespace NetUps
       
    26 {
       
    27 __FLOG_STMT(_LIT8(KNetUpsSubsys, 	"esock");)   
       
    28 __FLOG_STMT(_LIT8(KNetUpsComponent, "NetUps");) /*esockloader*/
       
    29 
       
    30 CConnectionEntry* CConnectionEntry::NewL(const Messages::TNodeId& aCommsId, TInt32 aCount)
       
    31 	{
       
    32 	CConnectionEntry* self = new (ELeave) CConnectionEntry(aCommsId, aCount);
       
    33 	
       
    34 	CleanupStack::PushL(self);
       
    35 	self->ConstructL();
       
    36 	CleanupStack::Pop(self);
       
    37 	
       
    38 	return self;		
       
    39 	}
       
    40 
       
    41 void CConnectionEntry::ConstructL()
       
    42 	{
       
    43 	__FLOG_OPEN(KNetUpsSubsys, KNetUpsComponent);
       
    44 	__FLOG_1(_L("CConnectionEntry %08x:\tCConnectionEntry()"), this);	
       
    45 	}
       
    46 	
       
    47 CConnectionEntry::~CConnectionEntry()
       
    48 	{
       
    49 	__FLOG_1(_L("CConnectionEntry %08x:\t~CConnectionEntry()"), this);
       
    50 	__FLOG_CLOSE;
       
    51 	}
       
    52 
       
    53 void CConnectionEntry::IncrementCount()
       
    54 	{
       
    55 	iCount++;
       
    56 	}
       
    57 	
       
    58 void CConnectionEntry::DecrementCount()
       
    59 	{
       
    60 	__ASSERT_DEBUG(iCount > 0, User::Panic(KNetUpsPanic, KPanicAttemptToDecrementPastZero));
       
    61 	--iCount;	
       
    62 	}
       
    63 
       
    64 }
       
    65