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, 23 insertions, 18 deletions
diff --git a/ace/Handle_Set.h b/ace/Handle_Set.h
index 3be77f18371..ef01db484e6 100644
--- a/ace/Handle_Set.h
+++ b/ace/Handle_Set.h
@@ -19,6 +19,16 @@
#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
@@ -71,7 +81,7 @@ public:
private:
int size_;
- // Size of the set, i.e., a count of the number of enabled bits.
+ // Size of the set.
ACE_HANDLE max_handle_;
// Current max handle.
@@ -88,7 +98,7 @@ private:
NBITS = 256
};
- int count_bits (u_long n) const;
+ int count_bits (unsigned long n) const;
// Counts the number of bits enabled in N. Uses a table lookup to
// speed up the count.
@@ -101,22 +111,17 @@ 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 &hs);
+ ACE_Handle_Set_Iterator (const ACE_Handle_Set &);
// Constructor.
- 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).
+ ACE_HANDLE operator ()(void);
+ // "Next" operator.
void operator++ (void);
- // This is a no-op and no longer does anything. It's only here for
- // backwards compatibility.
+ // Advance by "one."
void dump (void) const;
// Dump the state of an object.
@@ -128,16 +133,16 @@ private:
const ACE_Handle_Set &handles_;
// The <Handle_Set> we are iterating through.
- int handle_index_;
- // Index of the bit we're examining in the current <word_num_> word.
+ int num_;
+ // Number of the word we're iterating on.
- int word_num_;
- // Number of the word we're iterating over (typically between 0..7).
+ size_t index_;
+ // Index of the current <num_> word.
#if !defined (ACE_WIN32)
- fd_mask word_val_;
- // Value of the bits in the word we're iterating on.
+ fd_mask val_;
#endif /* ACE_WIN32 */
+ // Value of the bits in the word we're iterating on.
};
#if defined (__ACE_INLINE__)