Sophie

Sophie

distrib > Mageia > 1 > i586 > by-pkgid > 64656f00434e190abe8506174ca339ed > files > 40

ucommon-doc-4.3.1-1.mga1.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>ucommon: auto_protect Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">ucommon</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Data&#160;Structures</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 id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="classes.html"><span>Data&#160;Structure&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Data&#160;Fields</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00020.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle">
<h1>auto_protect Class Reference</h1>  </div>
</div>
<div class="contents">
<!-- doxytag: class="auto_protect" -->
<p>A mutex locked object smart pointer helper class.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00200_source.html">thread.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for auto_protect:</div>
<div class="dyncontent">
<div class="center"><img src="a00273.png" border="0" usemap="#auto__protect_inherit__map" alt="Inheritance graph"/></div>
<map name="auto__protect_inherit__map" id="auto__protect_inherit__map">
<area shape="rect" id="node3" href="a00086.html" title="Typed smart locked pointer class." alt="" coords="5,80,208,107"/></map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00020.html#a4419ed7c33dc457215323e86e7c7b759">auto_protect</a> (void *object)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct a protected pointer referencing an existing object.  <a href="#a4419ed7c33dc457215323e86e7c7b759"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00020.html#a72463c88ac54dc49624ffcafccea9e8a">operator bool</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if the pointer is referencing an object.  <a href="#a72463c88ac54dc49624ffcafccea9e8a"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00020.html#a0ba4f22b083d5b0d4ba0570b20ac5b64">operator!</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Test if the pointer is not set.  <a href="#a0ba4f22b083d5b0d4ba0570b20ac5b64"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00020.html#a77698d6abc9bbc25e4f49037b7a6fa45">operator=</a> (void *object)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set our pointer to a specific object.  <a href="#a77698d6abc9bbc25e4f49037b7a6fa45"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00020.html#af7158ed64575e921415d87a72dad6445">release</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Manually release the pointer.  <a href="#af7158ed64575e921415d87a72dad6445"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00020.html#ab2fea0e64bcaf71b3bc6db3b60dfe9e5">~auto_protect</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete protected pointer.  <a href="#ab2fea0e64bcaf71b3bc6db3b60dfe9e5"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad1b91bea92bcf0eef210590cfa24be3a"></a><!-- doxytag: member="auto_protect::object" ref="ad1b91bea92bcf0eef210590cfa24be3a" args="" -->
void *&#160;</td><td class="memItemRight" valign="bottom"><b>object</b></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A mutex locked object smart pointer helper class. </p>
<p>This is particularly useful in referencing objects which will be protected by the mutex protect function. When the pointer falls out of scope, the protecting mutex is also released. This is meant to be used by the typed <a class="el" href="a00086.html" title="Typed smart locked pointer class.">mutex_pointer</a> template. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>David Sugar &lt;<a href="mailto:dyfet@gnutelephony.org">dyfet@gnutelephony.org</a>&gt; </dd></dl>

<p>Definition at line <a class="el" href="a00200_source.html#l01296">1296</a> of file <a class="el" href="a00200_source.html">thread.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a4419ed7c33dc457215323e86e7c7b759"></a><!-- doxytag: member="auto_protect::auto_protect" ref="a4419ed7c33dc457215323e86e7c7b759" args="(void *object)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">auto_protect::auto_protect </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>object</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Construct a protected pointer referencing an existing object. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">object</td><td>we point to. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ab2fea0e64bcaf71b3bc6db3b60dfe9e5"></a><!-- doxytag: member="auto_protect::~auto_protect" ref="ab2fea0e64bcaf71b3bc6db3b60dfe9e5" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">auto_protect::~auto_protect </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Delete protected pointer. </p>
<p>When it falls out of scope the associated mutex is released. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a72463c88ac54dc49624ffcafccea9e8a"></a><!-- doxytag: member="auto_protect::operator bool" ref="a72463c88ac54dc49624ffcafccea9e8a" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">auto_protect::operator bool </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Test if the pointer is referencing an object. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the pointer is currently referencing an object. </dd></dl>

<p>Definition at line <a class="el" href="a00200_source.html#l01336">1336</a> of file <a class="el" href="a00200_source.html">thread.h</a>.</p>

</div>
</div>
<a class="anchor" id="a0ba4f22b083d5b0d4ba0570b20ac5b64"></a><!-- doxytag: member="auto_protect::operator!" ref="a0ba4f22b083d5b0d4ba0570b20ac5b64" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool auto_protect::operator! </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Test if the pointer is not set. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the pointer is not referencing anything. </dd></dl>

<p>Definition at line <a class="el" href="a00200_source.html#l01329">1329</a> of file <a class="el" href="a00200_source.html">thread.h</a>.</p>

</div>
</div>
<a class="anchor" id="a77698d6abc9bbc25e4f49037b7a6fa45"></a><!-- doxytag: member="auto_protect::operator=" ref="a77698d6abc9bbc25e4f49037b7a6fa45" args="(void *object)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void auto_protect::operator= </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>object</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set our pointer to a specific object. </p>
<p>If the pointer currently references another object, the associated mutex is released. The pointer references our new object and that new object is locked. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">object</td><td>to assign to. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af7158ed64575e921415d87a72dad6445"></a><!-- doxytag: member="auto_protect::release" ref="af7158ed64575e921415d87a72dad6445" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void auto_protect::release </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Manually release the pointer. </p>
<p>This releases the mutex. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>ucommon/<a class="el" href="a00200_source.html">thread.h</a></li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00020.html">auto_protect</a>      </li>
      <li class="footer">Generated on Wed Apr 13 2011 22:39:47 for ucommon by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li>
    </ul>
  </div>

</body>
</html>