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::set_clear_len()</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="mempget_priority.html" title="DbMpoolFile::get_priority()" /> 12 <link rel="next" href="mempset_fileid.html" title="DbMpoolFile::set_fileid()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbMpoolFile::set_clear_len()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="mempget_priority.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="mempset_fileid.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="mempset_clear_len"></a>DbMpoolFile::set_clear_len()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int DbMpoolFile::set_clear_len(u_int32_t len); </pre> 41 <p> 42 The <code class="methodname">DbMpoolFile::set_clear_len()</code> method sets the number of initial 43 bytes in a page that should be set to nul when the page is created as 44 a result of the 45 <a class="link" href="mempfget.html#mpoolfget_DB_MPOOL_CREATE">DB_MPOOL_CREATE</a> 46 or <a class="link" href="mempfget.html#mpoolfget_DB_MPOOL_NEW">DB_MPOOL_NEW</a> 47 flags specified to <a class="xref" href="mempfget.html" title="DbMpoolFile::get()">DbMpoolFile::get()</a>. If no 48 clear length is specified, the entire page is cleared when it is 49 created. 50 </p> 51 <p> 52 The <code class="methodname">DbMpoolFile::set_clear_len()</code> method configures a file in the 53 cache, not only operations performed using the specified 54 <a class="link" href="memp.html" title="Chapter��9.�� The DbMpoolFile Handle">DbMpoolFile</a> handle. 55 </p> 56 <p> 57 The <code class="methodname">DbMpoolFile::set_clear_len()</code> method may not be called after the 58 <a class="xref" href="mempfopen.html" title="DbMpoolFile::open()">DbMpoolFile::open()</a> 59 method is called. If the file is already open in the cache when 60 <a class="xref" href="mempfopen.html" title="DbMpoolFile::open()">DbMpoolFile::open()</a> is 61 called, the information specified to <code class="methodname">DbMpoolFile::set_clear_len()</code> 62 must be consistent with the existing file or an error will be returned. 63 </p> 64 <p> 65 The <code class="methodname">DbMpoolFile::set_clear_len()</code> <span> 66 67 <span> 68 method either returns a non-zero error value or throws an 69 exception that encapsulates a non-zero error value on 70 failure, and returns 0 on success. 71 </span> 72 </span> 73 </p> 74 <div class="sect2" lang="en" xml:lang="en"> 75 <div class="titlepage"> 76 <div> 77 <div> 78 <h3 class="title"><a id="id1696496"></a>Parameters</h3> 79 </div> 80 </div> 81 </div> 82 <div class="sect3" lang="en" xml:lang="en"> 83 <div class="titlepage"> 84 <div> 85 <div> 86 <h4 class="title"><a id="id1696356"></a>len</h4> 87 </div> 88 </div> 89 </div> 90 <p> 91 The <span class="bold"><strong>len</strong></span> parameter is the number of 92 initial bytes in a page that should be set to nul when the page is 93 created. A value of 0 results in the entire page being set to nul 94 bytes. 95 </p> 96 </div> 97 </div> 98 <div class="sect2" lang="en" xml:lang="en"> 99 <div class="titlepage"> 100 <div> 101 <div> 102 <h3 class="title"><a id="id1696645"></a>Class</h3> 103 </div> 104 </div> 105 </div> 106 <p> 107 <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> 108 </p> 109 </div> 110 <div class="sect2" lang="en" xml:lang="en"> 111 <div class="titlepage"> 112 <div> 113 <div> 114 <h3 class="title"><a id="id1696577"></a>See Also</h3> 115 </div> 116 </div> 117 </div> 118 <p> 119 <a class="xref" href="memp.html#memplist" title="Memory Pools and Related Methods">Memory Pools and Related Methods</a> 120 </p> 121 </div> 122 </div> 123 <div class="navfooter"> 124 <hr /> 125 <table width="100%" summary="Navigation footer"> 126 <tr> 127 <td width="40%" align="left"><a accesskey="p" href="mempget_priority.html">Prev</a>��</td> 128 <td width="20%" align="center"> 129 <a accesskey="u" href="memp.html">Up</a> 130 </td> 131 <td width="40%" align="right">��<a accesskey="n" href="mempset_fileid.html">Next</a></td> 132 </tr> 133 <tr> 134 <td width="40%" align="left" valign="top">DbMpoolFile::get_priority()��</td> 135 <td width="20%" align="center"> 136 <a accesskey="h" href="index.html">Home</a> 137 </td> 138 <td width="40%" align="right" valign="top">��DbMpoolFile::set_fileid()</td> 139 </tr> 140 </table> 141 </div> 142 </body> 143</html> 144