<!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>incron: InotifyWatch Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">incron  <span id="projectnumber">0.5.10</span> </div> </td> </tr> </tbody> </table> </div> <!-- Generated by Doxygen 1.7.5.1 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main 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 id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#friends">Friends</a> </div> <div class="headertitle"> <div class="title">InotifyWatch Class Reference</div> </div> </div> <div class="contents"> <!-- doxytag: class="InotifyWatch" --> <p>inotify watch class <a href="classInotifyWatch.html#details">More...</a></p> <p><code>#include <<a class="el" href="inotify-cxx_8h_source.html">inotify-cxx.h</a>></code></p> <p><a href="classInotifyWatch-members.html">List of all members.</a></p> <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"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#ac9c02f1dbd143eebd711eba03ac366e9">InotifyWatch</a> (const std::string &rPath, int32_t uMask, bool fEnabled=true)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#ac9c02f1dbd143eebd711eba03ac366e9"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#a871c16b01aa8841b36246e5b629ecaef">~InotifyWatch</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#a871c16b01aa8841b36246e5b629ecaef"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#a855f982421402dd63d064dde328f2a59">GetDescriptor</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the watch descriptor. <a href="#a855f982421402dd63d064dde328f2a59"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#a2e659c699e7d43bd0a218fe4905784d2">GetPath</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the watched file path. <a href="#a2e659c699e7d43bd0a218fe4905784d2"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#af759f9baca6f4abbbaae57e076486009">GetMask</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the watch event mask. <a href="#af759f9baca6f4abbbaae57e076486009"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#a3ad7fbc55c21b3fcd08c2d1d388e14b6">SetMask</a> (uint32_t uMask) throw (InotifyException)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the watch event mask. <a href="#a3ad7fbc55c21b3fcd08c2d1d388e14b6"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classInotify.html">Inotify</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#acbf0042d06841f9503405b104e4c35d0">GetInotify</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the appropriate inotify class instance. <a href="#acbf0042d06841f9503405b104e4c35d0"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#aa71aff8650fadff32a3c655ca50945f1">SetEnabled</a> (bool fEnabled) throw (InotifyException)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Enables/disables the watch. <a href="#aa71aff8650fadff32a3c655ca50945f1"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#a5ab551a912e5acff6a9c74baaf9ea324">IsEnabled</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Checks whether the watch is enabled. <a href="#a5ab551a912e5acff6a9c74baaf9ea324"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#a222c911ef0e8d6f61570489ed6042e55">IsRecursive</a> () const </td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Checks whether the watch is recursive. <a href="#a222c911ef0e8d6f61570489ed6042e55"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="friends"></a> Friends</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#a94bfb861dc18ca5d16abfcff90db8c86">Inotify</a></td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <div class="textblock"><p>inotify watch class </p> <p>It holds information about the inotify watch on a particular inode.</p> <p>If the INOTIFY_THREAD_SAFE is defined this class is thread-safe. </p> </div><hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="ac9c02f1dbd143eebd711eba03ac366e9"></a><!-- doxytag: member="InotifyWatch::InotifyWatch" ref="ac9c02f1dbd143eebd711eba03ac366e9" args="(const std::string &rPath, int32_t uMask, bool fEnabled=true)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">InotifyWatch::InotifyWatch </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>rPath</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int32_t </td> <td class="paramname"><em>uMask</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"><em>fEnabled</em> = <code>true</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Constructor. </p> <p>Creates an inotify watch. Because this watch is inactive it has an invalid descriptor (-1).</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">rPath</td><td>watched file path </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">uMask</td><td>mask for events </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">fEnabled</td><td>events enabled yes/no </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a871c16b01aa8841b36246e5b629ecaef"></a><!-- doxytag: member="InotifyWatch::~InotifyWatch" ref="a871c16b01aa8841b36246e5b629ecaef" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">InotifyWatch::~InotifyWatch </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Destructor. </p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a855f982421402dd63d064dde328f2a59"></a><!-- doxytag: member="InotifyWatch::GetDescriptor" ref="a855f982421402dd63d064dde328f2a59" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int32_t InotifyWatch::GetDescriptor </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns the watch descriptor. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>watch descriptor; -1 for inactive watch </dd></dl> </div> </div> <a class="anchor" id="acbf0042d06841f9503405b104e4c35d0"></a><!-- doxytag: member="InotifyWatch::GetInotify" ref="acbf0042d06841f9503405b104e4c35d0" args="()" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="classInotify.html">Inotify</a>* InotifyWatch::GetInotify </td> <td>(</td> <td class="paramname"></td><td>)</td> <td><code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns the appropriate inotify class instance. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>inotify instance </dd></dl> </div> </div> <a class="anchor" id="af759f9baca6f4abbbaae57e076486009"></a><!-- doxytag: member="InotifyWatch::GetMask" ref="af759f9baca6f4abbbaae57e076486009" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">uint32_t InotifyWatch::GetMask </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns the watch event mask. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>event mask </dd></dl> </div> </div> <a class="anchor" id="a2e659c699e7d43bd0a218fe4905784d2"></a><!-- doxytag: member="InotifyWatch::GetPath" ref="a2e659c699e7d43bd0a218fe4905784d2" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const std::string& InotifyWatch::GetPath </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Returns the watched file path. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>file path </dd></dl> </div> </div> <a class="anchor" id="a5ab551a912e5acff6a9c74baaf9ea324"></a><!-- doxytag: member="InotifyWatch::IsEnabled" ref="a5ab551a912e5acff6a9c74baaf9ea324" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool InotifyWatch::IsEnabled </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Checks whether the watch is enabled. </p> <dl class="return"><dt><b>Returns:</b></dt><dd>true = enables, false = disabled </dd></dl> </div> </div> <a class="anchor" id="a222c911ef0e8d6f61570489ed6042e55"></a><!-- doxytag: member="InotifyWatch::IsRecursive" ref="a222c911ef0e8d6f61570489ed6042e55" args="() const " --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool InotifyWatch::IsRecursive </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const<code> [inline]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Checks whether the watch is recursive. </p> <p>A recursive watch monitors a directory itself and all its subdirectories. This watch is a logical object which may have many underlying kernel watches.</p> <dl class="return"><dt><b>Returns:</b></dt><dd>currently always false (recursive watches not yet supported) </dd></dl> <dl class="attention"><dt><b>Attention:</b></dt><dd>Recursive watches are currently NOT supported. They are planned for future versions. </dd></dl> </div> </div> <a class="anchor" id="aa71aff8650fadff32a3c655ca50945f1"></a><!-- doxytag: member="InotifyWatch::SetEnabled" ref="aa71aff8650fadff32a3c655ca50945f1" args="(bool fEnabled)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void InotifyWatch::SetEnabled </td> <td>(</td> <td class="paramtype">bool </td> <td class="paramname"><em>fEnabled</em></td><td>)</td> <td> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)</td> </tr> </table> </div> <div class="memdoc"> <p>Enables/disables the watch. </p> <p>If the watch is active (added to an instance of <a class="el" href="classInotify.html" title="inotify class">Inotify</a>) this method may fail due to unsuccessful re-setting the watch in the kernel.</p> <p>Re-setting the current state has no effect.</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">fEnabled</td><td>set enabled yes/no</td></tr> </table> </dd> </dl> <dl><dt><b>Exceptions:</b></dt><dd> <table class="exception"> <tr><td class="paramname"><a class="el" href="classInotifyException.html" title="Class for inotify exceptions.">InotifyException</a></td><td>thrown if enabling/disabling fails </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="a3ad7fbc55c21b3fcd08c2d1d388e14b6"></a><!-- doxytag: member="InotifyWatch::SetMask" ref="a3ad7fbc55c21b3fcd08c2d1d388e14b6" args="(uint32_t uMask)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void InotifyWatch::SetMask </td> <td>(</td> <td class="paramtype">uint32_t </td> <td class="paramname"><em>uMask</em></td><td>)</td> <td> throw (<a class="el" href="classInotifyException.html">InotifyException</a>)</td> </tr> </table> </div> <div class="memdoc"> <p>Sets the watch event mask. </p> <p>If the watch is active (added to an instance of <a class="el" href="classInotify.html" title="inotify class">Inotify</a>) this method may fail due to unsuccessful re-setting the watch in the kernel.</p> <dl><dt><b>Parameters:</b></dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">uMask</td><td>event mask</td></tr> </table> </dd> </dl> <dl><dt><b>Exceptions:</b></dt><dd> <table class="exception"> <tr><td class="paramname"><a class="el" href="classInotifyException.html" title="Class for inotify exceptions.">InotifyException</a></td><td>thrown if changing fails </td></tr> </table> </dd> </dl> </div> </div> <hr/><h2>Friends And Related Function Documentation</h2> <a class="anchor" id="a94bfb861dc18ca5d16abfcff90db8c86"></a><!-- doxytag: member="InotifyWatch::Inotify" ref="a94bfb861dc18ca5d16abfcff90db8c86" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">friend class <a class="el" href="classInotify.html">Inotify</a><code> [friend]</code></td> </tr> </table> </div> <div class="memdoc"> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="inotify-cxx_8h_source.html">inotify-cxx.h</a></li> <li><a class="el" href="inotify-cxx_8cpp.html">inotify-cxx.cpp</a></li> </ul> </div> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.7.5.1 </small></address> </body> </html>