Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > ed376d6842ea322c25405e7c23b3bc12 > files > 395

libcommoncpp-devel-1.8.0-5.1mdv2010.1.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>GNU CommonC++: ost::ThreadFile Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespaceost.html">ost</a>::<a class="el" href="classost_1_1_thread_file.html">ThreadFile</a>
  </div>
</div>
<div class="contents">
<h1>ost::ThreadFile Class Reference</h1><!-- doxytag: class="ost::ThreadFile" --><!-- doxytag: inherits="ost::RandomFile" -->
<p>This class defines a database I/O file service that can be shared by multiple threads.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="file_8h_source.html">file.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for ost::ThreadFile:</div>
<div class="dynsection">
 <div class="center">
  <img src="classost_1_1_thread_file.png" usemap="#ost::ThreadFile_map" alt=""/>
  <map id="ost::ThreadFile_map" name="ost::ThreadFile_map">
<area href="classost_1_1_random_file.html" alt="ost::RandomFile" shape="rect" coords="55,56,155,80"/>
<area href="classost_1_1_mutex.html" alt="ost::Mutex" shape="rect" coords="0,0,100,24"/>
<area href="classost_1_1_file.html" alt="ost::File" shape="rect" coords="110,0,210,24"/>
</map>
 </div>
</div>

<p><a href="classost_1_1_thread_file-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_thread_file.html#a17e345a69a04ba5b9db9c556925900c1">ThreadFile</a> (const char *path)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Open or create a new database file.  <a href="#a17e345a69a04ba5b9db9c556925900c1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_thread_file.html#aebf1b7d1658ad10654425eadd1a34052">~ThreadFile</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close and finish a database file.  <a href="#aebf1b7d1658ad10654425eadd1a34052"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classost_1_1_file.html#a726c26bbd45c9cb0701267a2824284e6">Error</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_thread_file.html#a634eeae5f8e783d26e484046344a0556">restart</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Restart an existing database; close and re-open.  <a href="#a634eeae5f8e783d26e484046344a0556"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classost_1_1_file.html#a726c26bbd45c9cb0701267a2824284e6">Error</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_thread_file.html#a3f4dae2704c3780ebccf6abd1f3bc021">fetch</a> (char *address=NULL, <a class="el" href="namespaceost.html#acedd0902cc2709bd066b9f8a2d1f44a0">ccxx_size_t</a> length=0, off_t position=-1)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Fetch a portion of the file into physical memory.  <a href="#a3f4dae2704c3780ebccf6abd1f3bc021"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classost_1_1_file.html#a726c26bbd45c9cb0701267a2824284e6">Error</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_thread_file.html#aaa50dd7107aa5384b8536316803bcd11">update</a> (char *address=NULL, <a class="el" href="namespaceost.html#acedd0902cc2709bd066b9f8a2d1f44a0">ccxx_size_t</a> length=0, off_t position=-1)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Update a portion of a file from physical memory.  <a href="#aaa50dd7107aa5384b8536316803bcd11"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classost_1_1_file.html#a726c26bbd45c9cb0701267a2824284e6">Error</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_thread_file.html#a0dd1a865c7936e01f3082b216925f418">append</a> (char *address=NULL, <a class="el" href="namespaceost.html#acedd0902cc2709bd066b9f8a2d1f44a0">ccxx_size_t</a> length=0)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Add new data to the end of the file.  <a href="#a0dd1a865c7936e01f3082b216925f418"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">off_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_thread_file.html#a09adee0b9978cdc82435c901c850d4e5">getPosition</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Fetch the current file position marker for this thread.  <a href="#a09adee0b9978cdc82435c901c850d4e5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_thread_file.html#a5587d9a579902aa4589ec1777fecd2f6">operator++</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classost_1_1_thread_file.html#a48627c57443c979420e3b218f387cff0">operator--</a> (void)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>This class defines a database I/O file service that can be shared by multiple threads. </p>
<p>All threads access a global copy of the database object, and mutex locks can be used to preserve transaction integrety. pread/pwrite calls can be used for optimized I/O when supported.</p>
<p><a class="el" href="classost_1_1_thread_file.html" title="This class defines a database I/O file service that can be shared by multiple threads...">ThreadFile</a> is meant for use by a threaded database server where multiple threads may each perform semi-independent operations on a given database table stored on disk. A special "fcb" structure is used to hold file "state", and pread/pwrite is used whenever possible for optimized I/O. On systems that do not offer pwread/pwrite, a <a class="el" href="classost_1_1_mutex.html" title="The Mutex class is used to protect a section of code so that at any given time only...">Mutex</a> lock is used to protect concurrent lseek and read/write operations. <a class="el" href="classost_1_1_thread_file.html" title="This class defines a database I/O file service that can be shared by multiple threads...">ThreadFile</a> managed databases are assumed to be used only by the local server and through a single file descriptor.</p>
<dl class="author"><dt><b>Author:</b></dt><dd>David Sugar &lt;<a href="mailto:dyfet@ostel.com">dyfet@ostel.com</a>&gt; This class defines a database I/O file service that can be shared by multiple threads. </dd></dl>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a17e345a69a04ba5b9db9c556925900c1"></a><!-- doxytag: member="ost::ThreadFile::ThreadFile" ref="a17e345a69a04ba5b9db9c556925900c1" args="(const char *path)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ost::ThreadFile::ThreadFile </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>path</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Open or create a new database file. </p>
<p>You should also use Initial.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>path</em>&nbsp;</td><td>pathname of database to open. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aebf1b7d1658ad10654425eadd1a34052"></a><!-- doxytag: member="ost::ThreadFile::~ThreadFile" ref="aebf1b7d1658ad10654425eadd1a34052" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">virtual ost::ThreadFile::~ThreadFile </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Close and finish a database file. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a0dd1a865c7936e01f3082b216925f418"></a><!-- doxytag: member="ost::ThreadFile::append" ref="a0dd1a865c7936e01f3082b216925f418" args="(char *address=NULL, ccxx_size_t length=0)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classost_1_1_file.html#a726c26bbd45c9cb0701267a2824284e6">Error</a> ost::ThreadFile::append </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>address</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceost.html#acedd0902cc2709bd066b9f8a2d1f44a0">ccxx_size_t</a>&nbsp;</td>
          <td class="paramname"> <em>length</em> = <code>0</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Add new data to the end of the file. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>address</em>&nbsp;</td><td>address to use, or NULL if same as last I/O. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>length</em>&nbsp;</td><td>length to use, or 0 if same as last I/O. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a3f4dae2704c3780ebccf6abd1f3bc021"></a><!-- doxytag: member="ost::ThreadFile::fetch" ref="a3f4dae2704c3780ebccf6abd1f3bc021" args="(char *address=NULL, ccxx_size_t length=0, off_t position=&#45;1)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classost_1_1_file.html#a726c26bbd45c9cb0701267a2824284e6">Error</a> ost::ThreadFile::fetch </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>address</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceost.html#acedd0902cc2709bd066b9f8a2d1f44a0">ccxx_size_t</a>&nbsp;</td>
          <td class="paramname"> <em>length</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">off_t&nbsp;</td>
          <td class="paramname"> <em>position</em> = <code>-1</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Fetch a portion of the file into physical memory. </p>
<p>This can use state information to fetch the current record multiple times.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>errSuccess on success. </dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>address</em>&nbsp;</td><td>address to use, or NULL if same as last I/O. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>length</em>&nbsp;</td><td>length to use, or 0 if same as last I/O. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>position</em>&nbsp;</td><td>file position to use -1 if same as last I/O. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a09adee0b9978cdc82435c901c850d4e5"></a><!-- doxytag: member="ost::ThreadFile::getPosition" ref="a09adee0b9978cdc82435c901c850d4e5" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">off_t ost::ThreadFile::getPosition </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Fetch the current file position marker for this thread. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>file position offset. </dd></dl>

</div>
</div>
<a class="anchor" id="a5587d9a579902aa4589ec1777fecd2f6"></a><!-- doxytag: member="ost::ThreadFile::operator++" ref="a5587d9a579902aa4589ec1777fecd2f6" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ost::ThreadFile::operator++ </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a48627c57443c979420e3b218f387cff0"></a><!-- doxytag: member="ost::ThreadFile::operator&#45;&#45;" ref="a48627c57443c979420e3b218f387cff0" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ost::ThreadFile::operator-- </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

</div>
</div>
<a class="anchor" id="a634eeae5f8e783d26e484046344a0556"></a><!-- doxytag: member="ost::ThreadFile::restart" ref="a634eeae5f8e783d26e484046344a0556" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classost_1_1_file.html#a726c26bbd45c9cb0701267a2824284e6">Error</a> ost::ThreadFile::restart </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Restart an existing database; close and re-open. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>errSuccess if successful. </dd></dl>

<p>Reimplemented from <a class="el" href="classost_1_1_random_file.html#ae78c71b1e3fab5861bc9fdae595829a7">ost::RandomFile</a>.</p>

</div>
</div>
<a class="anchor" id="aaa50dd7107aa5384b8536316803bcd11"></a><!-- doxytag: member="ost::ThreadFile::update" ref="aaa50dd7107aa5384b8536316803bcd11" args="(char *address=NULL, ccxx_size_t length=0, off_t position=&#45;1)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classost_1_1_file.html#a726c26bbd45c9cb0701267a2824284e6">Error</a> ost::ThreadFile::update </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>address</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceost.html#acedd0902cc2709bd066b9f8a2d1f44a0">ccxx_size_t</a>&nbsp;</td>
          <td class="paramname"> <em>length</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">off_t&nbsp;</td>
          <td class="paramname"> <em>position</em> = <code>-1</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Update a portion of a file from physical memory. </p>
<p>This can use state information to commit the last read record.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>errSuccess on success. </dd></dl>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>address</em>&nbsp;</td><td>address to use, or NULL if same as last I/O. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>length</em>&nbsp;</td><td>length to use, or 0 if same as last I/O. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>position</em>&nbsp;</td><td>file position to use or -1 if same as last I/O. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="file_8h_source.html">file.h</a></li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Fri Nov 12 09:55:47 2010 for GNU CommonC++ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>