ACE
6.3.3
|
C++ wrapper facade for the socket fd_set
abstraction.
More...
#include <Handle_Set.h>
Public Types | |
enum | { MAXSIZE = ACE_DEFAULT_SELECT_REACTOR_SIZE } |
Public Member Functions | |
ACE_Handle_Set (void) | |
Constructor, initializes the bitmask to all 0s. More... | |
ACE_Handle_Set (const fd_set &mask) | |
void | reset (void) |
Initialize the bitmask to all 0s and reset the associated fields. More... | |
int | is_set (ACE_HANDLE handle) const |
void | set_bit (ACE_HANDLE handle) |
void | clr_bit (ACE_HANDLE handle) |
int | num_set (void) const |
Returns a count of the number of enabled bits. More... | |
ACE_HANDLE | max_set (void) const |
Returns the number of the large bit. More... | |
void | sync (ACE_HANDLE max) |
operator fd_set * () | |
fd_set * | fdset (void) |
void | dump (void) const |
Dump the state of an object. More... | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. More... | |
Private Types | |
enum | { WORDSIZE = NFDBITS, NBITS = 256 } |
Private Member Functions | |
void | set_max (ACE_HANDLE max) |
Static Private Member Functions | |
static int | count_bits (u_long n) |
Private Attributes | |
int | size_ |
Size of the set, i.e., a count of the number of enabled bits. More... | |
ACE_HANDLE | max_handle_ |
Current max handle. More... | |
fd_set | mask_ |
Bitmask. More... | |
Static Private Attributes | |
static const char | nbits_ [NBITS] |
Friends | |
class | ACE_Handle_Set_Iterator |
C++ wrapper facade for the socket fd_set
abstraction.
This abstraction is a very efficient wrapper facade over fd_set
. In particular, no range checking is performed, so it's important not to set or clear bits that are outside the ACE_DEFAULT_SELECT_REACTOR_SIZE
.
ACE_Handle_Set::ACE_Handle_Set | ( | void | ) |
Constructor, initializes the bitmask to all 0s.
ACE_Handle_Set::ACE_Handle_Set | ( | const fd_set & | mask | ) |
Constructor, initializes the handle set from a given mask.
|
inline |
Disables the handle. No range checking is performed so handle must be less than ACE_DEFAULT_SELECT_REACTOR_SIZE
.
|
staticprivate |
Counts the number of bits enabled in N. Uses a table lookup to speed up the count.
void ACE_Handle_Set::dump | ( | void | ) | const |
Dump the state of an object.
|
inline |
Returns a pointer to the underlying fd_set
. Returns 0 if there are no handle bits set (<size_> == 0).
|
inline |
Checks whether handle is enabled. No range checking is performed so handle must be less than ACE_DEFAULT_SELECT_REACTOR_SIZE
.
|
inline |
Returns the number of the large bit.
|
inline |
Returns a count of the number of enabled bits.
|
inline |
Returns a pointer to the underlying fd_set
. Returns 0 if there are no handle bits set (<size_> == 0).
|
inline |
Initialize the bitmask to all 0s and reset the associated fields.
|
inline |
Enables the handle. No range checking is performed so handle must be less than ACE_DEFAULT_SELECT_REACTOR_SIZE
.
|
private |
Resets the <max_handle_> after a clear of the original <max_handle_>.
void ACE_Handle_Set::sync | ( | ACE_HANDLE | max | ) |
Rescan the underlying fd_set
up to handle max to find the new <max_handle> (highest bit set) and <size> (how many bits set) values. This is useful for evaluating the changes after the handle set has been manipulated in some way other than member functions; for example, after <select> modifies the fd_set
.
|
friend |
ACE_Handle_Set::ACE_ALLOC_HOOK_DECLARE |
Declare the dynamic allocation hooks.
|
private |
Bitmask.
|
private |
Current max handle.
|
staticprivate |
Table that maps bytes to counts of the enabled bits in each value from 0 to 255.
|
private |
Size of the set, i.e., a count of the number of enabled bits.