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 () throw (InotifyException)
 Constructor.
 ~Inotify ()
 Destructor.
void Close ()
 Removes all watches and closes the inotify device.
void Add (InotifyWatch *pWatch) throw (InotifyException)
 Adds a new watch.
void Add (InotifyWatch &rWatch) throw (InotifyException)
 Adds a new watch.
void Remove (InotifyWatch *pWatch) throw (InotifyException)
 Removes a watch.
void Remove (InotifyWatch &rWatch) throw (InotifyException)
 Removes a watch.
void RemoveAll ()
 Removes all watches.
size_t GetWatchCount () const
 Returns the count of watches.
void WaitForEvents (bool fNoIntr=false) throw (InotifyException)
 Waits for inotify events.
int GetEventCount ()
 Returns the count of received and queued events.
bool GetEvent (InotifyEvent *pEvt) throw (InotifyException)
 Extracts a queued inotify event.
bool GetEvent (InotifyEvent &rEvt) throw (InotifyException)
 Extracts a queued inotify event.
bool PeekEvent (InotifyEvent *pEvt) throw (InotifyException)
 Extracts a queued inotify event (without removing).
bool PeekEvent (InotifyEvent &rEvt) throw (InotifyException)
 Extracts a queued inotify event (without removing).
InotifyWatchFindWatch (int iDescriptor)
 Searches for a watch.
int GetDescriptor () const
 Returns the file descriptor.
void SetNonBlock (bool fNonBlock) throw (InotifyException)
 Enables/disables non-blocking mode.


Detailed Description

inotify class


Constructor & Destructor Documentation

Inotify::Inotify  )  throw (InotifyException)
 

Constructor.

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

Exceptions:
InotifyException thrown if inotify isn't available

Inotify::~Inotify  ) 
 

Destructor.

Calls Close() due to clean-up.


Member Function Documentation

void Inotify::Add InotifyWatch rWatch  )  throw (InotifyException) [inline]
 

Adds a new watch.

Parameters:
[in] rWatch inotify watch
Exceptions:
InotifyException thrown if adding failed

void Inotify::Add InotifyWatch pWatch  )  throw (InotifyException)
 

Adds a new watch.

Parameters:
[in] pWatch inotify watch
Exceptions:
InotifyException thrown if adding failed

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

int Inotify::GetDescriptor  )  const [inline]
 

Returns the file descriptor.

The descriptor can be used in standard low-level file functions (poll(), select(), fcntl() etc.).

Returns:
valid file descriptor or -1 for inactive object
See also:
SetNonBlock()

bool Inotify::GetEvent InotifyEvent rEvt  )  throw (InotifyException) [inline]
 

Extracts a queued inotify event.

The extracted event is removed from the queue.

Parameters:
[in,out] rEvt event object
Exceptions:
InotifyException thrown only in very anomalous cases

bool Inotify::GetEvent InotifyEvent pEvt  )  throw (InotifyException)
 

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
Exceptions:
InotifyException thrown if the provided pointer is NULL

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::PeekEvent InotifyEvent rEvt  )  throw (InotifyException) [inline]
 

Extracts a queued inotify event (without removing).

The extracted event stays in the queue.

Parameters:
[in,out] rEvt event object
Exceptions:
InotifyException thrown only in very anomalous cases

bool Inotify::PeekEvent InotifyEvent pEvt  )  throw (InotifyException)
 

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
Exceptions:
InotifyException thrown if the provided pointer is NULL

void Inotify::Remove InotifyWatch rWatch  )  throw (InotifyException) [inline]
 

Removes a watch.

If the given watch is not present it does nothing.

Parameters:
[in] rWatch inotify watch
Exceptions:
InotifyException thrown if removing failed

void Inotify::Remove InotifyWatch pWatch  )  throw (InotifyException)
 

Removes a watch.

If the given watch is not present it does nothing.

Parameters:
[in] pWatch inotify watch
Exceptions:
InotifyException thrown if removing failed

void Inotify::RemoveAll  ) 
 

Removes all watches.

void Inotify::SetNonBlock bool  fNonBlock  )  throw (InotifyException)
 

Enables/disables non-blocking mode.

Use this mode if you want to monitor the descriptor (acquired thru GetDescriptor()) in functions such as poll(), select() etc.

Parameters:
[in] fNonBlock enable/disable non-blocking mode
Exceptions:
InotifyException thrown if setting mode failed
See also:
GetDescriptor()

void Inotify::WaitForEvents bool  fNoIntr = false  )  throw (InotifyException)
 

Waits for inotify events.

It waits until one or more events occur. When called in nonblocking mode it only retrieves occurred events to the internal queue and exits.

Parameters:
[in] fNoIntr if true it re-calls the system call after a handled signal
Exceptions:
InotifyException thrown if reading events failed
See also:
SetNonBlock()


The documentation for this class was generated from the following files:
Generated on Tue Oct 3 23:19:22 2006 for inotify-cxx by  doxygen 1.4.4