summaryrefslogtreecommitdiff
path: root/ace/Handle_Set.h
diff options
context:
space:
mode:
Diffstat (limited to 'ace/Handle_Set.h')
-rw-r--r--ace/Handle_Set.h41
1 files changed, 18 insertions, 23 deletions
diff --git a/ace/Handle_Set.h b/ace/Handle_Set.h
index ef01db484e6..3be77f18371 100644
--- a/ace/Handle_Set.h
+++ b/ace/Handle_Set.h
@@ -19,16 +19,6 @@
#include "ace/ACE.h"
-// This wrapper design is not very portable to DEC OSF/1 I had to
-// redefine NFDBITS to 32. On OSF/1 NFDBITS is a macro that expands to
-// (sizeof(fd_mask)*8) which is 4096 by default. This was an
-// inappropriate value for defining the MSB_MASK default value. Any
-// ideas? The workaround is a pretty severe restriction for OSF/1.
-// DJT
-// #if defined (__osf__)
-// #define NFDBITS 32
-// #endif
-
class ACE_Export ACE_Handle_Set
{
// = TITLE
@@ -81,7 +71,7 @@ public:
private:
int size_;
- // Size of the set.
+ // Size of the set, i.e., a count of the number of enabled bits.
ACE_HANDLE max_handle_;
// Current max handle.
@@ -98,7 +88,7 @@ private:
NBITS = 256
};
- int count_bits (unsigned long n) const;
+ int count_bits (u_long n) const;
// Counts the number of bits enabled in N. Uses a table lookup to
// speed up the count.
@@ -111,17 +101,22 @@ private:
class ACE_Export ACE_Handle_Set_Iterator
// = TITLE
- // Iterator for the ACE_Handle_Set abstraction.
+ // Iterator for the <ACE_Handle_Set> abstraction.
{
public:
- ACE_Handle_Set_Iterator (const ACE_Handle_Set &);
+ ACE_Handle_Set_Iterator (const ACE_Handle_Set &hs);
// Constructor.
- ACE_HANDLE operator ()(void);
- // "Next" operator.
+ ACE_HANDLE operator () (void);
+ // "Next" operator. Returns the next unseen <ACE_HANDLE> in the
+ // <Handle_Set> up to <handle_set_.max_handle_>). When all the
+ // handles have been seen returns <ACE_INVALID_HANDLE>. Advances
+ // the iterator automatically, so you need not call <operator++>
+ // (which is now obsolete).
void operator++ (void);
- // Advance by "one."
+ // This is a no-op and no longer does anything. It's only here for
+ // backwards compatibility.
void dump (void) const;
// Dump the state of an object.
@@ -133,16 +128,16 @@ private:
const ACE_Handle_Set &handles_;
// The <Handle_Set> we are iterating through.
- int num_;
- // Number of the word we're iterating on.
+ int handle_index_;
+ // Index of the bit we're examining in the current <word_num_> word.
- size_t index_;
- // Index of the current <num_> word.
+ int word_num_;
+ // Number of the word we're iterating over (typically between 0..7).
#if !defined (ACE_WIN32)
- fd_mask val_;
-#endif /* ACE_WIN32 */
+ fd_mask word_val_;
// Value of the bits in the word we're iterating on.
+#endif /* ACE_WIN32 */
};
#if defined (__ACE_INLINE__)