summaryrefslogtreecommitdiff
path: root/ace/Containers.h
diff options
context:
space:
mode:
authornw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-01-06 23:24:29 +0000
committernw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-01-06 23:24:29 +0000
commitd9a72db466fe52b8c33d9d4d7df8158bcf8cc5da (patch)
tree4b31ed03aaf46615caa6f5aa1beaafb06c7175dd /ace/Containers.h
parente03c3c4067fa40d01e65216f66db71c9947fa6e7 (diff)
downloadATCD-d9a72db466fe52b8c33d9d4d7df8158bcf8cc5da.tar.gz
Added STL-styled iterator functions.
Diffstat (limited to 'ace/Containers.h')
-rw-r--r--ace/Containers.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/ace/Containers.h b/ace/Containers.h
index 022d6b6679f..9057bf6f53a 100644
--- a/ace/Containers.h
+++ b/ace/Containers.h
@@ -638,7 +638,7 @@ class ACE_Unbounded_Set_Iterator
// Implement an iterator over an unbounded set.
public:
// = Initialization method.
- ACE_Unbounded_Set_Iterator (ACE_Unbounded_Set<T> &s);
+ ACE_Unbounded_Set_Iterator (ACE_Unbounded_Set<T> &s, int end = 0);
// = Iteration methods.
@@ -656,6 +656,21 @@ public:
void dump (void) const;
// Dump the state of an object.
+ // = STL styled iteration, compare, and reference functions.
+
+ ACE_Unbounded_Set_Iterator<T> operator++ (void);
+ // Postfix advance.
+
+ ACE_Unbounded_Set_Iterator<T>& operator++ (int);
+ // Prefix advance.
+
+ T& operator* (void);
+ // Returns a reference to the interal element <this> is pointing to.
+
+ int operator== (const ACE_Unbounded_Set_Iterator<T> &) const;
+ int operator!= (const ACE_Unbounded_Set_Iterator<T> &) const;
+ // Check if two iterators point to the same position
+
ACE_ALLOC_HOOK_DECLARE;
// Declare the dynamic allocation hooks.
@@ -663,7 +678,7 @@ private:
ACE_Node<T> *current_;
// Pointer to the current node in the iteration.
- ACE_Unbounded_Set<T> &set_;
+ ACE_Unbounded_Set<T> *set_;
// Pointer to the set we're iterating over.
};
@@ -682,6 +697,7 @@ public:
// Trait definition.
typedef ACE_Unbounded_Set_Iterator<T> ITERATOR;
+ typedef ACE_Unbounded_Set_Iterator<T> iterator;
// = Initialization and termination methods.
ACE_Unbounded_Set (ACE_Allocator *alloc = 0);
@@ -730,6 +746,10 @@ public:
void reset (void);
// Reset the <ACE_Unbounded_Set> to be empty.
+ // = STL-styled unidirectional iterator factory.
+ ACE_Unbounded_Set_Iterator<T> begin (void);
+ ACE_Unbounded_Set_Iterator<T> end (void);
+
ACE_ALLOC_HOOK_DECLARE;
// Declare the dynamic allocation hooks.