summaryrefslogtreecommitdiff
path: root/ace/Map_Manager.i
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-09-08 02:53:31 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-09-08 02:53:31 +0000
commit95012743a8c2f734bae9327bed5127240e675c9f (patch)
tree9514ac9cfdc07c1feeb44a56f2379e5d2e2d2e33 /ace/Map_Manager.i
parent58b97baec866c98d9d6d75f32adf0a0ac8a671c9 (diff)
downloadATCD-95012743a8c2f734bae9327bed5127240e675c9f.tar.gz
ChangeLogTag:Tue Sep 07 19:55:52 1999 Irfan Pyarali <irfan@cs.wustl.edu>
Diffstat (limited to 'ace/Map_Manager.i')
-rw-r--r--ace/Map_Manager.i118
1 files changed, 108 insertions, 10 deletions
diff --git a/ace/Map_Manager.i b/ace/Map_Manager.i
index 940acbc10b1..5ab50a108a3 100644
--- a/ace/Map_Manager.i
+++ b/ace/Map_Manager.i
@@ -290,10 +290,30 @@ ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::done (void) const
template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::forward_i (void)
{
- if (this->next_ == this->map_man_->occupied_list_id ())
- this->next_ = this->map_man_->occupied_list_.next ();
- else
- this->next_ = this->map_man_->search_structure_[this->next_].next ();
+
+#if defined (ACE_HAS_LAZY_MAP_MANAGER)
+
+ while (1)
+ {
+ // Go to the next item in the list.
+ this->next_ = this->map_man_->search_structure_[this->next_].next ();
+
+ // Stop if we reach the end.
+ if (this->done ())
+ break;
+
+ // Break if we find a non-free slot.
+ if (!this->map_man_->search_structure_[this->next_].free_)
+ {
+ break;
+ }
+ }
+
+#else
+
+ this->next_ = this->map_man_->search_structure_[this->next_].next ();
+
+#endif /* ACE_HAS_LAZY_MAP_MANAGER */
return this->next_ != this->map_man_->occupied_list_id ();
}
@@ -301,10 +321,30 @@ ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::forward_i (void)
template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK>::reverse_i (void)
{
- if (this->next_ == this->map_man_->occupied_list_id ())
- this->next_ = this->map_man_->occupied_list_.prev ();
- else
- this->next_ = this->map_man_->search_structure_[this->next_].prev ();
+
+#if defined (ACE_HAS_LAZY_MAP_MANAGER)
+
+ while (1)
+ {
+ // Go to the prev item in the list.
+ this->next_ = this->map_man_->search_structure_[this->next_].prev ();
+
+ // Stop if we reach the end.
+ if (this->done ())
+ break;
+
+ // Break if we find a non-free slot.
+ if (!this->map_man_->search_structure_[this->next_].free_)
+ {
+ break;
+ }
+ }
+
+#else
+
+ this->next_ = this->map_man_->search_structure_[this->next_].prev ();
+
+#endif /* ACE_HAS_LAZY_MAP_MANAGER */
return this->next_ != this->map_man_->occupied_list_id ();
}
@@ -335,7 +375,36 @@ ACE_Map_Iterator<EXT_ID, INT_ID, ACE_LOCK>::ACE_Map_Iterator (ACE_Map_Manager<EX
: ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK> (mm)
{
if (!pass_end)
- this->forward_i ();
+ {
+
+#if defined (ACE_HAS_LAZY_MAP_MANAGER)
+
+ // Start here.
+ this->next_ = this->map_man_->occupied_list_.next ();
+
+ while (1)
+ {
+ // Stop if we reach the end.
+ if (this->done ())
+ break;
+
+ // Break if we find a non-free slot.
+ if (!this->map_man_->search_structure_[this->next_].free_)
+ {
+ break;
+ }
+
+ // Go to the next item in the list.
+ this->next_ = this->map_man_->search_structure_[this->next_].next ();
+ }
+
+#else
+
+ this->next_ = this->map_man_->occupied_list_.next ();
+
+#endif /* ACE_HAS_LAZY_MAP_MANAGER */
+
+ }
}
template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int
@@ -384,7 +453,36 @@ ACE_Map_Reverse_Iterator<EXT_ID, INT_ID, ACE_LOCK>::ACE_Map_Reverse_Iterator (AC
: ACE_Map_Iterator_Base<EXT_ID, INT_ID, ACE_LOCK> (mm)
{
if (!pass_end)
- this->reverse_i ();
+ {
+
+#if defined (ACE_HAS_LAZY_MAP_MANAGER)
+
+ // Start here.
+ this->next_ = this->map_man_->occupied_list_.prev ();
+
+ while (1)
+ {
+ // Stop if we reach the end.
+ if (this->done ())
+ break;
+
+ // Break if we find a non-free slot.
+ if (!this->map_man_->search_structure_[this->next_].free_)
+ {
+ break;
+ }
+
+ // Go to the prev item in the list.
+ this->next_ = this->map_man_->search_structure_[this->next_].prev ();
+ }
+
+#else
+
+ this->next_ = this->map_man_->occupied_list_.prev ();
+
+#endif /* ACE_HAS_LAZY_MAP_MANAGER */
+
+}
}
template <class EXT_ID, class INT_ID, class ACE_LOCK> ACE_INLINE int