Go to the documentation of this file. 1 #ifndef __JLANG__JFILEDESCRIPTORMASK__
2 #define __JLANG__JFILEDESCRIPTORMASK__
4 #include <sys/select.h>
15 namespace JPP {
using namespace JLANG; }
79 const fd_set*
get()
const
81 return static_cast<const fd_set*>(
this);
92 return static_cast<fd_set*>(
this);
125 void reset(
const bool option =
true)
154 void set(
const int file_descriptor)
156 if (!
has(file_descriptor)) {
158 FD_SET(file_descriptor,
get());
185 void reset(
const int file_descriptor)
187 if (
has(file_descriptor)) {
189 FD_CLR(file_descriptor,
get());
216 bool has(
const int file_descriptor)
const
218 return FD_ISSET(file_descriptor,
get());
int getFileDescriptor() const
Get file descriptor.
Auxiliary class for time values.
JFileDescriptorMask(const int file_descriptor)
Constructor.
static JTimeval min()
Get minimal time value.
bool has(const int file_descriptor) const
Has file descriptor.
JFileDescriptorMask()
Default constructor.
int maximum_file_descriptor
The JAbstractFile class encapsulates the c-style file descriptor.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JFileDescriptorMask(const JAbstractFile &file)
Constructor.
int number_of_file_descriptors
void set(const JAbstractFile &file)
Set file.
int getNumberOfFileDescriptors() const
Get number of file descriptors.
const fd_set * get() const
Get pointer to mask.
bool in_avail(JTimeval timeout=JTimeval::min())
Check availability of input.
const fd_set * operator&() const
Address of operator.
Auxiliary class for method select.
fd_set * get()
Get pointer to mask.
void set(const int file_descriptor)
Set file descriptor.
bool empty() const
Check setting of file descriptors.
void reset(const int file_descriptor)
Reset file descriptor.
static const int MAXIMUM_FILE_DESCRIPTOR
bool has(const JAbstractFile &file) const
Has file.
Auxiliary classes and methods for language specific functionality.
void reset(const JAbstractFile &file)
Reset file.
bool out_avail(JTimeval timeout=JTimeval::min())
Check availability of output.
void reset(const bool option=true)
Reset mask.