ionflux.org | Impressum

Ionflux::Tools::FDSet Class Reference
[I/O Multiplexing]

File descriptor set. More...

#include <FDSet.hpp>

List of all members.

Public Member Functions

 FDSet ()
 Constructor.
virtual ~FDSet ()
 Destructor.
virtual void addFD (int fd)
 Add file descriptor (read).
virtual void addReadFD (int fd)
 Add file descriptor (read).
virtual void addWriteFD (int fd)
 Add file descriptor (write).
virtual void addExceptFD (int fd)
 Add file descriptor (except).
virtual void removeFD (int fd)
 Remove file descriptor (read).
virtual void removeReadFD (int fd)
 Remove file descriptor (read).
virtual void removeWriteFD (int fd)
 Remove file descriptor (write).
virtual void removeExceptFD (int fd)
 Remove file descriptor (except).
virtual bool isSet (int fd)
 Check file descriptor status.
virtual bool isSetRead (int fd)
 Check file descriptor status (read).
virtual bool isSetWrite (int fd)
 Check file descriptor status (write).
virtual bool isSetExcept (int fd)
 Check file descriptor status (except).
virtual int select ()
 Select.
virtual void setTimeout (int secs, int usecs)
 Set timeout.
virtual void clear ()
 Clear all file descriptor sets.
virtual void clearRead ()
 Clear file descriptor set (read).
virtual void clearWrite ()
 Clear file descriptor set (read).
virtual void clearExcept ()
 Clear file descriptor set (read).

Protected Attributes

fd_set masterRead
 Master FD set (read).
fd_set masterWrite
 Master FD set (write).
fd_set masterExcept
 Master FD set (except).
fd_set activeRead
 Active FD set (read).
fd_set activeWrite
 Active FD set (write).
fd_set activeExcept
 Active FD set (except).
timeval * timeout
 Select timeout.


Detailed Description

File descriptor set.

A file descriptor set. This implements the same functionality as select(), FD_ZERO, FD_SET, FD_ISSET, FD_CLR etc. in a more convenient way. It also eliminates ugly macros from your application code. ;-)


Constructor & Destructor Documentation

Ionflux::Tools::FDSet::FDSet  ) 
 

Constructor.

Construct new FDSet object.

Ionflux::Tools::FDSet::~FDSet  )  [virtual]
 

Destructor.

Destruct FDSet object.


Member Function Documentation

void Ionflux::Tools::FDSet::addExceptFD int  fd  )  [virtual]
 

Add file descriptor (except).

Add a file descriptor to the except set.

Parameters:
fd File descriptor.

void Ionflux::Tools::FDSet::addFD int  fd  )  [virtual]
 

Add file descriptor (read).

Add a file descriptor to the read set.

Deprecated:
You should not use this function, since its name is amibiguous. Use addReadFD(), addWriteFD(), addExceptFD() instead. This is provided for backward compatibility only.
Parameters:
fd File descriptor.

void Ionflux::Tools::FDSet::addReadFD int  fd  )  [virtual]
 

Add file descriptor (read).

Add a file descriptor to the read set.

Parameters:
fd File descriptor.

void Ionflux::Tools::FDSet::addWriteFD int  fd  )  [virtual]
 

Add file descriptor (write).

Add a file descriptor to the write set.

Parameters:
fd File descriptor.

void Ionflux::Tools::FDSet::clear  )  [virtual]
 

Clear all file descriptor sets.

void Ionflux::Tools::FDSet::clearExcept  )  [virtual]
 

Clear file descriptor set (read).

void Ionflux::Tools::FDSet::clearRead  )  [virtual]
 

Clear file descriptor set (read).

void Ionflux::Tools::FDSet::clearWrite  )  [virtual]
 

Clear file descriptor set (read).

bool Ionflux::Tools::FDSet::isSet int  fd  )  [virtual]
 

Check file descriptor status.

Checks whether a file descriptor has been set during a select() operation.

Note:
This will check whether the specified file descriptor has been set in any of the FD sets (read, write or except). You should not normally have to use this. Use isSetRead(), isSetWrite() and isSetExcept() instead.
Parameters:
fd File descriptor.
Returns:
true if the file descriptor is set in any of the FD sets, false otherwise.

bool Ionflux::Tools::FDSet::isSetExcept int  fd  )  [virtual]
 

Check file descriptor status (except).

Checks whether a file descriptor has been set during a select() operation.

Parameters:
fd File descriptor.
Returns:
true if the file descriptor is set in the except FD set, false otherwise.

bool Ionflux::Tools::FDSet::isSetRead int  fd  )  [virtual]
 

Check file descriptor status (read).

Checks whether a file descriptor has been set during a select() operation.

Parameters:
fd File descriptor.
Returns:
true if the file descriptor is set in the read FD set, false otherwise.

bool Ionflux::Tools::FDSet::isSetWrite int  fd  )  [virtual]
 

Check file descriptor status (write).

Checks whether a file descriptor has been set during a select() operation.

Parameters:
fd File descriptor.
Returns:
true if the file descriptor is set in the write FD set, false otherwise.

void Ionflux::Tools::FDSet::removeExceptFD int  fd  )  [virtual]
 

Remove file descriptor (except).

Remove a file descriptor from the except set.

Parameters:
fd File descriptor.

void Ionflux::Tools::FDSet::removeFD int  fd  )  [virtual]
 

Remove file descriptor (read).

Remove a file descriptor from the read set.

Deprecated:
You should not use this function, since its name is amibiguous. Use removeReadFD(), removeWriteFD(), removeExceptFD() instead. This is provided for backward compatibility only.
Parameters:
fd File descriptor.

void Ionflux::Tools::FDSet::removeReadFD int  fd  )  [virtual]
 

Remove file descriptor (read).

Remove a file descriptor from the read set.

Parameters:
fd File descriptor.

void Ionflux::Tools::FDSet::removeWriteFD int  fd  )  [virtual]
 

Remove file descriptor (write).

Remove a file descriptor from the write set.

Parameters:
fd File descriptor.

int Ionflux::Tools::FDSet::select  )  [virtual]
 

Select.

Checks the file descriptors in the set for changed state.

Returns:
The number of file descriptors that have changed state.

void Ionflux::Tools::FDSet::setTimeout int  secs,
int  usecs
[virtual]
 

Set timeout.

Sets the timeout of select operations.

Parameters:
secs Seconds.
usecs Microseconds.


Member Data Documentation

fd_set Ionflux::Tools::FDSet::activeExcept [protected]
 

Active FD set (except).

fd_set Ionflux::Tools::FDSet::activeRead [protected]
 

Active FD set (read).

fd_set Ionflux::Tools::FDSet::activeWrite [protected]
 

Active FD set (write).

fd_set Ionflux::Tools::FDSet::masterExcept [protected]
 

Master FD set (except).

fd_set Ionflux::Tools::FDSet::masterRead [protected]
 

Master FD set (read).

fd_set Ionflux::Tools::FDSet::masterWrite [protected]
 

Master FD set (write).

timeval* Ionflux::Tools::FDSet::timeout [protected]
 

Select timeout.


The documentation for this class was generated from the following files:
Generated on Tue Mar 14 21:08:07 2006 for Ionflux Tools Class Library (iftools) by  doxygen 1.4.6