commsfwutils/commsbufs/mbufmgr/inc/mbufpktq.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 1997-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 #if !defined(__MBufPktQ_h__)
       
    18 #define __MBufPktQ_h__
       
    19 
       
    20 class RMBufPktQ
       
    21 /**
       
    22 MBUF PACKET QUEUE
       
    23 @publishedPartner
       
    24 @released
       
    25 */
       
    26 	{
       
    27 	__DECLARE_CLEANUP
       
    28 public:
       
    29 	inline TBool IsEmpty() const;
       
    30 	inline const RMBufChain& First() const;
       
    31 	inline const RMBufChain& Last() const;
       
    32 	IMPORT_C void Init();
       
    33 	IMPORT_C void Assign(RMBufPktQ& aQueue);
       
    34 	IMPORT_C void Free();
       
    35 	IMPORT_C TBool Remove(RMBufChain& aChain);
       
    36 	IMPORT_C void Append(RMBufChain& aChain);
       
    37 	IMPORT_C void Append(RMBufPktQ& aQueue);
       
    38 	IMPORT_C void Prepend(RMBufChain& aChain);
       
    39 private:
       
    40 	friend class TMBufPktQIter;
       
    41 	void Insert(RMBufChain& aNew, RMBufChain& aPrev);
       
    42 	void Remove(RMBufChain& aNew, RMBufChain& aPrev);
       
    43 	//
       
    44 protected:
       
    45 	RMBufChain iNext;
       
    46 	RMBufChain iLast;
       
    47 	};
       
    48 
       
    49 class TMBufPktQIter
       
    50 /**
       
    51 MBUF PACKET QUEUE ITERATOR
       
    52 @publishedPartner
       
    53 @released
       
    54 */
       
    55 	{
       
    56 public:
       
    57 	inline TMBufPktQIter(RMBufPktQ& aQueue);
       
    58 	inline void Set(RMBufPktQ& aQueue);
       
    59 	inline void SetToFirst();
       
    60 	inline TBool More() const;
       
    61 	inline const RMBufChain& Current() const;
       
    62 	IMPORT_C const RMBufChain& operator++(TInt);
       
    63 	IMPORT_C void Insert(RMBufChain& aNewChain);
       
    64 	IMPORT_C void Remove(RMBufChain& aNewChain);
       
    65 	IMPORT_C void TidyAfterUpdate();
       
    66 	//
       
    67 protected:
       
    68 	// Must be regarded as a const chain, hence the const API
       
    69 	RMBufChain iPrev;
       
    70 	RMBufPktQ* iQueue;
       
    71 	RMBufChain iCurrent;
       
    72 	};
       
    73 #endif
       
    74 
       
    75 #if !defined(__MBufPktQ_Ignore_Inlines__)
       
    76 #include <comms-infras/mbufpktq.inl>
       
    77 #endif // __MBufPktQ_Ignore_Inlines__