summaryrefslogtreecommitdiff
path: root/ace/Containers.cpp
diff options
context:
space:
mode:
authornw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-08-30 04:36:42 +0000
committernw1 <nw1@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-08-30 04:36:42 +0000
commit9fb59b5fa4f9f6eadc841f8fa94a475b504f8ab1 (patch)
tree95600f421e904020f0f05c776cd6c8e6f822edb9 /ace/Containers.cpp
parentd19741bc2be4a0028870b985b136d5b60c9abba1 (diff)
downloadATCD-9fb59b5fa4f9f6eadc841f8fa94a475b504f8ab1.tar.gz
Changed from calling destructor and deallocator for template classes
to using ACE_DES_FREE_TEMPLATE macro. The expansion of this macro depends on whether the flag ACE_HAS_BROKEN_EXPLICIT_TEMPLATE_DESTRUCTOR is set or not.
Diffstat (limited to 'ace/Containers.cpp')
-rw-r--r--ace/Containers.cpp41
1 files changed, 20 insertions, 21 deletions
diff --git a/ace/Containers.cpp b/ace/Containers.cpp
index c2cd1d41555..73f04908d68 100644
--- a/ace/Containers.cpp
+++ b/ace/Containers.cpp
@@ -153,8 +153,8 @@ ACE_Unbounded_Stack<T>::delete_all_nodes (void)
{
ACE_Node<T> *temp = this->head_->next_;
this->head_->next_ = temp->next_;
- temp->ACE_Node<T>::~ACE_Node ();
- this->allocator_->free (temp);
+ ACE_DES_FREE_TEMPLATE (temp, this->allocator_->free,
+ ACE_Node, <T>);
}
this->cur_size_ = 0;
@@ -219,9 +219,8 @@ ACE_Unbounded_Stack<T>::~ACE_Unbounded_Stack (void)
// ACE_TRACE ("ACE_Unbounded_Stack<T>::~ACE_Unbounded_Stack");
this->delete_all_nodes ();
- this->head_->ACE_Node<T>::~ACE_Node ();
- this->allocator_->free (this->head_);
- this->head_ = 0;
+ ACE_DES_FREE_TEMPLATE (this->head_, this->allocator_->free,
+ ACE_Node, <T>);
}
template<class T> int
@@ -253,8 +252,8 @@ ACE_Unbounded_Stack<T>::pop (T &item)
item = temp->item_;
this->head_->next_ = temp->next_;
- temp->ACE_Node<T>::~ACE_Node ();
- this->allocator_->free (temp);
+ ACE_DES_FREE_TEMPLATE (temp, this->allocator_->free,
+ ACE_Node, <T>);
this->cur_size_--;
return 0;
}
@@ -310,8 +309,8 @@ ACE_Unbounded_Stack<T>::remove (const T &item)
// Skip over the node that we're deleting.
curr->next_ = temp->next_;
this->cur_size_--;
- temp->ACE_Node<T>::~ACE_Node ();
- this->allocator_->free (temp);
+ ACE_DES_FREE_TEMPLATE (temp, this->allocator_->free,
+ ACE_Node, <T>);
return 0;
}
}
@@ -411,8 +410,8 @@ ACE_Unbounded_Queue<T>::delete_nodes (void)
ACE_Node<T> *temp = curr;
curr = curr->next_;
- temp->ACE_Node<T>::~ACE_Node ();
- this->allocator_->free (temp);
+ ACE_DES_FREE_TEMPLATE (temp, this->allocator_->free,
+ ACE_Node, <T>);
this->cur_size_--;
}
@@ -426,8 +425,8 @@ ACE_Unbounded_Queue<T>::~ACE_Unbounded_Queue (void)
ACE_TRACE ("ACE_Unbounded_Queue<T>::~ACE_Unbounded_Queue (void)");
this->delete_nodes ();
- this->head_->ACE_Node<T>::~ACE_Node ();
- this->allocator_->free (this->head_);
+ ACE_DES_FREE_TEMPLATE (this->head_, this->allocator_->free,
+ ACE_Node, <T>);
this->head_ = 0;
}
@@ -488,8 +487,8 @@ ACE_Unbounded_Queue<T>::dequeue_head (T &item)
item = temp->item_;
this->head_->next_ = temp->next_;
- temp->ACE_Node<T>::~ACE_Node ();
- this->allocator_->free (temp);
+ ACE_DES_FREE_TEMPLATE (temp, this->allocator_->free,
+ ACE_Node, <T>);
--this->cur_size_;
return 0;
}
@@ -1144,8 +1143,8 @@ ACE_Unbounded_Set<T>::delete_nodes (void)
{
ACE_Node<T> *temp = curr;
curr = curr->next_;
- temp->ACE_Node<T>::ACE_Node ();
- this->allocator_->free (temp);
+ ACE_DES_FREE_TEMPLATE (temp, this->allocator_->free,
+ ACE_Node, <T>);
this->cur_size_--;
}
@@ -1161,8 +1160,8 @@ ACE_Unbounded_Set<T>::~ACE_Unbounded_Set (void)
this->delete_nodes ();
// Delete the dummy node.
- this->head_->ACE_Node<T>::~ACE_Node ();
- this->allocator_->free (this->head_);
+ ACE_DES_FREE_TEMPLATE (this->head_, this->allocator_->free,
+ ACE_Node, <T>);
this->head_ = 0;
}
@@ -1264,8 +1263,8 @@ ACE_Unbounded_Set<T>::remove (const T &item)
// Skip over the node that we're deleting.
curr->next_ = temp->next_;
this->cur_size_--;
- temp->ACE_Node<T>::ACE_Node ();
- this->allocator_->free (temp);
+ ACE_DES_FREE_TEMPLATE (temp, this->allocator_->free,
+ ACE_Node, <T>);
return 0;
}
}