1<!--$Id: mempfile_class.so,v 10.24 2004/08/13 03:38:58 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: DbMpoolFile</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>DbMpoolFile</b> 14</td> 15<td align=right> 16<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a> 17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db_cxx.h> 23<p> 24class DbMpoolFile { 25public: 26 DB_MPOOLFILE *DbMpoolFile::get_DB_MPOOLFILE(); 27 const DB_MPOOLFILE *DbMpoolFile::get_const_DB_MPOOLFILE() const; 28 ... 29}; 30</pre></b> 31<hr size=1 noshade> 32<b>Description: DbMpoolFile</b> 33<p>The memory pool interfaces for the Berkeley DB database environment are 34methods of the <a href="../api_cxx/env_class.html">DbEnv</a> handle. The <a href="../api_cxx/env_class.html">DbEnv</a> memory pool 35methods and the DbMpoolFile class provide general-purpose, 36page-oriented buffer management of files. Although designed to work 37with the other <a href="../api_cxx/db_class.html">Db</a> classes, they are also useful for more general 38purposes. The memory pools are referred to in this document as simply 39<i>pools</i>.</p> 40<p>Pools may be shared between processes. Pools are usually filled by 41pages from one or more files. Pages in the pool are replaced in LRU 42(least-recently-used) order, with each new page replacing the page that 43has been unused the longest. Pages retrieved from the pool using 44<a href="../api_cxx/memp_fget.html">DbMpoolFile::get</a> are <i>pinned</i> in the pool until they are 45returned to the control of the buffer pool using the <a href="../api_cxx/memp_fput.html">DbMpoolFile::put</a> 46method.</p> 47<p>The DbMpoolFile object is the handle for a file in the memory 48pool. The handle is not free-threaded. Once the <a href="../api_cxx/memp_fclose.html">DbMpoolFile::close</a> method 49is called, the handle may not be accessed again, regardless of that 50method's return.</p> 51<p>Each DbMpoolFile object has an associated DB_MPOOLFILE 52structure, which is used by the underlying implementation of Berkeley DB and 53its C-language API. The DbMpoolFile::get_DB_MPOOLFILE method returns a 54pointer to this struct. Given a const DbMpoolFile object, 55DbMpoolFile::get_const_DB_MPOOLFILE returns a const pointer to the same 56struct.</p> 57<p>These methods may be useful for Berkeley DB applications including both C 58and C++ language software. It should not be necessary to use these 59calls in a purely C++ application.</p> 60<hr size=1 noshade> 61<br><b>Class</b> 62<a href="../api_cxx/env_class.html">DbEnv</a>, DbMpoolFile 63<br><b>See Also</b> 64<a href="../api_cxx/memp_list.html">Memory Pools and Related Methods</a> 65</tt> 66<table width="100%"><tr><td><br></td><td align=right> 67<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a> 68</td></tr></table> 69<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 70</body> 71</html> 72