2 * @file sample_size_policy.hpp
\r
3 * Contains a sample size resize-policy.
\r
5 * Copyright Ami Tavory, IBM-HRL, 2004.
\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
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
18 #ifndef SAMPLE_SIZE_POLICY_HPP
\r
19 #define SAMPLE_SIZE_POLICY_HPP
\r
24 * description = "A sample size policy."
\r
25 * comment = "This class serves to show the interface a size policy
\r
26 * needs to support.">
\r
28 class sample_size_policy
\r
31 *******************************************************************************
\r
32 *******************************************************************************
\r
33 * <public_methods_group>
\r
37 ***************************************************************************
\r
38 ***************************************************************************
\r
39 ** <group description = "Constructors, destructor, and related.">
\r
43 * <fn description = "Default constructor."
\r
44 * comment = "Must be default constructible.">
\r
51 * <fn description = "Copy constructor."
\r
52 * comment = "Must be copy constructible.">
\r
54 sample_range_hashing
\r
55 (const sample_size_policy &r_other);
\r
59 * <fn description = "Swaps content."
\r
60 * comment = "Must be swappable (if there is such a word).">
\r
64 (sample_size_policy &r_other);
\r
68 ***************************************************************************
\r
69 ***************************************************************************
\r
75 *******************************************************************************
\r
76 *******************************************************************************
\r
77 * </public_methods_group>
\r
82 *******************************************************************************
\r
83 *******************************************************************************
\r
84 * <protected_methods_group>
\r
89 **************************************************************************
\r
90 ***************************************************************************
\r
91 ** <group description = "Size methods">
\r
95 * <fn description = "Given suggested_size, a suggested size, returns
\r
96 * an initial size of the container related to the initial size.">
\r
100 (size_type suggested_size) const;
\r
104 * <fn description = "Given cur_size, the
\r
105 * current size, returns a size that is
\r
109 get_nearest_larger_size
\r
110 (size_type cur_size) const;
\r
114 * <fn description = "Given cur_size, the current size, returns a size that is
\r
118 get_nearest_smaller_size
\r
119 (size_type cur_size) const;
\r
123 **************************************************************************
\r
124 ***************************************************************************
\r
130 *******************************************************************************
\r
131 *******************************************************************************
\r
132 * </protected_methods_group>
\r
140 #endif // #ifndef SAMPLE_SIZE_POLICY_HPP
\r