summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordoccvs <doccvs@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-01-22 15:02:03 +0000
committerdoccvs <doccvs@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2001-01-22 15:02:03 +0000
commit00b77264215cc33ac6f2e3089480dc96eef89220 (patch)
tree0d33d5c37d818ad60e135930c33b9cc64230ed98
parentf7b87fe6a32197b64ce2dc4618ac5710a00f1cda (diff)
downloadATCD-00b77264215cc33ac6f2e3089480dc96eef89220.tar.gz
ChangeLogTag:Mon Jan 22 15:56:42 2001 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r--ChangeLog12
-rw-r--r--ChangeLogs/ChangeLog-02a12
-rw-r--r--ChangeLogs/ChangeLog-03a12
-rw-r--r--ace/Containers_T.cpp13
-rw-r--r--ace/Containers_T.h7
-rw-r--r--tests/OrdMultiSet_Test.cpp18
6 files changed, 69 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 5457f3bc53c..8c9852d5714 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,20 @@
+Mon Jan 22 15:38:12 2001 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/Containers_T.h:
+ ace/Containers_T.cpp:
+ Added operator* to the ACE_Ordered_Multiset_Iterator class
+
+ * tests/Ordmultiset_test.cpp
+ Expanded test for the new operator* of the ACE_Ordered_Multiset_
+ Iterator class
+
Sat Jan 20 14:53:07 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu>
* ace/Configuration.{h,cpp}: Fixed some problems with const char *
that was busting the compilation. Thanks to Carlos for pointing
this out.
- * ace/Configuration.{h,cpp}: Added several fixes for
+ * ace/Configuration.{h,cpp}: Added several fixes for
mistakes with memory management and other minor problems.
Thanks to Jonathan Reis <reis@stentorsoft.com> for contributing
these fixes!
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index 5457f3bc53c..8c9852d5714 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,10 +1,20 @@
+Mon Jan 22 15:38:12 2001 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/Containers_T.h:
+ ace/Containers_T.cpp:
+ Added operator* to the ACE_Ordered_Multiset_Iterator class
+
+ * tests/Ordmultiset_test.cpp
+ Expanded test for the new operator* of the ACE_Ordered_Multiset_
+ Iterator class
+
Sat Jan 20 14:53:07 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu>
* ace/Configuration.{h,cpp}: Fixed some problems with const char *
that was busting the compilation. Thanks to Carlos for pointing
this out.
- * ace/Configuration.{h,cpp}: Added several fixes for
+ * ace/Configuration.{h,cpp}: Added several fixes for
mistakes with memory management and other minor problems.
Thanks to Jonathan Reis <reis@stentorsoft.com> for contributing
these fixes!
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 5457f3bc53c..8c9852d5714 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,10 +1,20 @@
+Mon Jan 22 15:38:12 2001 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/Containers_T.h:
+ ace/Containers_T.cpp:
+ Added operator* to the ACE_Ordered_Multiset_Iterator class
+
+ * tests/Ordmultiset_test.cpp
+ Expanded test for the new operator* of the ACE_Ordered_Multiset_
+ Iterator class
+
Sat Jan 20 14:53:07 2001 Douglas C. Schmidt <schmidt@ace.cs.wustl.edu>
* ace/Configuration.{h,cpp}: Fixed some problems with const char *
that was busting the compilation. Thanks to Carlos for pointing
this out.
- * ace/Configuration.{h,cpp}: Added several fixes for
+ * ace/Configuration.{h,cpp}: Added several fixes for
mistakes with memory management and other minor problems.
Thanks to Jonathan Reis <reis@stentorsoft.com> for contributing
these fixes!
diff --git a/ace/Containers_T.cpp b/ace/Containers_T.cpp
index 381fe443d23..02e90016df7 100644
--- a/ace/Containers_T.cpp
+++ b/ace/Containers_T.cpp
@@ -2426,6 +2426,19 @@ ACE_Ordered_MultiSet_Iterator<T>::next (T *&item) const
return 0;
}
+template <class T> T&
+ACE_Ordered_MultiSet_Iterator<T>::operator* (void)
+{
+ //ACE_TRACE ("ACE_Ordered_MultiSet_Iterator<T>::operator*");
+ T *retv = 0;
+
+ int result = this->next (retv);
+ ACE_ASSERT (result != 0);
+ ACE_UNUSED_ARG (result);
+
+ return *retv;
+}
+
ACE_ALLOC_HOOK_DEFINE (ACE_DLList_Node)
template <class T> T *
diff --git a/ace/Containers_T.h b/ace/Containers_T.h
index 6bde6d71662..15a01f644f3 100644
--- a/ace/Containers_T.h
+++ b/ace/Containers_T.h
@@ -1168,7 +1168,7 @@ public:
/// Prefix advance.
ACE_Unbounded_Set_Iterator<T>& operator++ (void);
- /// Returns a reference to the interal element <this> is pointing to.
+ /// Returns a reference to the internal element <this> is pointing to.
T& operator* (void);
/// Check if two iterators point to the same position
@@ -1609,6 +1609,9 @@ public:
/// Dump the state of an object.
void dump (void) const;
+ /// Returns a reference to the internal element <this> is pointing to.
+ T& operator* (void);
+
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
@@ -1628,7 +1631,7 @@ private:
* that allows duplicates. This class template requires that <
* operator semantics be defined for the parameterized type <T>, but
* does not impose any restriction on how that ordering operator is
- * implemented.
+ * implemented.
*/
template <class T>
class ACE_Ordered_MultiSet
diff --git a/tests/OrdMultiSet_Test.cpp b/tests/OrdMultiSet_Test.cpp
index b34a785e0cf..9a213c278d9 100644
--- a/tests/OrdMultiSet_Test.cpp
+++ b/tests/OrdMultiSet_Test.cpp
@@ -97,6 +97,24 @@ main (int, ACE_TCHAR *[])
// We should have iterated through the entire set.
ACE_ASSERT (iter.done () != 0);
+ // Iterate through the set and use the operator* to get the element
+ iter.first ();
+ for (i = -19; i <= 19; ++i)
+ {
+ // we should still be in the set
+ ACE_ASSERT (iter.done () == 0);
+
+ // make sure the current element is what we expect
+ int& l = *iter;
+ ACE_ASSERT (l == i);
+
+ // move to the next element in the set
+ iter.advance ();
+ }
+
+ // We should have iterated through the entire set.
+ ACE_ASSERT (iter.done () != 0);
+
// Clear the set, restart the iterator, and make sure the iterator
// is out of range at both ends, the set is empty, and a subsequent
// advance or retreat on an out of range iterator does not cause