2 * @file sample_update_policy.hpp
3 * Contains a sample policy for list update containers.
5 * Copyright Ami Tavory, IBM-HRL, 2004.
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.
18 #ifndef SAMPLE_UPDATE_POLICY_HPP
19 #define SAMPLE_UPDATE_POLICY_HPP
24 * description = "A sample list-update policy."
25 * comment = "This class serves to show the interface a list update functor
28 class sample_update_policy
31 *******************************************************************************
32 *******************************************************************************
33 * <public_methods_group>
37 ***************************************************************************
38 ***************************************************************************
39 ** <group description = "Constructors, destructor, and related.">
43 * <fn description = "Default constructor."
44 * comment = "Must be default constructible.">
51 * <fn description = "Copy constructor."
52 * comment = "Must be copy constructible.">
55 (const sample_update_policy
&r_other
);
59 * <fn description = "Swaps content."
60 * comment = "Must be swappable (if there is such a word).">
64 (sample_update_policy
&r_other
);
68 ***************************************************************************
69 ***************************************************************************
74 *******************************************************************************
75 *******************************************************************************
76 * </public_methods_group>
81 *******************************************************************************
82 *******************************************************************************
83 * <protected_types_group>
88 ***************************************************************************
89 ***************************************************************************
90 ** <group description = "Metadata definitions.">
94 * <tdef description = "Metadata on which this functor operates."
95 * comment = "The class must declare the metadata type on which it
96 * operates; the list-update based containers will append to
97 * each node an object of this type.">
106 ***************************************************************************
107 ***************************************************************************
112 *******************************************************************************
113 *******************************************************************************
114 * </protected_types_group>
119 *******************************************************************************
120 *******************************************************************************
121 * <protected_methods_group>
125 ***************************************************************************
126 ***************************************************************************
127 ** <group description = "Metadata operations.">
131 * <fn description = "Creates a metadata object."
132 * comment = "A list-update based container object will call this
133 * method to create a metadata type when a node is created.">
141 * <fn description = "Decides whether a metadata object should be
142 * moved to the front of the list. A list-update based containers object
144 * method to decide whether to move a node to the front of
145 * the list. The method shoule return true if the node should
146 * be moved to the front of the list."
147 * comment = "@@sample_update_policy_metadata_reference">
151 (metadata_reference r_data
) const;
155 ***************************************************************************
156 ***************************************************************************
161 *******************************************************************************
162 *******************************************************************************
163 * </protected_methods_group>
171 #endif // #ifndef SAMPLE_UPDATE_POLICY_HPP