Go to the previous, next section.
#include <nihcl/FDSet.h>
FDSet
provide a representation of a set of file descriptors suitable for use with the
select()
UNIX operating system call. Each bit in an
FDset
corresponds to a UNIX file descriptor of the same number; for example, bit 0 corresponds to file descriptor 0, bit 1 to file descriptor 1, and so on. If a bit is 1, then its corresponding file descriptor is considered to be a member of the
FDSet
.
Class
FDSet
provides member functions for setting, clearing, or testing individual bits, a complete set of logical operators for combining
FDSet
s, conversion operators so that instances of class
FDSet
can be passed as arguments to
select()
, and index operators so that the bits in an
FDSet
can be referenced using index notation.
static unsigned dtablesize()
FDSet
.
FDSet()
FDSet
initialized to all zeros.
void clr(int
fd)
void set(int
fd)
FDSet
that corresponds to the argument file descriptor number
fd. File descriptors are numbered starting with zero.
void zero()
FDSet
to zero.
virtual unsigned hash() const
bool operator==(const FDSet&) const
bool operator!=(const FDSet&) const
YES
if the left
FDSet
operand is equal to (or not equal to) the right
FDSet
operand.
FDSet operator-(const FDSet&) const
FDSet
that contains all integers that are in the left
FDSet
operand and not in the right
FDSet
operand. For example,
FDSet(0,1,2) - FDSet(1,2)
is the
FDSet
[0].
FDSet operator&(const FDSet&) const
FDSet
containing all integers that are in both the left and right
FDSet
operands. For example,
FDSet(0,1) & FDSet(1,2)
is the
FDSet
[1].
FDSet operator|(const FDSet&) const
FDSet
containing all integers that are in either the left or right
FDSet
operands. For example,
FDSet(0,1) | FDSet(1,2)
is the
FDSet
[0,1,2].
FDSet operator^(const FDSet&) const
FDSet
containing all integers that are in the left or right
FDSet
operands, but not in both. For example,
FDSet(0,1) ^ FDSet(1,2)
is the
FDSet
[0,2].
void operator-=(const FDSet&)
void operator&=(const FDSet&)
void operator|=(const FDSet&)
void operator^=(const FDSet&)
FDSet
operand by the result of applying the indicated logical operation to the left and right
FDSet
operands.
bool includes(unsigned
fd) const
bool isSet(int
fd) const
YES
if
fd
is a member of this
FDSet
; that is, if bit
fd
of this
FDSet
is one.
virtual bool isEmpty() const
YES
if all bits in this
FDSet
are zero.
virtual bool isEqual(const Object&
ob) const
YES
if
ob
is of species
FDSet
and equals this
FDSet
.
operator fd_set&()
operator const fd_set&() const
operator fd_set*()
operator const fd_set*() const
fd_set
), suitable for use as an argument to the
select()
system call.
virtual void deepenShallowCopy()
FDSet
.
FDSetRef operator[](int
fd)
const FDSetRef operator[](int
fd) const
FDSetRef
, which allows the bit corresponding to file descriptor
fd
to be accessed. For example,
FDSet s; s[2] = 1;
sets the bit corresponding to file descriptor 2 in the
FDSet
s
to 1, and
FDSet s; if (s[2]) // ...
tests the bit corresponding to file descriptor 2 in the
FDSet
s.
virtual unsigned capacity() const
virtual unsigned size() const
FDSet
.
virtual void printOn(ostream&
strm
=cout) const
FDSet
on output stream
strm.
virtual const Class* species() const
FDSet
.
virtual void storer(OIOofd&
fd) const
virtual void storer(OIOout&
strm) const
FDSet
on
fd
or
strm.
virtual int compare(const Object&) const
shouldNotImplement()
.
Go to the previous, next section.