]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/libstdc++-v3/contrib/libstdc++-v3-4.1.0/docs/html/ext/pb_assoc/sample_resize_trigger.hpp
update
[l4.git] / l4 / pkg / libstdc++-v3 / contrib / libstdc++-v3-4.1.0 / docs / html / ext / pb_assoc / sample_resize_trigger.hpp
1 /** \r
2 * @file sample_resize_trigger.hpp \r
3 * Contains a sample resize trigger policy class.\r
4\r
5 * Copyright Ami Tavory, IBM-HRL, 2004.\r
6\r
7 * Permission to use, copy, modify, sell, and distribute this software\r
8 *   is hereby granted without fee, provided that the above copyright notice\r
9 *   appears in all copies, and that both that copyright notice and this\r
10 *   permission notice appear in supporting documentation.\r
11 *\r
12 * None of the above authors, nor IBM Haifa Research Laboratories, make any\r
13 *   representation about the suitability of this software for any\r
14 *   purpose. It is provided "as is" without express or implied warranty.\r
15 **/\r
16 \r
17 \r
18 #ifndef SAMPLE_RESIZE_TRIGGER_HPP\r
19 #define SAMPLE_RESIZE_TRIGGER_HPP\r
20 \r
21 \r
22 /**\r
23 * <class \r
24 *   description = "A sample resize trigger policy."\r
25 *  comment = "This class serves to show the interface a trigger policy\r
26 *       needs to support.">\r
27 **/\r
28 class sample_resize_trigger\r
29 {\r
30 /**\r
31 *******************************************************************************\r
32 *******************************************************************************\r
33 * <public_methods_group>\r
34 **/\r
35 public:\r
36         /**\r
37         ***************************************************************************\r
38         ***************************************************************************\r
39         ** <group description = "Constructors, destructor, and related.">\r
40         **/\r
41 \r
42         /*\r
43         * <fn description = "Default constructor."\r
44         *       comment = "Must be default constructible.">\r
45         **/\r
46                 sample_resize_trigger\r
47                 ();\r
48         /** </fn> **/\r
49 \r
50         /*\r
51         * <fn description = "Copy constructor."\r
52         *       comment = "Must be copy constructible.">\r
53         **/\r
54                 sample_range_hashing\r
55                 (const sample_resize_trigger &r_other);\r
56         /** </fn> **/\r
57 \r
58         /*\r
59         * <fn description = "Swaps content."\r
60         *       comment = "Must be swappable (if there is such a word).">\r
61         **/\r
62         inline void\r
63                 swap\r
64                 (sample_resize_trigger &r_other);\r
65         /** </fn> **/\r
66 \r
67         /*\r
68         ***************************************************************************\r
69         ***************************************************************************\r
70         * </group>\r
71         **/\r
72 \r
73         \r
74 /**\r
75 *******************************************************************************\r
76 *******************************************************************************\r
77 * </public_methods_group>\r
78 **/\r
79 \r
80 \r
81 /**\r
82 *******************************************************************************\r
83 *******************************************************************************\r
84 * <protected_methods_group>\r
85 **/\r
86 protected:\r
87         /**\r
88         **************************************************************************      \r
89         ***************************************************************************\r
90         ** <group description = "Insert search notifications."\r
91         **  comment = "Notifications called during an insert operation.">\r
92         **/\r
93 \r
94         /*\r
95         * <fn description = "Notifies a search started.">\r
96         **/\r
97         inline void\r
98                 notify_insert_search_start\r
99                 ();\r
100         /** </fn> **/\r
101 \r
102         /*\r
103         * <fn description = "Notifies a search encountered a collision.">\r
104         **/\r
105         inline void\r
106                 notify_insert_search_collision\r
107                 ();\r
108         /** </fn> **/\r
109 \r
110         /*\r
111         * <fn description = "Notifies a search ended.">\r
112         **/\r
113         inline void\r
114                 notify_insert_search_end\r
115                 ();\r
116         /** </fn> **/\r
117 \r
118         /*\r
119         ***************************************************************************\r
120         ***************************************************************************\r
121         * </group>\r
122         **/\r
123 \r
124 \r
125         /**\r
126         ***************************************************************************\r
127         ***************************************************************************\r
128         ** <group description = "Find search notifications."\r
129         **  comment = "Notifications called during a find operation.">\r
130         **/\r
131 \r
132         /*\r
133         * <fn description = "Notifies a search started.">\r
134         **/\r
135         inline void\r
136                 notify_find_search_start\r
137                 ();\r
138         /** </fn> **/\r
139 \r
140         /*\r
141         * <fn description = "Notifies a search encountered a collision.">\r
142         **/\r
143         inline void\r
144                 notify_find_search_collision\r
145                 ();\r
146         /** </fn> **/\r
147 \r
148         /*\r
149         * <fn description = "Notifies a search ended.">\r
150         **/\r
151         inline void\r
152                 notify_find_search_end\r
153                 ();\r
154         /** </fn> **/\r
155 \r
156         /*\r
157         ***************************************************************************\r
158         ***************************************************************************\r
159         * </group>\r
160         **/\r
161 \r
162 \r
163         /**\r
164         ***************************************************************************\r
165         ***************************************************************************\r
166         ** <group description = "Erase search notifications."\r
167         **  comment = "Notifications called during an insert operation.">\r
168         **/\r
169 \r
170         /*\r
171         * <fn description = "Notifies a search started.">\r
172         **/\r
173         inline void\r
174                 notify_erase_search_start\r
175                 ();\r
176         /** </fn> **/\r
177 \r
178         /*\r
179         * <fn description = "Notifies a search encountered a collision.">\r
180         **/\r
181         inline void\r
182                 notify_erase_search_collision\r
183                 ();\r
184         /** </fn> **/\r
185 \r
186         /*\r
187         * <fn description = "Notifies a search ended.">\r
188         **/\r
189         inline void\r
190                 notify_erase_search_end\r
191                 ();\r
192         /** </fn> **/\r
193 \r
194         /*\r
195         ***************************************************************************\r
196         ***************************************************************************\r
197         * </group>\r
198         **/\r
199 \r
200 \r
201         /**\r
202         ***************************************************************************\r
203         ***************************************************************************\r
204         ** <group description = "Content change notifications."\r
205         **  comment = "Notifications called when the content of the table\r
206         **        changes in a way that can affect the resize policy.">\r
207         **/\r
208 \r
209         /*\r
210         * <fn description = "Notifies an element was inserted.\r
211         *       the total number of entries in the table is num_entries.">\r
212         **/\r
213         inline void\r
214                 notify_inserted\r
215                 (size_type num_entries);\r
216         /** </fn> **/\r
217 \r
218         /*\r
219         * <fn description = "Notifies an element was erased."\r
220         *       the total number of entries in the table is num_entries.">\r
221         **/\r
222         inline void\r
223                 notify_erased\r
224                 (size_type num_entries);\r
225         /** </fn> **/\r
226 \r
227         /*\r
228         * <fn description = "Notifies the table was cleared.">\r
229         **/\r
230         void \r
231                 notify_cleared\r
232                 ();\r
233         /** </fn> **/\r
234 \r
235         /*\r
236         ***************************************************************************\r
237         ***************************************************************************\r
238         * </group>\r
239         **/\r
240 \r
241 \r
242         /**\r
243         ***************************************************************************\r
244         ***************************************************************************\r
245         ** <group description = "Size change notifications."\r
246         **  comment = "Notifications called when the table changes size.">\r
247         **/\r
248 \r
249         /*\r
250         * <fn description = "Notifies the table was resized as a result of\r
251         *   this object's signifying that a resize is needed."\r
252         *       The actual size of the table is new_size.">\r
253         **/\r
254         void\r
255                 notify_resized\r
256                 (size_type new_size);\r
257         /** </fn> **/\r
258 \r
259         /*\r
260         * <fn description = "Notifies the table was resized externally."\r
261         *       The actual size of the table is new_size.">\r
262         **/\r
263         void\r
264                 notify_externally_resized\r
265                 (size_type new_size);\r
266         /** </fn> **/\r
267 \r
268         /*\r
269         ***************************************************************************\r
270         ***************************************************************************\r
271         * </group>\r
272         **/\r
273 \r
274 \r
275         /**\r
276         ***************************************************************************\r
277         ***************************************************************************\r
278         ** <group description = "Queries."\r
279         **  comment = "Called to query whether/how to resize.">\r
280         **/\r
281 \r
282         /*\r
283         * <fn description = "Queries whether a resize is needed.">\r
284         **/\r
285         inline bool \r
286                 is_resize_needed\r
287                 () const;\r
288         /** </fn> **/\r
289 \r
290         /*\r
291         * <fn description = "Queries whether a grow is needed."\r
292         *   comment = "This method is\r
293         *   called only if this object indicated resize is needed.\r
294         *       The actual size of the table is size, and the number of\r
295         *       entries in it is num_entries.">\r
296         **/\r
297         inline bool\r
298                 is_grow_needed\r
299                 (size_type size, \r
300                         size_type num_entries) const;\r
301         /** </fn> **/\r
302 \r
303         /*\r
304         * <fn description = "Queries whether a shrink is needed."\r
305         *   comment = "This method is\r
306         *   called only if this object indicated resize is needed.\r
307         *       The actual size of the table is size, and the number of\r
308         *       entries in it is num_entries.">\r
309         **/\r
310         inline bool\r
311                 is_shrink_needed\r
312                 (size_type size, \r
313                         size_type num_entries) const;\r
314         /** </fn> **/\r
315 \r
316         /*\r
317         ***************************************************************************\r
318         ***************************************************************************\r
319         * </group>\r
320         **/\r
321 \r
322 \r
323 /**\r
324 *******************************************************************************\r
325 *******************************************************************************\r
326 * </protected_methods_group>\r
327 **/\r
328 };\r
329 /**\r
330 * </class>\r
331 **/\r
332 \r
333 \r
334 /*\r
335 ****************************************************************************\r
336 ****************************************************************************\r
337 */\r
338 } // namespace pb_assoc\r
339 \r
340 \r
341 #endif // #ifndef SAMPLE_RESIZE_TRIGGER_HPP\r