Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / libstdc++-v3 / docs / html / ext / pb_assoc / sample_resize_policy.hpp
blob4101a70fb3c59d091aa7ed352c54b8b397bd28aa
1 /**
2 * @file sample_resize_policy.hpp
3 * Contains a sample resize policy for hash tables.
4 *
5 * Copyright Ami Tavory, IBM-HRL, 2004.
6 *
7 * Permission to use, copy, modify, sell, and distribute this software
8 * is hereby granted without fee, provided that the above copyright notice
9 * appears in all copies, and that both that copyright notice and this
10 * permission notice appear in supporting documentation,
12 * None of the above authors, nor IBM Haifa Research Laboratories, make any
13 * representation about the suitability of this software for any
14 * purpose. It is provided "as is" without express or implied warranty.
15 **/
18 #ifndef SAMPLE_RESIZE_POLICY_HPP
19 #define SAMPLE_RESIZE_POLICY_HPP
22 /**
23 * <class
24 * description = "A sample resize policy."
25 * comment = "This class serves to show the interface a resize policy
26 * needs to support.">
27 **/
28 class sample_resize_policy
30 /**
31 *******************************************************************************
32 *******************************************************************************
33 * <public_methods_group>
34 **/
35 public:
36 /**
37 ***************************************************************************
38 ***************************************************************************
39 ** <group description = "Constructors, destructor, and related.">
40 **/
43 * <fn description = "Default constructor."
44 * comment = "Must be default constructible.">
45 **/
46 sample_resize_policy
47 ();
48 /** </fn> **/
51 * <fn description = "Copy constructor."
52 * comment = "Must be copy constructible.">
53 **/
54 sample_range_hashing
55 (const sample_resize_policy &r_other);
56 /** </fn> **/
59 * <fn description = "Swaps content."
60 * comment = "Must be swappable (if there is such a word).">
61 **/
62 inline void
63 swap
64 (sample_resize_policy &r_other);
65 /** </fn> **/
68 ***************************************************************************
69 ***************************************************************************
70 * </group>
71 **/
74 /**
75 *******************************************************************************
76 *******************************************************************************
77 * </public_methods_group>
78 **/
81 /**
82 *******************************************************************************
83 *******************************************************************************
84 * <protected_methods_group>
85 **/
86 protected:
87 /**
88 ***************************************************************************
89 ***************************************************************************
90 ** <group description = "Insert search notifications."
91 ** comment = "Notifications called during an insert operation.">
92 **/
95 * <fn description = "Notifies a search started.">
96 **/
97 inline void
98 notify_insert_search_start
99 ();
100 /** </fn> **/
103 * <fn description = "Notifies a search encountered a collision.">
105 inline void
106 notify_insert_search_collision
108 /** </fn> **/
111 * <fn description = "Notifies a search ended.">
113 inline void
114 notify_insert_search_end
116 /** </fn> **/
119 ***************************************************************************
120 ***************************************************************************
121 * </group>
126 ***************************************************************************
127 ***************************************************************************
128 ** <group description = "Find search notifications."
129 ** comment = "Notifications called during a find operation.">
133 * <fn description = "Notifies a search started.">
135 inline void
136 notify_find_search_start
138 /** </fn> **/
141 * <fn description = "Notifies a search encountered a collision.">
143 inline void
144 notify_find_search_collision
146 /** </fn> **/
149 * <fn description = "Notifies a search ended.">
151 inline void
152 notify_find_search_end
154 /** </fn> **/
157 ***************************************************************************
158 ***************************************************************************
159 * </group>
164 ***************************************************************************
165 ***************************************************************************
166 ** <group description = "Erase search notifications."
167 ** comment = "Notifications called during an insert operation.">
171 * <fn description = "Notifies a search started.">
173 inline void
174 notify_erase_search_start
176 /** </fn> **/
179 * <fn description = "Notifies a search encountered a collision.">
181 inline void
182 notify_erase_search_collision
184 /** </fn> **/
187 * <fn description = "Notifies a search ended.">
189 inline void
190 notify_erase_search_end
192 /** </fn> **/
195 ***************************************************************************
196 ***************************************************************************
197 * </group>
202 ***************************************************************************
203 ***************************************************************************
204 ** <group description = "Content change notifications."
205 ** comment = "Notifications called when the content of the table
206 ** changes in a way that can affect the resize policy.">
210 * <fn description = "Notifies an element was inserted.">
212 inline void
213 notify_inserted
214 (size_type num_e);
215 /** </fn> **/
218 * <fn description = "Notifies an element was erased.">
220 inline void
221 notify_erased
222 (size_type num_e);
223 /** </fn> **/
226 * <fn description = "Notifies the table was cleared.">
228 void
229 notify_cleared
231 /** </fn> **/
234 ***************************************************************************
235 ***************************************************************************
236 * </group>
241 ***************************************************************************
242 ***************************************************************************
243 ** <group description = "Size change notifications."
244 ** comment = "Notifications called when the table changes size.">
248 * <fn description = "Notifies the table was resized to new_size.">
250 void
251 notify_resized
252 (size_type new_size);
253 /** </fn> **/
256 ***************************************************************************
257 ***************************************************************************
258 * </group>
263 ***************************************************************************
264 ***************************************************************************
265 ** <group description = "Queries."
266 ** comment = "Called to query whether/how to resize.">
270 * <fn description = "Queries initial size.">
272 size_type
273 get_init_size
274 () const;
275 /** </fn> **/
278 * <fn description = "Queries whether a resize is needed.">
280 inline bool
281 is_resize_needed
282 () const;
283 /** </fn> **/
286 * <fn description = "Queries what the new size should be.">
288 size_type
289 get_new_size
290 (size_type size, size_type num_used_e) const;
291 /** </fn> **/
294 ***************************************************************************
295 ***************************************************************************
296 * </group>
300 *******************************************************************************
301 *******************************************************************************
302 * </protected_methods_group>
306 * </class>
310 #endif // #ifndef SAMPLE_RESIZE_POLICY_HPP