NAME
ACE_Handle_Set -
C++ wrapper for the socket FD_SET abstraction.
SYNOPSIS
#include <ace/Handle_Set.h>
class ACE_Handle_Set
{
public:
friend class ACE_Handle_Set_Iterator;
enum { MAXSIZE = ACE_DEFAULT_REACTOR_SIZE };
ACE_Handle_Set (void);
ACE_Handle_Set (const ACE_FD_SET_TYPE &mask);
void reset (void);
int is_set (ACE_HANDLE) const;
void set_bit (ACE_HANDLE);
void clr_bit (ACE_HANDLE);
int num_set (void) const;
ACE_HANDLE max_set (void) const;
void sync (ACE_HANDLE max);
operator fd_set *();
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
private:
int size_;
ACE_HANDLE max_handle_;
fd_set mask_;
enum{ WORDSIZE = NFDBITS, #if !defined(
ACE_WIN32) NUM_WORDS = howmany (MAXSIZE,
NFDBITS),
#endif NBITS = 256 };
int count_bits (unsigned long n) const;
void set_max (ACE_HANDLE max);
static const char nbits_[ACE_Handle_Set::NBITS];
};
Initialization and termination.
Initialization methods.
ACE_Handle_Set (void);
Constructor, initializes the bitmask to all 0s.
ACE_Handle_Set (const ACE_FD_SET_TYPE &mask);
Methods for manipulating bitsets.
void reset (void);
Initialize the bitmask to all 0s and reset the associated fields.
int is_set (ACE_HANDLE) const;
Checks whether handle is enabled.
void set_bit (ACE_HANDLE);
void clr_bit (ACE_HANDLE);
int num_set (void) const;
Returns a count of the number of enabled bits.
ACE_HANDLE max_set (void) const;
Returns the number of the large bit.
void sync (ACE_HANDLE max);
Synchronize the underlying FD_SET with the MAX_FD and the SIZE.
operator fd_set *();
Returns a pointer to the underlying fd_set.
void dump (void) const;
Dump the state of an object.
ACE_ALLOC_HOOK_DECLARE;
Declare the dynamic allocation hooks.
AUTHOR
Doug Schmidt
LIBRARY
ace