1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>DbMpoolFile::put()</title> 7 <link rel="stylesheet" href="apiReference.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" /> 10 <link rel="up" href="memp.html" title="Chapter 9. The DbMpoolFile Handle" /> 11 <link rel="prev" href="mempfopen.html" title="DbMpoolFile::open()" /> 12 <link rel="next" href="mempfsync.html" title="DbMpoolFile::sync()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbMpoolFile::put()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="mempfopen.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 9. 23 The DbMpoolFile Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="mempfsync.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="mempput"></a>DbMpoolFile::put()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41DbMpoolFile::put(void *pgaddr, DB_CACHE_PRIORITY priority, u_int32_t flags);</pre> 42 <p> 43 The <code class="methodname">DbMpoolFile::put()</code> method returns a reference to a page in the 44 cache, setting the priority of the page as specified by the <span class="bold"><strong>priority</strong></span> parameter. 45 </p> 46 <p> 47 The <code class="methodname">DbMpoolFile::put()</code> <span> 48 49 <span> 50 method either returns a non-zero error value or throws an 51 exception that encapsulates a non-zero error value on 52 failure, and returns 0 on success. 53 </span> 54 </span> 55 </p> 56 <div class="sect2" lang="en" xml:lang="en"> 57 <div class="titlepage"> 58 <div> 59 <div> 60 <h3 class="title"><a id="id1694844"></a>Parameters</h3> 61 </div> 62 </div> 63 </div> 64 <div class="sect3" lang="en" xml:lang="en"> 65 <div class="titlepage"> 66 <div> 67 <div> 68 <h4 class="title"><a id="id1694544"></a>flags</h4> 69 </div> 70 </div> 71 </div> 72 <p> 73 The <span class="bold"><strong>flags</strong></span> parameter is currently 74 unused, and must be set to 0. 75 </p> 76 </div> 77 <div class="sect3" lang="en" xml:lang="en"> 78 <div class="titlepage"> 79 <div> 80 <div> 81 <h4 class="title"><a id="id1695215"></a>pgaddr</h4> 82 </div> 83 </div> 84 </div> 85 <p> 86 The <span class="bold"><strong>pgaddr</strong></span> parameter is the address 87 of the page to be returned to the cache. The <span class="bold"><strong>pgaddr</strong></span> parameter must be a value previously 88 returned by the 89 <a class="xref" href="mempfget.html" title="DbMpoolFile::get()">DbMpoolFile::get()</a> method. 90 </p> 91 </div> 92 <div class="sect3" lang="en" xml:lang="en"> 93 <div class="titlepage"> 94 <div> 95 <div> 96 <h4 class="title"><a id="id1694388"></a>priority</h4> 97 </div> 98 </div> 99 </div> 100 <p> 101 Set the page's <span class="bold"><strong>priority</strong></span> as follows: 102 </p> 103 <div class="itemizedlist"> 104 <ul type="disc"> 105 <li> 106 <p><a id="fput_DB_PRIORITY_UNCHANGED"></a> 107 <code class="literal">DB_PRIORITY_UNCHANGED</code> 108 </p> 109 <p> 110 The priority is unchanged. 111 </p> 112 </li> 113 <li> 114 <p> 115 <code class="literal">DB_PRIORITY_VERY_LOW</code> 116 </p> 117 <p> 118 The lowest priority: pages are the most likely to be discarded. 119 </p> 120 </li> 121 <li> 122 <p> 123 <code class="literal">DB_PRIORITY_LOW</code> 124 </p> 125 <p> 126 The next lowest priority. 127 </p> 128 </li> 129 <li> 130 <p> 131 <code class="literal">DB_PRIORITY_DEFAULT</code> 132 </p> 133 <p> 134 The default priority. 135 </p> 136 </li> 137 <li> 138 <p> 139 <code class="literal">DB_PRIORITY_HIGH</code> 140 </p> 141 <p> 142 The next highest priority. 143 </p> 144 </li> 145 <li> 146 <p> 147 <code class="literal">DB_PRIORITY_VERY_HIGH</code> 148 </p> 149 <p> 150 The highest priority: pages are the least likely to be discarded. 151 </p> 152 </li> 153 </ul> 154 </div> 155 </div> 156 </div> 157 <div class="sect2" lang="en" xml:lang="en"> 158 <div class="titlepage"> 159 <div> 160 <div> 161 <h3 class="title"><a id="id1695258"></a>Errors</h3> 162 </div> 163 </div> 164 </div> 165 <p> 166 The <code class="methodname">DbMpoolFile::put()</code> <span> 167 168 <span> 169 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> 170 exception, encapsulating one of the following non-zero errors, or return one 171 of the following non-zero errors: 172 </span> 173 </span> 174 </p> 175 <div class="sect3" lang="en" xml:lang="en"> 176 <div class="titlepage"> 177 <div> 178 <div> 179 <h4 class="title"><a id="id1695278"></a>EINVAL</h4> 180 </div> 181 </div> 182 </div> 183 <p> 184 An invalid flag value or parameter was specified. 185 </p> 186 </div> 187 </div> 188 <div class="sect2" lang="en" xml:lang="en"> 189 <div class="titlepage"> 190 <div> 191 <div> 192 <h3 class="title"><a id="id1695393"></a>Class</h3> 193 </div> 194 </div> 195 </div> 196 <p> 197 <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a>, <a class="link" href="memp.html" title="Chapter 9. The DbMpoolFile Handle">DbMpoolFile</a> 198 </p> 199 </div> 200 <div class="sect2" lang="en" xml:lang="en"> 201 <div class="titlepage"> 202 <div> 203 <div> 204 <h3 class="title"><a id="id1694840"></a>See Also</h3> 205 </div> 206 </div> 207 </div> 208 <p> 209 <a class="xref" href="memp.html#memplist" title="Memory Pools and Related Methods">Memory Pools and Related Methods</a> 210 </p> 211 </div> 212 </div> 213 <div class="navfooter"> 214 <hr /> 215 <table width="100%" summary="Navigation footer"> 216 <tr> 217 <td width="40%" align="left"><a accesskey="p" href="mempfopen.html">Prev</a> </td> 218 <td width="20%" align="center"> 219 <a accesskey="u" href="memp.html">Up</a> 220 </td> 221 <td width="40%" align="right"> <a accesskey="n" href="mempfsync.html">Next</a></td> 222 </tr> 223 <tr> 224 <td width="40%" align="left" valign="top">DbMpoolFile::open() </td> 225 <td width="20%" align="center"> 226 <a accesskey="h" href="index.html">Home</a> 227 </td> 228 <td width="40%" align="right" valign="top"> DbMpoolFile::sync()</td> 229 </tr> 230 </table> 231 </div> 232 </body> 233</html> 234