|
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 #if !defined(__MBufPktQ_inl__) |
|
17 #define __MBufPktQ_inl__ |
|
18 |
|
19 // |
|
20 // MBUF PACKET QUEUE |
|
21 // |
|
22 |
|
23 /** |
|
24 Check if the queue is empty |
|
25 @return True if Empty |
|
26 */ |
|
27 inline TBool RMBufPktQ::IsEmpty() const |
|
28 /** |
|
29 MBUF PACKET QUEUE |
|
30 */ |
|
31 { return iNext.IsEmpty(); } |
|
32 |
|
33 /** |
|
34 Returns the first in the queue |
|
35 @return the first in the queue |
|
36 */ |
|
37 inline const RMBufChain& RMBufPktQ::First() const |
|
38 { return iNext; } |
|
39 |
|
40 /** |
|
41 Returns the last in the queue |
|
42 @return The last in the queue |
|
43 */ |
|
44 inline const RMBufChain& RMBufPktQ::Last() const |
|
45 { return iLast; } |
|
46 |
|
47 // |
|
48 // MBUF PACKET QUEUE ITREATOR |
|
49 // |
|
50 /** |
|
51 Constructor |
|
52 */ |
|
53 inline TMBufPktQIter::TMBufPktQIter(RMBufPktQ& aQueue) |
|
54 : iQueue(&aQueue), iCurrent(aQueue.First()) |
|
55 { } |
|
56 |
|
57 /** |
|
58 Iterates to a a position of an element in the queue |
|
59 @param aQueue the elemet to iterate to |
|
60 */ |
|
61 inline void TMBufPktQIter::Set(RMBufPktQ& aQueue) |
|
62 { iQueue = &aQueue; SetToFirst(); } |
|
63 |
|
64 /** |
|
65 Sets to first position |
|
66 */ |
|
67 inline void TMBufPktQIter::SetToFirst() |
|
68 { iCurrent = iQueue->First(); iPrev.Init(); } |
|
69 |
|
70 /** |
|
71 Checks if there is more in the queue |
|
72 @return True if there is more in the queue |
|
73 */ |
|
74 inline TBool TMBufPktQIter::More() const |
|
75 { return !iCurrent.IsEmpty(); } |
|
76 |
|
77 /** |
|
78 Returns the element in the current position |
|
79 @return The Mbuf in the current position |
|
80 */ |
|
81 inline const RMBufChain& TMBufPktQIter::Current() const |
|
82 { return iCurrent; } |
|
83 |
|
84 #endif // __MBufPktQ_inl__ |