summaryrefslogtreecommitdiff
path: root/shared/inotify/doc/html/classInotifyWatch.html
blob: 119c7873ffd2c4456ff9eb73c2dc62c839908d7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>inotify-cxx: InotifyWatch 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.1 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li id="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>
<h1>InotifyWatch Class Reference</h1><!-- doxytag: class="InotifyWatch" -->inotify watch class  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="inotify-cxx_8h-source.html">inotify-cxx.h</a>&gt;</code>
<p>
<a href="classInotifyWatch-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="classInotifyWatch.html#c9c02f1dbd143eebd711eba03ac366e9">InotifyWatch</a> (const std::string &amp;rPath, int32_t uMask, bool fEnabled=true)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructor.  <a href="#c9c02f1dbd143eebd711eba03ac366e9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#871c16b01aa8841b36246e5b629ecaef">~InotifyWatch</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor.  <a href="#871c16b01aa8841b36246e5b629ecaef"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int32_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#df771e1f81e2a6cc2780c9d2470e34c6">GetDescriptor</a> () const</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the watch descriptor.  <a href="#df771e1f81e2a6cc2780c9d2470e34c6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const std::string &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#89f897a4d98fa54de27730dd8be67966">GetPath</a> () const</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the watched file path.  <a href="#89f897a4d98fa54de27730dd8be67966"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">uint32_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#bab761a989c9fdf73aaad2a58e1ba7a0">GetMask</a> () const</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the watch event mask.  <a href="#bab761a989c9fdf73aaad2a58e1ba7a0"></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="classInotifyWatch.html#3ad7fbc55c21b3fcd08c2d1d388e14b6">SetMask</a> (uint32_t uMask)  throw (InotifyException)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the watch event mask.  <a href="#3ad7fbc55c21b3fcd08c2d1d388e14b6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classInotify.html">Inotify</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#cbf0042d06841f9503405b104e4c35d0">GetInotify</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the appropriate inotify class instance.  <a href="#cbf0042d06841f9503405b104e4c35d0"></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="classInotifyWatch.html#a71aff8650fadff32a3c655ca50945f1">SetEnabled</a> (bool fEnabled)  throw (InotifyException)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Enables/disables the watch.  <a href="#a71aff8650fadff32a3c655ca50945f1"></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="classInotifyWatch.html#3d2a5c58a07449bc6ff192f6c14c4de0">IsEnabled</a> () const</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Checks whether the watch is enabled.  <a href="#3d2a5c58a07449bc6ff192f6c14c4de0"></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="classInotifyWatch.html#1c8ab316b54cb7d1d0b17cbbe6b7d2f8">IsRecursive</a> () const</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Checks whether the watch is recursive.  <a href="#1c8ab316b54cb7d1d0b17cbbe6b7d2f8"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Friends</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">class&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classInotifyWatch.html#94bfb861dc18ca5d16abfcff90db8c86">Inotify</a></td></tr>

</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
inotify watch class 
<p>
It holds information about the inotify watch on a particular inode.<p>
If the INOTIFY_THREAD_SAFE is defined this class is thread-safe. 
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="c9c02f1dbd143eebd711eba03ac366e9"></a><!-- doxytag: member="InotifyWatch::InotifyWatch" ref="c9c02f1dbd143eebd711eba03ac366e9" args="(const std::string &amp;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 &amp;&nbsp;</td>
          <td class="paramname"> <em>rPath</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int32_t&nbsp;</td>
          <td class="paramname"> <em>uMask</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>fEnabled</em> = <code>true</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Constructor. 
<p>
Creates an inotify watch. Because this watch is inactive it has an invalid descriptor (-1).<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>rPath</em>&nbsp;</td><td>watched file path </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>uMask</em>&nbsp;</td><td>mask for events </td></tr>
    <tr><td valign="top"><tt>[in]</tt>&nbsp;</td><td valign="top"><em>fEnabled</em>&nbsp;</td><td>events enabled yes/no </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="871c16b01aa8841b36246e5b629ecaef"></a><!-- doxytag: member="InotifyWatch::~InotifyWatch" ref="871c16b01aa8841b36246e5b629ecaef" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">InotifyWatch::~InotifyWatch           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Destructor. 
<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="df771e1f81e2a6cc2780c9d2470e34c6"></a><!-- doxytag: member="InotifyWatch::GetDescriptor" ref="df771e1f81e2a6cc2780c9d2470e34c6" 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>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the watch descriptor. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>watch descriptor; -1 for inactive watch </dd></dl>

