Main Page | Class List | File List | Class Members | File Members

Inotify Class Reference

inotify class More...

#include <inotify-cxx.h>

List of all members.

Public Member Functions

 Inotify ()
 Constructor.
 ~Inotify ()
 Destructor.
void Close ()
 Removes all watches and closes the inotify device.
bool IsReady () const
 Checks whether the inotify is ready.
bool Add (InotifyWatch *pWatch)
 Adds a new watch.
bool Add (InotifyWatch &rWatch)
 Adds a new watch.
void Remove (InotifyWatch *pWatch)
 Removes a watch.
void Remove (InotifyWatch &rWatch)
 Removes a watch.
void RemoveAll ()
 Removes all watches.
size_t GetWatchCount () const
 Returns the count of watches.
bool WaitForEvents (bool fNoIntr=false)
 Waits for inotify events.
int GetEventCount ()
 Returns the count of received and queued events.
bool GetEvent (InotifyEvent *pEvt)
 Extracts a queued inotify event.
bool GetEvent (InotifyEvent &rEvt)
 Extracts a queued inotify event.
bool PeekEvent (InotifyEvent *pEvt)
 Extracts a queued inotify event (without removing).
bool PeekEvent (InotifyEvent &rEvt)
 Extracts a queued inotify event (without removing).
InotifyWatchFindWatch (int iDescriptor)
 Searches for a watch.


Detailed Description

inotify class


Constructor & Destructor Documentation

Inotify::Inotify  ) 
 

Constructor.

Creates and initializes an instance of inotify communication object (opens the inotify device).

Inotify::~Inotify  ) 
 

Destructor.

Calls Close() due for clean-up.


Member Function Documentation

bool Inotify::Add InotifyWatch rWatch  )  [inline]
 

Adds a new watch.

Parameters:
[in] rWatch inotify watch
Returns:
true = success, false = failure

bool Inotify::Add InotifyWatch pWatch  ) 
 

Adds a new watch.

Parameters:
[in] pWatch inotify watch
Returns:
true = success, false = failure

void Inotify::Close  ) 
 

Removes all watches and closes the inotify device.

InotifyWatch * Inotify::FindWatch int  iDescriptor  ) 
 

Searches for a watch.

It tries to find a watch by the given descriptor.

Parameters:
[in] iDescriptor watch descriptor
Returns:
found descriptor; NULL if no such watch exists

bool Inotify::GetEvent InotifyEvent rEvt  )  [inline]
 

Extracts a queued inotify event.

The extracted event is removed from the queue.

Parameters:
[in,out] rEvt event object
Returns:
true = success, false = failure

bool Inotify::GetEvent InotifyEvent pEvt  ) 
 

Extracts a queued inotify event.

The extracted event is removed from the queue. If the pointer is NULL it does nothing.

Parameters:
[in,out] pEvt event object
Returns:
true = success, false = failure

int Inotify::GetEventCount  ) 
 

Returns the count of received and queued events.

This number is related to the events in the queue inside this object, not to the events pending in the kernel.

Returns:
count of events

size_t Inotify::GetWatchCount  )  const [inline]
 

Returns the count of watches.

Returns:
count of watches

bool Inotify::IsReady  )  const [inline]
 

Checks whether the inotify is ready.

Returns:
true = initialized properly, false = something failed

bool Inotify::PeekEvent InotifyEvent rEvt  )  [inline]
 

Extracts a queued inotify event (without removing).

The extracted event stays in the queue.

Parameters:
[in,out] rEvt event object
Returns:
true = success, false = failure

bool Inotify::PeekEvent InotifyEvent pEvt  ) 
 

Extracts a queued inotify event (without removing).

The extracted event stays in the queue. If the pointer is NULL it does nothing.

Parameters:
[in,out] pEvt event object
Returns:
true = success, false = failure

void Inotify::Remove InotifyWatch rWatch  )  [inline]
 

Removes a watch.

If the given watch is not present it does nothing.

Parameters:
[in] rWatch inotify watch

void Inotify::Remove InotifyWatch pWatch  ) 
 

Removes a watch.

If the given watch is not present it does nothing.

Parameters:
[in] pWatch inotify watch

void Inotify::RemoveAll  ) 
 

Removes all watches.

bool Inotify::WaitForEvents bool  fNoIntr = false  ) 
 

Waits for inotify events.

It waits until one or more events occur.

Parameters:
[in] fNoIntr if true it re-calls the system call after a handled signal
Returns:
true = event(s) occurred, false = failure


The documentation for this class was generated from the following files:
Generated on Fri Sep 15 12:07:10 2006 for inotify-cxx by  doxygen 1.4.4