bluetooth/btstack/avctp/avctpOutboundQ.inl
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2005-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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #include "avctpconstants.h"
       
    22 #include "avctppacket.h"
       
    23 #include "avctputils.h"
       
    24 
       
    25 inline TAvctpOutboundQ::TAvctpOutboundQ()
       
    26 : iCount(0)
       
    27 	{
       
    28 	iQue.SetOffset(_FOFF(HAvctpOutgoingSdu, iQueLink));
       
    29 	}
       
    30 	
       
    31 inline HAvctpOutgoingSdu* TAvctpOutboundQ::First()
       
    32 	{
       
    33 	return iQue.First();
       
    34 	}
       
    35 
       
    36 inline TDblQueIter<HAvctpOutgoingSdu> TAvctpOutboundQ::Iter()
       
    37 	{
       
    38 	TDblQueIter<HAvctpOutgoingSdu> iter(iQue);
       
    39 	return iter;
       
    40 	}
       
    41 
       
    42 inline TUint TAvctpOutboundQ::Count() const
       
    43 	{
       
    44 #ifdef _DEBUG
       
    45 	typedef TDblQue<HAvctpOutgoingSdu>* sduList; // to avoid nested <> nastiness
       
    46 	TDblQueIter<HAvctpOutgoingSdu> iter(*const_cast<sduList>(&iQue));
       
    47 	TUint checkCount = 0;
       
    48 	while(iter++)
       
    49 		{
       
    50 		checkCount++;
       
    51 		}
       
    52 	if (checkCount != iCount)
       
    53 		{
       
    54 		Panic(SymbianAvctp::EOutboundQCountIncorrect);
       
    55 		}
       
    56 #endif		
       
    57 
       
    58 	return iCount;
       
    59 	}
       
    60 
       
    61 // Needs to be explicitly called rather than 
       
    62 inline void TAvctpOutboundQ::Deque(HAvctpOutgoingSdu& aSdu)
       
    63 	{
       
    64 	aSdu.iQueLink.Deque();
       
    65 	iCount--;
       
    66 	}
       
    67 
       
    68 
       
    69