summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog-97a8
-rw-r--r--ace/Proactor.cpp24
-rw-r--r--ace/Timer_Heap.cpp30
-rw-r--r--ace/Timer_List.cpp16
-rw-r--r--ace/Timer_Queue.cpp8
-rw-r--r--ace/Timers.cpp22
6 files changed, 78 insertions, 30 deletions
diff --git a/ChangeLog-97a b/ChangeLog-97a
index 526e0c13ffa..130abf6f318 100644
--- a/ChangeLog-97a
+++ b/ChangeLog-97a
@@ -1,3 +1,11 @@
+Fri Apr 25 14:58:38 1997 Irfan Pyarali <irfan@flamenco.cs.wustl.edu>
+
+ * ace/Timers: Updated the following files to make it compile on
+ g++. The following files were updated:
+
+ Proactor.cpp Timer_Heap.cpp Timer_List.cpp Timer_Queue.cpp
+ Timers.cpp
+
Thu Apr 24 21:13:51 1997 <irfan@TWOSTEP>
* ace/Timer_Queue: Decoupled the Timer Queue from
diff --git a/ace/Proactor.cpp b/ace/Proactor.cpp
index e323f1d82ea..3176966ade9 100644
--- a/ace/Proactor.cpp
+++ b/ace/Proactor.cpp
@@ -114,6 +114,8 @@ ACE_Proactor_Handle_Timeout_Upcall::operator () (TIMER_QUEUE &timer_queue,
const void *act,
const ACE_Time_Value &time)
{
+ ACE_UNUSED_ARG (timer_queue);
+
if (this->proactor_ == 0)
ACE_ERROR_RETURN ((LM_ERROR,
"(%t) No Proactor set in ACE_Proactor_Handle_Timeout_Upcall, no completion port to post timeout to?!@\n"),
@@ -144,6 +146,9 @@ int
ACE_Proactor_Handle_Timeout_Upcall::operator () (TIMER_QUEUE &timer_queue,
ACE_Handler *handler)
{
+ ACE_UNUSED_ARG (timer_queue);
+ ACE_UNUSED_ARG (handler);
+
// Do nothing
return 0;
}
@@ -489,4 +494,23 @@ ACE_Proactor::Asynch_Timer::complete (u_long bytes_transferred,
this->handler_.handle_timeout (this->time_, this->act ());
}
+#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION)
+
+template class ACE_Unbounded_Set<ACE_Timer_Node_T<ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall> *>;
+template class ACE_Unbounded_Set_Iterator<ACE_Timer_Node_T<ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall> *>;
+template class ACE_Set_Node<ACE_Timer_Node_T<ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall> *>;
+
+template class ACE_Timer_Node_T<ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall>;
+
+template class ACE_Timer_Queue_T<ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall>;
+template class ACE_Timer_Queue_Iterator_T<ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall>;
+
+template class ACE_Timer_List_T<ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall>;
+template class ACE_Timer_List_Iterator_T<ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall>;
+
+template class ACE_Timer_Heap_T<ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall>;
+template class ACE_Timer_Heap_Iterator_T<ACE_Handler *, ACE_Proactor_Handle_Timeout_Upcall>;
+
+#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */
+
#endif /* ACE_WIN32 */
diff --git a/ace/Timer_Heap.cpp b/ace/Timer_Heap.cpp
index 006abe5359c..4f4d93f55e3 100644
--- a/ace/Timer_Heap.cpp
+++ b/ace/Timer_Heap.cpp
@@ -20,7 +20,7 @@ ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR>::ACE_Timer_Heap_Iterator_T (ACE_Timer_H
template <class TYPE, class FUNCTOR> int
-ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR>::next (NODE *&node,
+ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR>::next (ACE_Timer_Node_T<TYPE, FUNCTOR> *&node,
const ACE_Time_Value &cur_time)
{
ACE_TRACE ("ACE_Timer_Heap_Iterator::next");
@@ -152,7 +152,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::is_empty (void) const
}
-template <class TYPE, class FUNCTOR> ACE_Timer_Queue_T<TYPE, FUNCTOR>::ITERATOR &
+template <class TYPE, class FUNCTOR> ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR> &
ACE_Timer_Heap_T<TYPE, FUNCTOR>::iter (void)
{
return this->iterator_;
@@ -194,7 +194,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::dump (void) const
}
template <class TYPE, class FUNCTOR> void
-ACE_Timer_Heap_T<TYPE, FUNCTOR>::copy (int index, NODE *moved_node)
+ACE_Timer_Heap_T<TYPE, FUNCTOR>::copy (int index, ACE_Timer_Node_T<TYPE, FUNCTOR> *moved_node)
{
// Insert <moved_node> into its new location in the heap.
this->heap_[index] = moved_node;
@@ -205,7 +205,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::copy (int index, NODE *moved_node)
this->timer_ids_[moved_node->timer_id_] = index;
}
-template <class TYPE, class FUNCTOR> ACE_Timer_Queue_T<TYPE, FUNCTOR>::NODE *
+template <class TYPE, class FUNCTOR> ACE_Timer_Node_T<TYPE, FUNCTOR> *
ACE_Timer_Heap_T<TYPE, FUNCTOR>::remove (size_t index)
{
NODE *removed_node = this->heap_[index];
@@ -241,7 +241,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::remove (size_t index)
}
template <class TYPE, class FUNCTOR> void
-ACE_Timer_Heap_T<TYPE, FUNCTOR>::reheap_down (NODE *moved_node,
+ACE_Timer_Heap_T<TYPE, FUNCTOR>::reheap_down (ACE_Timer_Node_T<TYPE, FUNCTOR> *moved_node,
size_t index,
size_t child)
{
@@ -271,7 +271,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::reheap_down (NODE *moved_node,
}
template <class TYPE, class FUNCTOR> void
-ACE_Timer_Heap_T<TYPE, FUNCTOR>::reheap_up (NODE *moved_node,
+ACE_Timer_Heap_T<TYPE, FUNCTOR>::reheap_up (ACE_Timer_Node_T<TYPE, FUNCTOR> *moved_node,
size_t index,
size_t parent)
{
@@ -297,7 +297,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::reheap_up (NODE *moved_node,
}
template <class TYPE, class FUNCTOR> void
-ACE_Timer_Heap_T<TYPE, FUNCTOR>::insert (NODE *new_node)
+ACE_Timer_Heap_T<TYPE, FUNCTOR>::insert (ACE_Timer_Node_T<TYPE, FUNCTOR> *new_node)
{
if (this->cur_size_ + 1 >= max_size_)
this->grow_heap ();
@@ -383,7 +383,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::grow_heap (void)
// mutex lock held.
template <class TYPE, class FUNCTOR> void
-ACE_Timer_Heap_T<TYPE, FUNCTOR>::reschedule (NODE *expired)
+ACE_Timer_Heap_T<TYPE, FUNCTOR>::reschedule (ACE_Timer_Node_T<TYPE, FUNCTOR> *expired)
{
ACE_TRACE ("ACE_Timer_Heap::reschedule");
@@ -392,7 +392,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::reschedule (NODE *expired)
}
-template <class TYPE, class FUNCTOR> ACE_Timer_Queue_T<TYPE, FUNCTOR>::NODE *
+template <class TYPE, class FUNCTOR> ACE_Timer_Node_T<TYPE, FUNCTOR> *
ACE_Timer_Heap_T<TYPE, FUNCTOR>::alloc_node (void)
{
ACE_Timer_Node *temp;
@@ -419,7 +419,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::alloc_node (void)
template <class TYPE, class FUNCTOR> void
-ACE_Timer_Heap_T<TYPE, FUNCTOR>::free_node (NODE *node)
+ACE_Timer_Heap_T<TYPE, FUNCTOR>::free_node (ACE_Timer_Node_T<TYPE, FUNCTOR> *node)
{
// Only free up a node if we are *not* using the preallocated heap.
if (this->preallocated_nodes_ == 0)
@@ -498,7 +498,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::cancel (int timer_id,
if (dont_call == 0)
// Call the close hook.
- this->upcall_functor_ (*this, temp->type_);
+ this->upcall_functor_.operator () (*this, temp->type_);
if (act != 0)
*act = temp->act_;
@@ -532,7 +532,7 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::cancel (const TYPE &type,
if (dont_call == 0
&& number_of_cancellations == 1)
// Call the close hook.
- this->upcall_functor_ (*this, temp->type_);
+ this->upcall_functor_.operator () (*this, temp->type_);
this->free_node (temp);
}
@@ -543,10 +543,4 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR>::cancel (const TYPE &type,
return number_of_cancellations;
}
-#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION)
-template class ACE_Unbounded_Set<ACE_Timer_Queue_T<TYPE, FUNCTOR>::NODE *>;
-template class ACE_Unbounded_Set_Iterator<ACE_Timer_Queue_T<TYPE, FUNCTOR>::NODE *>;
-template class ACE_Set_Node<ACE_Timer_Queue_T<TYPE, FUNCTOR>::NODE *>;
-#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */
-
#endif /* ACE_TIMER_HEAP_C */
diff --git a/ace/Timer_List.cpp b/ace/Timer_List.cpp
index f8c0a5ba17e..26a5d813b84 100644
--- a/ace/Timer_List.cpp
+++ b/ace/Timer_List.cpp
@@ -15,7 +15,7 @@ ACE_Timer_List_Iterator_T<TYPE, FUNCTOR>::ACE_Timer_List_Iterator_T (ACE_Timer_L
template <class TYPE, class FUNCTOR> int
-ACE_Timer_List_Iterator_T<TYPE, FUNCTOR>::next (NODE *&node,
+ACE_Timer_List_Iterator_T<TYPE, FUNCTOR>::next (ACE_Timer_Node_T<TYPE, FUNCTOR> *&node,
const ACE_Time_Value &cur_time)
{
if (this->timer_list_.head_ == 0
@@ -31,7 +31,7 @@ ACE_Timer_List_Iterator_T<TYPE, FUNCTOR>::next (NODE *&node,
ACE_ALLOC_HOOK_DEFINE(ACE_Timer_List_T)
- template <class TYPE, class FUNCTOR> ACE_Timer_Queue_T<TYPE, FUNCTOR>::ITERATOR &
+template <class TYPE, class FUNCTOR> ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR> &
ACE_Timer_List_T<TYPE, FUNCTOR>::iter (void)
{
return this->iterator_;
@@ -41,7 +41,7 @@ ACE_Timer_List_T<TYPE, FUNCTOR>::iter (void)
template <class TYPE, class FUNCTOR>
ACE_Timer_List_T<TYPE, FUNCTOR>::ACE_Timer_List_T (FUNCTOR *upcall_functor)
- : INHERITED (upcall_functor),
+ : ACE_Timer_Queue_T<TYPE, FUNCTOR> (upcall_functor),
head_ (0),
iterator_ (*this),
timer_id_ (0)
@@ -60,7 +60,7 @@ ACE_Timer_List_T<TYPE, FUNCTOR>::is_empty (void) const
}
-template <class TYPE, class FUNCTOR> ACE_Timer_Queue_T<TYPE, FUNCTOR>::NODE *
+template <class TYPE, class FUNCTOR> ACE_Timer_Node_T<TYPE, FUNCTOR> *
ACE_Timer_List_T<TYPE, FUNCTOR>::alloc_node (void)
{
return new NODE;
@@ -68,7 +68,7 @@ ACE_Timer_List_T<TYPE, FUNCTOR>::alloc_node (void)
template <class TYPE, class FUNCTOR> void
-ACE_Timer_List_T<TYPE, FUNCTOR>::free_node (NODE *node)
+ACE_Timer_List_T<TYPE, FUNCTOR>::free_node (ACE_Timer_Node_T<TYPE, FUNCTOR> *node)
{
delete node;
}
@@ -117,7 +117,7 @@ ACE_Timer_List_T<TYPE, FUNCTOR>::dump (void) const
template <class TYPE, class FUNCTOR> void
-ACE_Timer_List_T<TYPE, FUNCTOR>::reschedule (NODE *expired)
+ACE_Timer_List_T<TYPE, FUNCTOR>::reschedule (ACE_Timer_Node_T<TYPE, FUNCTOR> *expired)
{
ACE_TRACE ("ACE_Timer_List::reschedule");
if (this->is_empty ()
@@ -250,7 +250,7 @@ ACE_Timer_List_T<TYPE, FUNCTOR>::cancel (int timer_id,
if (dont_call == 0)
// This calls the correct operator () on the functor (the one with
// two args)
- this->upcall_functor_ (*this, curr->type_);
+ this->upcall_functor_.operator () (*this, curr->type_);
this->free_node (curr);
return 1;
}
@@ -283,7 +283,7 @@ ACE_Timer_List_T<TYPE, FUNCTOR>::cancel (const TYPE &type,
&& number_of_cancellations == 1)
// This calls the correct operator () on the functor (the one with
// two args)
- this->upcall_functor_ (*this, curr->type_);
+ this->upcall_functor_.operator () (*this, curr->type_);
if (prev == 0)
{
this->head_ = curr->next_;
diff --git a/ace/Timer_Queue.cpp b/ace/Timer_Queue.cpp
index 77a0b274f02..6ae40a409e9 100644
--- a/ace/Timer_Queue.cpp
+++ b/ace/Timer_Queue.cpp
@@ -38,7 +38,7 @@ ACE_Timer_Node_T<TYPE, FUNCTOR>::ACE_Timer_Node_T (const TYPE &type,
const void *a,
const ACE_Time_Value &t,
const ACE_Time_Value &i,
- NODE *n,
+ ACE_Timer_Node_T<TYPE, FUNCTOR> *n,
int timer_id)
: type_ (type),
act_ (a),
@@ -118,9 +118,9 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR>::dump (void) const
template <class TYPE, class FUNCTOR>
ACE_Timer_Queue_T<TYPE, FUNCTOR>::ACE_Timer_Queue_T (FUNCTOR *upcall_functor)
: gettimeofday_ (ACE_OS::gettimeofday),
- timer_skew_ (0, ACE_TIMER_SKEW),
upcall_functor_ (upcall_functor == 0 ? *(new FUNCTOR) : *upcall_functor),
- delete_upcall_functor_ (upcall_functor == 0)
+ delete_upcall_functor_ (upcall_functor == 0),
+ timer_skew_ (0, ACE_TIMER_SKEW)
{
ACE_TRACE ("ACE_Timer_Queue::ACE_Timer_Queue");
}
@@ -194,7 +194,7 @@ ACE_Timer_Queue_T<TYPE, FUNCTOR>::upcall (TYPE &type,
{
// This calls the correct operator () on the functor (the one with
// four args)
- this->upcall_functor_ (*this, type, act, cur_time);
+ this->upcall_functor_.operator () (*this, type, act, cur_time);
}
diff --git a/ace/Timers.cpp b/ace/Timers.cpp
index 1d845200ee2..1a406dcd423 100644
--- a/ace/Timers.cpp
+++ b/ace/Timers.cpp
@@ -20,8 +20,30 @@ int
ACE_Event_Handler_Handle_Timeout_Upcall::operator () (TIMER_QUEUE &timer_queue,
ACE_Event_Handler *handler)
{
+ ACE_UNUSED_ARG (timer_queue);
+
// Upcall to the <handler>s handle_close method
handler->handle_close (ACE_INVALID_HANDLE,
ACE_Event_Handler::TIMER_MASK);
return 0;
}
+
+#if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION)
+
+template class ACE_Unbounded_Set<ACE_Timer_Node_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall> *>;
+template class ACE_Unbounded_Set_Iterator<ACE_Timer_Node_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall> *>;
+template class ACE_Set_Node<ACE_Timer_Node_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall> *>;
+
+template class ACE_Timer_Node_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall>;
+
+template class ACE_Timer_Queue_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall>;
+template class ACE_Timer_Queue_Iterator_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall>;
+
+template class ACE_Timer_List_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall>;
+template class ACE_Timer_List_Iterator_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall>;
+
+template class ACE_Timer_Heap_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall>;
+template class ACE_Timer_Heap_Iterator_T<ACE_Event_Handler *, ACE_Event_Handler_Handle_Timeout_Upcall>;
+
+#endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */
+