</div>
</div><p>
<a class="anchor" name="89f897a4d98fa54de27730dd8be67966"></a><!-- doxytag: member="InotifyWatch::GetPath" ref="89f897a4d98fa54de27730dd8be67966" args="() const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const std::string&amp; InotifyWatch::GetPath           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the watched file path. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>file path </dd></dl>

</div>
</div><p>
<a class="anchor" name="bab761a989c9fdf73aaad2a58e1ba7a0"></a><!-- doxytag: member="InotifyWatch::GetMask" ref="bab761a989c9fdf73aaad2a58e1ba7a0" 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>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the watch event mask. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>event mask </dd></dl>

</div>
</div><p>
<a class="anchor" name="3ad7fbc55c21b3fcd08c2d1d388e14b6"></a><!-- doxytag: member="InotifyWatch::SetMask" ref="3ad7fbc55c21b3fcd08c2d1d388e14b6" 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&nbsp;</td>
          <td class="paramname"> <em>uMask</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">  throw (<a class="el" href="classInotifyException.html">InotifyException</a>)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Sets the watch event mask. 
<p>
If the watch is active (added to an instance of <a class="el" href="classInotify.html">Inotify</a>) this method may fail due to unsuccessful re-setting the watch in the kernel.<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>uMask</em>&nbsp;</td><td>event mask</td></tr>
  </table>
</dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em>&nbsp;</td><td>thrown if changing fails </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="cbf0042d06841f9503405b104e4c35d0"></a><!-- doxytag: member="InotifyWatch::GetInotify" ref="cbf0042d06841f9503405b104e4c35d0" 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>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns the appropriate inotify class instance. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>inotify instance </dd></dl>

</div>
</div><p>
<a class="anchor" name="a71aff8650fadff32a3c655ca50945f1"></a><!-- doxytag: member="InotifyWatch::SetEnabled" ref="a71aff8650fadff32a3c655ca50945f1" 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&nbsp;</td>
          <td class="paramname"> <em>fEnabled</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%">  throw (<a class="el" href="classInotifyException.html">InotifyException</a>)</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Enables/disables the watch. 
<p>
If the watch is active (added to an instance of <a class="el" href="classInotify.html">Inotify</a>) this method may fail due to unsuccessful re-setting the watch in the kernel.<p>
Re-setting the current state has no effect.<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>fEnabled</em>&nbsp;</td><td>set enabled yes/no</td></tr>
  </table>
</dl>
<dl compact><dt><b>Exceptions:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em><a class="el" href="classInotifyException.html">InotifyException</a></em>&nbsp;</td><td>thrown if enabling/disabling fails </td></tr>
  </table>
</dl>

</div>
</div><p>
<a class="anchor" name="3d2a5c58a07449bc6ff192f6c14c4de0"></a><!-- doxytag: member="InotifyWatch::IsEnabled" ref="3d2a5c58a07449bc6ff192f6c14c4de0" 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>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Checks whether the watch is enabled. 
<p>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>true = enables, false = disabled </dd></dl>

</div>
</div><p>
<a class="anchor" name="1c8ab316b54cb7d1d0b17cbbe6b7d2f8"></a><!-- doxytag: member="InotifyWatch::IsRecursive" ref="1c8ab316b54cb7d1d0b17cbbe6b7d2f8" 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>&nbsp;)&nbsp;</td>
          <td width="100%"> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Checks whether the watch is recursive. 
<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" compact><dt><b>Returns:</b></dt><dd>currently always false (recursive watches not yet supported) </dd></dl>
<dl class="attention" compact><dt><b>Attention:</b></dt><dd>Recursive watches are currently NOT supported. They are planned for future versions. </dd></dl>

</div>
</div><p>
<hr><h2>Friends And Related Function Documentation</h2>
<a class="anchor" name="94bfb861dc18ca5d16abfcff90db8c86"></a><!-- doxytag: member="InotifyWatch::Inotify" ref="94bfb861dc18ca5d16abfcff90db8c86" 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">

<p>

</div>
</div><p>
<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><a class="el" href="inotify-cxx_8cpp.html">inotify-cxx.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Wed Apr 18 18:26:40 2007 for inotify-cxx by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.1 </small></address>
</body>
</html>
bgstack15