|
1 // Copyright (c) 1999-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 #include "ASSrvIteratorBySessionId.h" |
|
17 |
|
18 // System includes |
|
19 |
|
20 // User includes |
|
21 #include "ASSrvAlarm.h" |
|
22 #include "ASSrvAlarmQueue.h" |
|
23 |
|
24 // Type definitions |
|
25 |
|
26 // Constants |
|
27 |
|
28 // Enumerations |
|
29 |
|
30 // Classes referenced |
|
31 |
|
32 |
|
33 // |
|
34 // ----> RASSrvIteratorBySessionId (source) |
|
35 // |
|
36 |
|
37 //************************************************************************************* |
|
38 RASSrvIteratorBySessionId::RASSrvIteratorBySessionId(CASSrvAlarmQueue& aQueue, TASSrvSessionId aId) |
|
39 : RASSrvIteratorBase(aQueue) |
|
40 { |
|
41 SetSessionId(aId); |
|
42 Open(); |
|
43 } |
|
44 |
|
45 |
|
46 // |
|
47 // |
|
48 // |
|
49 |
|
50 |
|
51 //************************************************************************************* |
|
52 /** |
|
53 * Change the category for this iterator. Resets the iterator back to the start |
|
54 * of the queue |
|
55 */ |
|
56 void RASSrvIteratorBySessionId::SetSessionId(TASSrvSessionId aId) |
|
57 { |
|
58 iSessionId = aId; |
|
59 } |
|
60 |
|
61 |
|
62 // |
|
63 // |
|
64 // |
|
65 |
|
66 |
|
67 //************************************************************************************* |
|
68 /** |
|
69 * @see RASSrvIteratorBase |
|
70 */ |
|
71 TBool RASSrvIteratorBySessionId::Matches(const TASSrvAlarm& aAlarm) const |
|
72 { |
|
73 // Check with other iterator - returns ETrue if there is no attached |
|
74 // iterator to check with. |
|
75 TBool matches = RASSrvIteratorBase::Matches(aAlarm); |
|
76 |
|
77 // Now check this iterator |
|
78 if (matches) |
|
79 matches = aAlarm.OriginatingSessionId() == iSessionId; |
|
80 // |
|
81 return matches; |
|
82 } |