Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a964702347d726c5f8ba742f8b9d5908 > files > 24

incron-0.5.9-1mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>incron: AppInstance Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</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>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>AppInstance Class Reference</h1><!-- doxytag: class="AppInstance" -->Application instance management class.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="appinst_8h-source.html">appinst.h</a>&gt;</code>
<p>

<p>
<a href="classAppInstance-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAppInstance.html#2a449bd473f7f01a790c6ec6332de422">AppInstance</a> (const std::string &amp;rName, const std::string &amp;rBase=APPLOCK_BASEDIR)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor.  <a href="#2a449bd473f7f01a790c6ec6332de422"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAppInstance.html#44197310b9cc55a28af3f277628b0c9e">~AppInstance</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor.  <a href="#44197310b9cc55a28af3f277628b0c9e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAppInstance.html#0b1fbc87f3bb3939b4827a32d03ee106">Lock</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Attempts to lock the instance.  <a href="#0b1fbc87f3bb3939b4827a32d03ee106"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAppInstance.html#ce6ab6d8af431016266745d4ce2e2218">Unlock</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Unlocks the instance.  <a href="#ce6ab6d8af431016266745d4ce2e2218"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAppInstance.html#8bc91492e89eff2cb6ff26d89b36049a">Exists</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Checks whether an instance of this application exists.  <a href="#8bc91492e89eff2cb6ff26d89b36049a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAppInstance.html#33dce0ebfae8374da6421db4a544a2dd">SendSignal</a> (int iSigNo) const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sends a signal to an instance of this application.  <a href="#33dce0ebfae8374da6421db4a544a2dd"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAppInstance.html#a05646167429e3cbe2bddbfaa5ce7d49">Terminate</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Terminates an instance of this application.  <a href="#a05646167429e3cbe2bddbfaa5ce7d49"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classAppInstance.html#7849ed73845c0aeb3746d3d7e1b49ef9">DoLock</a> ()</td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Application instance management class. 
<p>
This class is intended for application which require to be running only once (one instance only). It provides some methods for simple locking, signaling etc. <hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="2a449bd473f7f01a790c6ec6332de422"></a><!-- doxytag: member="AppInstance::AppInstance" ref="2a449bd473f7f01a790c6ec6332de422" args="(const std::string &amp;rName, const std::string &amp;rBase=APPLOCK_BASEDIR)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">AppInstance::AppInstance           </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>rName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>rBase</em> = <code>APPLOCK_BASEDIR</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Constructor. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>rName</em>&nbsp;</td><td>application name </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>rBase</em>&nbsp;</td><td>lockfile base directory</td></tr>
  </table>
</dl>
<dl class="attention" compact><dt><b>Attention:</b></dt><dd>If an empty base directory is given it is replaced by the default value. </dd></dl>

</div>
</div><p>
<a class="anchor" name="44197310b9cc55a28af3f277628b0c9e"></a><!-- doxytag: member="AppInstance::~AppInstance" ref="44197310b9cc55a28af3f277628b0c9e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">AppInstance::~AppInstance           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destructor. 
<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="0b1fbc87f3bb3939b4827a32d03ee106"></a><!-- doxytag: member="AppInstance::Lock" ref="0b1fbc87f3bb3939b4827a32d03ee106" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool AppInstance::Lock           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Attempts to lock the instance. 
<p>
This method attempts to create a lockfile. If the file already exists it checks whether its owner is still living. If it does this method fails. Otherwise it unlinks this file and re-attempts to create it.<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>true = instance locked, false = otherwise </dd></dl>

</div>
</div><p>
<a class="anchor" name="ce6ab6d8af431016266745d4ce2e2218"></a><!-- doxytag: member="AppInstance::Unlock" ref="ce6ab6d8af431016266745d4ce2e2218" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void AppInstance::Unlock           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Unlocks the instance. 
<p>
This method removes (unlinks) the appropriate lockfile. If the instance hasn't been locked this method has no effect. 
</div>
</div><p>
<a class="anchor" name="8bc91492e89eff2cb6ff26d89b36049a"></a><!-- doxytag: member="AppInstance::Exists" ref="8bc91492e89eff2cb6ff26d89b36049a" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool AppInstance::Exists           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Checks whether an instance of this application exists. 
<p>
If this instance has acquired the lockfile the call will be successful. Otherwise it checks for existence of another running instance.<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>true = instance exists, false = otherwise </dd></dl>

</div>
</div><p>
<a class="anchor" name="33dce0ebfae8374da6421db4a544a2dd"></a><!-- doxytag: member="AppInstance::SendSignal" ref="33dce0ebfae8374da6421db4a544a2dd" args="(int iSigNo) const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool AppInstance::SendSignal           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>iSigNo</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sends a signal to an instance of this application. 
<p>
This method doesn't signal the current instance.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>iSigNo</em>&nbsp;</td><td>signal number </td></tr>
  </table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>true = success, false = otherwise </dd></dl>

</div>
</div><p>
<a class="anchor" name="a05646167429e3cbe2bddbfaa5ce7d49"></a><!-- doxytag: member="AppInstance::Terminate" ref="a05646167429e3cbe2bddbfaa5ce7d49" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool AppInstance::Terminate           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Terminates an instance of this application. 
<p>
This method doesn't terminate the current instance.<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>true = success, false = otherwise </dd></dl>

</div>
</div><p>
<a class="anchor" name="7849ed73845c0aeb3746d3d7e1b49ef9"></a><!-- doxytag: member="AppInstance::DoLock" ref="7849ed73845c0aeb3746d3d7e1b49ef9" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool AppInstance::DoLock           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="appinst_8h-source.html">appinst.h</a><li><a class="el" href="appinst_8cpp.html">appinst.cpp</a></ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sun Jun 21 22:27:24 2009 for incron by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>