OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [libstdc++-v3/] [docs/] [html/] [ext/] [pb_assoc/] [sample_resize_trigger.hpp] - Blame information for rev 20

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 20 jlechner
/**
2
* @file sample_resize_trigger.hpp
3
* Contains a sample resize trigger policy class.
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.
11
*
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
**/
16
 
17
 
18
#ifndef SAMPLE_RESIZE_TRIGGER_HPP
19
#define SAMPLE_RESIZE_TRIGGER_HPP
20
 
21
 
22
/**
23
* <class
24
*   description = "A sample resize trigger policy."
25
*  comment = "This class serves to show the interface a trigger policy
26
*       needs to support.">
27
**/
28
class sample_resize_trigger
29
{
30
/**
31
*******************************************************************************
32
*******************************************************************************
33
* <public_methods_group>
34
**/
35
public:
36
        /**
37
        ***************************************************************************
38
        ***************************************************************************
39
        ** <group description = "Constructors, destructor, and related.">
40
        **/
41
 
42
        /*
43
        * <fn description = "Default constructor."
44
        *       comment = "Must be default constructible.">
45
        **/
46
                sample_resize_trigger
47
                ();
48
        /** </fn> **/
49
 
50
        /*
51
        * <fn description = "Copy constructor."
52
        *       comment = "Must be copy constructible.">
53
        **/
54
                sample_range_hashing
55
                (const sample_resize_trigger &r_other);
56
        /** </fn> **/
57
 
58
        /*
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_trigger &r_other);
65
        /** </fn> **/
66
 
67
        /*
68
        ***************************************************************************
69
        ***************************************************************************
70
        * </group>
71
        **/
72
 
73
 
74
/**
75
*******************************************************************************
76
*******************************************************************************
77
* </public_methods_group>
78
**/
79
 
80
 
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
        **/
93
 
94
        /*
95
        * <fn description = "Notifies a search started.">
96
        **/
97
        inline void
98
                notify_insert_search_start
99
                ();
100
        /** </fn> **/
101
 
102
        /*
103
        * <fn description = "Notifies a search encountered a collision.">
104
        **/
105
        inline void
106
                notify_insert_search_collision
107
                ();
108
        /** </fn> **/
109
 
110
        /*
111
        * <fn description = "Notifies a search ended.">
112
        **/
113
        inline void
114
                notify_insert_search_end
115
                ();
116
        /** </fn> **/
117
 
118
        /*
119
        ***************************************************************************
120
        ***************************************************************************
121
        * </group>
122
        **/
123
 
124
 
125
        /**
126
        ***************************************************************************
127
        ***************************************************************************
128
        ** <group description = "Find search notifications."
129
        **  comment = "Notifications called during a find operation.">
130
        **/
131
 
132
        /*
133
        * <fn description = "Notifies a search started.">
134
        **/
135
        inline void
136
                notify_find_search_start
137
                ();
138
        /** </fn> **/
139
 
140
        /*
141
        * <fn description = "Notifies a search encountered a collision.">
142
        **/
143
        inline void
144
                notify_find_search_collision
145
                ();
146
        /** </fn> **/
147
 
148
        /*
149
        * <fn description = "Notifies a search ended.">
150
        **/
151
        inline void
152
                notify_find_search_end
153
                ();
154
        /** </fn> **/
155
 
156
        /*
157
        ***************************************************************************
158
        ***************************************************************************
159
        * </group>
160
        **/
161
 
162
 
163
        /**
164
        ***************************************************************************
165
        ***************************************************************************
166
        ** <group description = "Erase search notifications."
167
        **  comment = "Notifications called during an insert operation.">
168
        **/
169
 
170
        /*
171
        * <fn description = "Notifies a search started.">
172
        **/
173
        inline void
174
                notify_erase_search_start
175
                ();
176
        /** </fn> **/
177
 
178
        /*
179
        * <fn description = "Notifies a search encountered a collision.">
180
        **/
181
        inline void
182
                notify_erase_search_collision
183
                ();
184
        /** </fn> **/
185
 
186
        /*
187
        * <fn description = "Notifies a search ended.">
188
        **/
189
        inline void
190
                notify_erase_search_end
191
                ();
192
        /** </fn> **/
193
 
194
        /*
195
        ***************************************************************************
196
        ***************************************************************************
197
        * </group>
198
        **/
199
 
200
 
201
        /**
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.">
207
        **/
208
 
209
        /*
210
        * <fn description = "Notifies an element was inserted.
211
        *       the total number of entries in the table is num_entries.">
212
        **/
213
        inline void
214
                notify_inserted
215
                (size_type num_entries);
216
        /** </fn> **/
217
 
218
        /*
219
        * <fn description = "Notifies an element was erased."
220
        *       the total number of entries in the table is num_entries.">
221
        **/
222
        inline void
223
                notify_erased
224
                (size_type num_entries);
225
        /** </fn> **/
226
 
227
        /*
228
        * <fn description = "Notifies the table was cleared.">
229
        **/
230
        void
231
                notify_cleared
232
                ();
233
        /** </fn> **/
234
 
235
        /*
236
        ***************************************************************************
237
        ***************************************************************************
238
        * </group>
239
        **/
240
 
241
 
242
        /**
243
        ***************************************************************************
244
        ***************************************************************************
245
        ** <group description = "Size change notifications."
246
        **  comment = "Notifications called when the table changes size.">
247
        **/
248
 
249
        /*
250
        * <fn description = "Notifies the table was resized as a result of
251
        *   this object's signifying that a resize is needed."
252
        *       The actual size of the table is new_size.">
253
        **/
254
        void
255
                notify_resized
256
                (size_type new_size);
257
        /** </fn> **/
258
 
259
        /*
260
        * <fn description = "Notifies the table was resized externally."
261
        *       The actual size of the table is new_size.">
262
        **/
263
        void
264
                notify_externally_resized
265
                (size_type new_size);
266
        /** </fn> **/
267
 
268
        /*
269
        ***************************************************************************
270
        ***************************************************************************
271
        * </group>
272
        **/
273
 
274
 
275
        /**
276
        ***************************************************************************
277
        ***************************************************************************
278
        ** <group description = "Queries."
279
        **  comment = "Called to query whether/how to resize.">
280
        **/
281
 
282
        /*
283
        * <fn description = "Queries whether a resize is needed.">
284
        **/
285
        inline bool
286
                is_resize_needed
287
                () const;
288
        /** </fn> **/
289
 
290
        /*
291
        * <fn description = "Queries whether a grow is needed."
292
        *   comment = "This method is
293
        *   called only if this object indicated resize is needed.
294
        *       The actual size of the table is size, and the number of
295
        *       entries in it is num_entries.">
296
        **/
297
        inline bool
298
                is_grow_needed
299
                (size_type size,
300
                        size_type num_entries) const;
301
        /** </fn> **/
302
 
303
        /*
304
        * <fn description = "Queries whether a shrink is needed."
305
        *   comment = "This method is
306
        *   called only if this object indicated resize is needed.
307
        *       The actual size of the table is size, and the number of
308
        *       entries in it is num_entries.">
309
        **/
310
        inline bool
311
                is_shrink_needed
312
                (size_type size,
313
                        size_type num_entries) const;
314
        /** </fn> **/
315
 
316
        /*
317
        ***************************************************************************
318
        ***************************************************************************
319
        * </group>
320
        **/
321
 
322
 
323
/**
324
*******************************************************************************
325
*******************************************************************************
326
* </protected_methods_group>
327
**/
328
};
329
/**
330
* </class>
331
**/
332
 
333
 
334
/*
335
****************************************************************************
336
****************************************************************************
337
*/
338
} // namespace pb_assoc
339
 
340
 
341
#endif // #ifndef SAMPLE_RESIZE_TRIGGER_HPP

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.