|
1 // Copyright (c) 2008-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 #ifndef __UPNPSPSUBSCRIBEINFOCONTAINER_INL_ |
|
17 #define __UPNPSPSUBSCRIBEINFOCONTAINER_INL_ |
|
18 |
|
19 #include "upnpspsubscribeinfocontainer.h" |
|
20 |
|
21 CUPnPSubscribeInfoContainer* CUPnPSubscribeInfoContainer::NewL ( ) |
|
22 { |
|
23 return new ( ELeave ) CUPnPSubscribeInfoContainer ( ); |
|
24 } |
|
25 |
|
26 CUPnPSubscribeInfoContainer::~CUPnPSubscribeInfoContainer ( ) |
|
27 { |
|
28 iEventData.Close ( ); |
|
29 iSubscribeInfoElementArr.ResetAndDestroy ( ); |
|
30 } |
|
31 |
|
32 void CUPnPSubscribeInfoContainer::AppendSubscribeInfoElementL ( CUPnPSubscribeInfoElement* aElement ) const |
|
33 { |
|
34 iSubscribeInfoElementArr.AppendL ( aElement ); |
|
35 } |
|
36 |
|
37 void CUPnPSubscribeInfoContainer::SetEventDataL ( const TDesC8& aEventData) const |
|
38 { |
|
39 iEventData.Close ( ); |
|
40 iEventData.CreateL ( aEventData ); |
|
41 } |
|
42 |
|
43 const TDesC8&CUPnPSubscribeInfoContainer::EventData ( ) const |
|
44 { |
|
45 return iEventData; |
|
46 } |
|
47 |
|
48 inline void CUPnPSubscribeInfoContainer::DeleteSubscribeInfoElement ( CUPnPSubscribeInfoElement* aElement ) |
|
49 { |
|
50 TInt index = iSubscribeInfoElementArr.Find(aElement); |
|
51 __ASSERT_DEBUG(index!=KErrNotFound,User::Invariant()); |
|
52 delete aElement; |
|
53 aElement = NULL; |
|
54 iSubscribeInfoElementArr.Remove(index); |
|
55 } |
|
56 |
|
57 TInt CUPnPSubscribeInfoContainer::CountOfSubscribeInfoElementArray ( ) const |
|
58 { |
|
59 return iSubscribeInfoElementArr.Count ( ); |
|
60 } |
|
61 |
|
62 CUPnPSubscribeInfoElement* CUPnPSubscribeInfoContainer::AtSubscribeInfoElementArray ( TInt aIndex ) const |
|
63 { |
|
64 __ASSERT_DEBUG ( aIndex >= 0 && aIndex < iSubscribeInfoElementArr.Count ( ), User::Invariant ( ) ); |
|
65 |
|
66 return iSubscribeInfoElementArr[aIndex]; |
|
67 } |
|
68 |
|
69 CUPnPSubscribeInfoElement* CUPnPSubscribeInfoContainer::GetSubscribeInfoBySid ( const TDesC8& aSid ) const |
|
70 { |
|
71 TUint count = iSubscribeInfoElementArr.Count ( ); |
|
72 for ( TInt i = 0; i < count; i++ ) |
|
73 { |
|
74 CUPnPSubscribeInfoElement* element = iSubscribeInfoElementArr[i]; |
|
75 if ( aSid.CompareF( element->SubscriptionIdentifier ( ) ) == 0 ) |
|
76 { |
|
77 return element; |
|
78 } |
|
79 } |
|
80 return NULL; |
|
81 } |
|
82 |
|
83 #endif /*UPNPSPSUBSCRIBEINFOCONTAINER_INL_*/ |