|
1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Class for storing active traffic streams. |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 9 % |
|
20 */ |
|
21 |
|
22 #ifndef CORE_TRAFFIC_STREAM_LIST_H |
|
23 #define CORE_TRAFFIC_STREAM_LIST_H |
|
24 |
|
25 #include "core_type_list.h" |
|
26 #include "core_traffic_stream.h" |
|
27 |
|
28 class core_traffic_stream_c; |
|
29 |
|
30 /** |
|
31 * This is a storage class for active traffic streams. |
|
32 * |
|
33 * @since S60 v3.2 |
|
34 */ |
|
35 NONSHARABLE_CLASS( core_traffic_stream_list_c ) |
|
36 { |
|
37 |
|
38 friend class core_traffic_stream_list_iter_c; |
|
39 |
|
40 public: |
|
41 |
|
42 /** |
|
43 * Structure for storing active traffic streams. |
|
44 */ |
|
45 struct entry_s |
|
46 { |
|
47 /** Data of the AP. */ |
|
48 core_traffic_stream_c* traffic_stream; |
|
49 }; |
|
50 |
|
51 /** |
|
52 * Constructor. |
|
53 * |
|
54 * @since S60 v3.2 |
|
55 * @param iap_data containing structure of IAP data |
|
56 */ |
|
57 core_traffic_stream_list_c(); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 virtual ~core_traffic_stream_list_c(); |
|
63 |
|
64 /** |
|
65 * Return the amount of entries in the list. |
|
66 * |
|
67 * @since S60 v3.2 |
|
68 * @return The amount of entries in the list. |
|
69 */ |
|
70 u32_t count() const; |
|
71 |
|
72 /** |
|
73 * Return the first entry in the list. |
|
74 * @return The first entry in the list. NULL if none. |
|
75 */ |
|
76 core_traffic_stream_c* first(); |
|
77 |
|
78 /** |
|
79 * Return the next entry in the list. |
|
80 * @return The next entry in the list. NULL if none. |
|
81 */ |
|
82 core_traffic_stream_c* next(); |
|
83 |
|
84 /** |
|
85 * Return the current entry in the list. |
|
86 * @return The current entry in the list. NULL if none. |
|
87 */ |
|
88 core_traffic_stream_c* current() const; |
|
89 |
|
90 /** |
|
91 * Append an entry to the list. |
|
92 * |
|
93 * @since S60 v3.2 |
|
94 * @param traffic_stream Traffic stream to be added. If an entry already exists, it is replaced. |
|
95 * @return core_error_ok if success, an error code otherwise. |
|
96 */ |
|
97 core_error_e update_traffic_stream( |
|
98 const core_traffic_stream_c& traffic_stream ); |
|
99 |
|
100 /** |
|
101 * Remove entry with a matching TID. |
|
102 * |
|
103 * @since S60 v3.2 |
|
104 * @param tid TID to match against. |
|
105 */ |
|
106 void remove_traffic_stream_by_tid( |
|
107 u8_t tid ); |
|
108 |
|
109 /** |
|
110 * Print the contents of the list. |
|
111 */ |
|
112 void print_contents(); |
|
113 |
|
114 /** |
|
115 * Calculate the combined admitted medium time. |
|
116 * |
|
117 * @since S60 v3.2 |
|
118 * @return The combined admitted medium time. MEDIUM_TIME_NOT_DEFINED if none. |
|
119 */ |
|
120 medium_time_s admitted_medium_time(); |
|
121 |
|
122 /** |
|
123 * Check whether the given access class has any traffic streams. |
|
124 * |
|
125 * @since S60 v3.2 |
|
126 * @param access_class Access class to search for. |
|
127 * @return true_t if any traffic stream exist, false_t otherwise. |
|
128 */ |
|
129 bool_t is_traffic_stream_for_access_class( |
|
130 core_access_class_e access_class ); |
|
131 |
|
132 /** |
|
133 * Check whether a traffic stream exists for the given TID. |
|
134 * |
|
135 * @since S60 v3.2 |
|
136 * @param tid TID to search for. |
|
137 * @return true_t if a traffic stream exists, false_t otherwise. |
|
138 */ |
|
139 bool_t is_traffic_stream_for_tid( |
|
140 u8_t tid ); |
|
141 |
|
142 /** |
|
143 * Set the given status to all traffic streams. |
|
144 * |
|
145 * @since S60 v3.2 |
|
146 * @param status Status to be set. |
|
147 */ |
|
148 void set_traffic_stream_status( |
|
149 core_traffic_stream_status_e status ); |
|
150 |
|
151 /** |
|
152 * Get the next free TID. |
|
153 * |
|
154 * @return The next free TID, MAX_TRAFFIC_STREAM_TID if no available. |
|
155 */ |
|
156 u8_t next_tid(); |
|
157 |
|
158 private: // data |
|
159 |
|
160 /** |
|
161 * List of beacons/probe responses. |
|
162 */ |
|
163 core_type_list_c<entry_s> ts_list_m; |
|
164 |
|
165 }; |
|
166 |
|
167 #endif // CORE_TRAFFIC_STREAM_LIST_H |