|
1 // Copyright (c) 2007-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 // SPUD binder manager |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 #ifndef BINDMAN_INL |
|
24 #define BINDMAN_INL |
|
25 |
|
26 /** |
|
27 Returns a pointer to the SpudMux object and transfers ownership. |
|
28 |
|
29 @return Pointer to SpudMux (ownership is transferred) |
|
30 */ |
|
31 inline CSpudMux* CBindMan::TransferSpudMux() |
|
32 { |
|
33 ASSERT(iDeleteMux); |
|
34 iDeleteMux = EFalse; |
|
35 ASSERT(iMux); |
|
36 return iMux; |
|
37 } |
|
38 |
|
39 /** |
|
40 Returns a pointer to the SpudMux object. |
|
41 |
|
42 @return pointer to SpudMux |
|
43 */ |
|
44 inline CSpudMux* CBindMan::SpudMux() const |
|
45 { |
|
46 ASSERT(iMux); |
|
47 return iMux; |
|
48 } |
|
49 |
|
50 /** |
|
51 Returns a pointer to the SpudMan object. |
|
52 |
|
53 @return pointer to SpudMan |
|
54 */ |
|
55 inline CSpudMan* CBindMan::SpudMan() const |
|
56 { |
|
57 return &iSpudMan; |
|
58 } |
|
59 |
|
60 /** |
|
61 Returns a pointer to the SpudProtocol object. |
|
62 |
|
63 @return pointer to SpudProtocol |
|
64 */ |
|
65 inline CSpudProtocol* CBindMan::SpudProtocol() const |
|
66 { |
|
67 return iSpudProtocol; |
|
68 } |
|
69 |
|
70 /** |
|
71 Removes the pointer to the mux object once NIFMAN has deleted it. |
|
72 */ |
|
73 inline void CBindMan::MuxClosed() |
|
74 { |
|
75 iMux = NULL; |
|
76 } |
|
77 |
|
78 /** |
|
79 Determines if this binder ref has been bound to a NIF yet. |
|
80 If not, then it can be used for a new connection. |
|
81 |
|
82 @return ETrue if object is already bound |
|
83 */ |
|
84 inline TBool CSpudBinderRef::IsBound() const |
|
85 { |
|
86 return iNifLink != NULL; |
|
87 } |
|
88 |
|
89 /** |
|
90 Determines if this object is a binder for the given lower NIF. |
|
91 @return ETrue on a match |
|
92 */ |
|
93 inline TBool CSpudBinderRef::MatchBase(const CNifIfBase* aBase) const |
|
94 { |
|
95 return aBase == iNifBase; |
|
96 } |
|
97 |
|
98 /** |
|
99 Returns a pointer to the CNifIfLink object. |
|
100 |
|
101 @return pointer to CNifIfLink |
|
102 */ |
|
103 inline CNifIfLink* CSpudBinderRef::NifLink() const |
|
104 { |
|
105 ASSERT(iNifLink); |
|
106 return iNifLink; |
|
107 } |
|
108 |
|
109 /** |
|
110 Returns a pointer to the CNifIfBase object. |
|
111 |
|
112 @return pointer to CNifIfBase |
|
113 */ |
|
114 inline CNifIfBase* CSpudBinderRef::NifBase() const |
|
115 { |
|
116 ASSERT(iNifBase); |
|
117 return iNifBase; |
|
118 } |
|
119 |
|
120 /** |
|
121 Returns a pointer to the CSpudNotify object. |
|
122 |
|
123 @return pointer to CSpudNotify |
|
124 */ |
|
125 inline CSpudNotify* CSpudBinderRef::Notify() const |
|
126 { |
|
127 ASSERT(iNotify); |
|
128 return iNotify; |
|
129 } |
|
130 |
|
131 /** |
|
132 Returns the state of the associated PDP context. |
|
133 |
|
134 @return state |
|
135 */ |
|
136 inline TSpudContextStates CSpudBinderRef::State() const |
|
137 { |
|
138 return iState; |
|
139 } |
|
140 |
|
141 /** |
|
142 Sets the state of the associated PDP context. |
|
143 |
|
144 @param new state |
|
145 */ |
|
146 inline void CSpudBinderRef::SetState(TSpudContextStates aState) |
|
147 { |
|
148 // Binder must not be touched once it is designated for deletion, else we can leak it. |
|
149 ASSERT(ESpudWaitBinderDelete != iState); |
|
150 iState = aState; |
|
151 } |
|
152 |
|
153 /** |
|
154 Stores an error code detailing cause of context failure. |
|
155 |
|
156 @param error code |
|
157 */ |
|
158 inline void CSpudBinderRef::SetError(TInt aError) |
|
159 { |
|
160 iError = aError; |
|
161 } |
|
162 |
|
163 /** |
|
164 Returns the context failure error |
|
165 */ |
|
166 inline TInt CSpudBinderRef::Error() const |
|
167 { |
|
168 return iError; |
|
169 } |
|
170 |
|
171 /** |
|
172 Binds the binder object to the lower NIF. |
|
173 */ |
|
174 inline void CSpudBinderRef::Bind(CNifIfLink* aNifLink, CNifIfBase* aNifBase) |
|
175 { |
|
176 iNifBase = aNifBase; |
|
177 iNifLink = aNifLink; |
|
178 ASSERT(iNifBase); |
|
179 ASSERT(iNifLink); |
|
180 } |
|
181 |
|
182 #endif |