1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3 4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 5<head> 6 <meta name="generator" content= 7 "HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org" /> 8 9 <title>sample_update_policy Interface</title> 10 <meta http-equiv="Content-Type" content= 11 "text/html; charset=us-ascii" /> 12 </head> 13 14<body> 15 <div id="page"> 16 <h1><tt>sample_update_policy</tt> Interface</h1> 17 18 <p>A sample list-update policy.</p> 19 20 <p>This class serves to show the interface a list update 21 functor needs to support.</p> 22 23 <p>Defined in: <a href= 24 "http://gcc.gnu.org/viewcvs/*checkout*/trunk/libstdc%2B%2B-v3/include/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp"><tt>sample_update_policy.hpp</tt></a></p> 25 26 <h2><a name="link1" id="link1">Public Methods</a></h2> 27 28 <h3><a name="link2" id="link2">Constructors, destructor, and 29 related.</a></h3> 30 31 <table class="c1" width="100%" border="1" summary="Methods"> 32 <tr> 33 <td width="45%" align="left"><b>Method</b></td> 34 35 <td width="55%" align="left"><b>Description</b></td> 36 </tr> 37 38 <tr> 39 <td> 40 <pre> 41 sample_update_policy 42 () 43</pre> 44 </td> 45 46 <td> 47 <p>Default constructor.</p> 48 49 <p>Must be default constructable.</p> 50 </td> 51 </tr> 52 53 <tr> 54 <td> 55 <pre> 56 sample_update_policy 57 (<b>const</b> sample_update_policy &other) 58</pre> 59 </td> 60 61 <td> 62 <p>Copy constructor.</p> 63 64 <p>Must be copy constructable.</p> 65 </td> 66 </tr> 67 68 <tr> 69 <td> 70 <pre> 71<b>inline</b> <b>void</b> 72 swap 73 (sample_update_policy &other) 74</pre> 75 </td> 76 77 <td> 78 <p>Swaps content.</p> 79 80 <p>Must be swappable (if there is such a word).</p> 81 </td> 82 </tr> 83 </table> 84 85 <h2><a name="link3" id="link3">Protected Types and 86 Constants</a></h2> 87 88 <h3><a name="link4" id="link4">Metadata definitions.</a></h3> 89 90 <table class="c1" width="100%" border="1" summary="Types"> 91 <tr> 92 <td width="30%" align="left"><b>Type</b></td> 93 94 <td width="55%" align="left"><b>Definition</b></td> 95 96 <td width="15%" align="left"><b>Description</b></td> 97 </tr> 98 99 <tr> 100 <td> 101 <pre> 102<a name="metadata_type2849297114" id= 103"metadata_type2849297114">metadata_type</a> 104</pre> 105 </td> 106 107 <td> 108 <pre> 109Some metadata type. 110</pre> 111 </td> 112 113 <td> 114 <p>Metadata on which this functor operates.</p> 115 116 <p>The <tt><b>class</b></tt> must declare the metadata 117 type on which it operates; the list-update based 118 containers will append to each node an object of this 119 type.</p> 120 </td> 121 </tr> 122 </table> 123 124 <h2><a name="link5" id="link5">Protected Methods</a></h2> 125 126 <h3><a name="link6" id="link6">Metadata operations.</a></h3> 127 128 <table class="c1" width="100%" border="1" summary="Methods"> 129 <tr> 130 <td width="45%" align="left"><b>Method</b></td> 131 132 <td width="55%" align="left"><b>Description</b></td> 133 </tr> 134 135 <tr> 136 <td> 137 <pre> 138<a href="#metadata_type2849297114"><tt>metadata_type</tt></a> 139 <b>operator</b>() 140 () <b>const</b> 141</pre> 142 </td> 143 144 <td> 145 <p>Creates a metadata object.</p> 146 147 <p>A list-update based container object will call this 148 method to create a metadata type when a node is 149 created.</p> 150 </td> 151 </tr> 152 153 <tr> 154 <td> 155 <pre> 156<b>bool</b> 157 <b>operator</b>() 158 (metadata_reference r_data) <b>const</b> 159</pre> 160 </td> 161 162 <td> 163 <p>Decides whether a metadata object should be moved to 164 the front of the list. A list-update based containers 165 object will call this method to decide whether to move a 166 node to the front of the list. The method should return 167 <tt><b>true</b></tt> if the node should be moved to the 168 front of the list.</p> 169 170 <p><tt>metadata_reference</tt> is a reference to a 171 <a href= 172 "#metadata_type2849297114"><tt>metadata_type</tt></a>.</p> 173 </td> 174 </tr> 175 </table> 176 </div> 177</body> 178</html> 179