diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-11-20 17:29:33 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-11-20 17:29:33 +0000 |
commit | 4a78a70adc3cc4bb36c32d9f9d20c8f5515078a9 (patch) | |
tree | 3e6f16f1ef3900c0e63b6c65468346212aa29cee | |
parent | 85748639bbf3180b09872febdb783cfa2f41d812 (diff) | |
download | ATCD-4a78a70adc3cc4bb36c32d9f9d20c8f5515078a9.tar.gz |
added Timer_{Heap,List}::get_first accessors
-rw-r--r-- | ace/Timer_Heap_T.cpp | 9 | ||||
-rw-r--r-- | ace/Timer_Heap_T.h | 3 | ||||
-rw-r--r-- | ace/Timer_List_T.cpp | 9 | ||||
-rw-r--r-- | ace/Timer_List_T.h | 3 |
4 files changed, 23 insertions, 1 deletions
diff --git a/ace/Timer_Heap_T.cpp b/ace/Timer_Heap_T.cpp index d94df1c2ecf..a1f0a525539 100644 --- a/ace/Timer_Heap_T.cpp +++ b/ace/Timer_Heap_T.cpp @@ -638,5 +638,12 @@ ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK>::remove_first (void) return this->remove (0); } -#endif /* ACE_TIMER_HEAP_T_C */ +template <class TYPE, class FUNCTOR, class LOCK> ACE_Timer_Node_T <TYPE> * +ACE_Timer_Heap_T<TYPE, FUNCTOR, LOCK>::get_first (void) +{ + ACE_TRACE ("ACE_Timer_Heap_T::remove_first"); + return this->cur_size_ == 0 ? 0 : this->heap_[0]; +} + +#endif /* ACE_TIMER_HEAP_T_C */ diff --git a/ace/Timer_Heap_T.h b/ace/Timer_Heap_T.h index 080bc943bfe..6fac478a7c5 100644 --- a/ace/Timer_Heap_T.h +++ b/ace/Timer_Heap_T.h @@ -152,6 +152,9 @@ public: virtual void dump (void) const; // Dump the state of an object. + virtual ACE_Timer_Node_T<TYPE> *get_first (void); + // Reads the earliest node from the queue and returns it. + protected: virtual void reschedule (ACE_Timer_Node_T<TYPE> *); // Reschedule an "interval" <ACE_Timer_Node>. diff --git a/ace/Timer_List_T.cpp b/ace/Timer_List_T.cpp index e64e13ee4e2..94ad0679d9e 100644 --- a/ace/Timer_List_T.cpp +++ b/ace/Timer_List_T.cpp @@ -275,6 +275,15 @@ ACE_Timer_List_T<TYPE, FUNCTOR, ACE_LOCK>::cancel (const TYPE &type, return number_of_cancellations; } +// Reads the first node on the list and returns it. + +template <class TYPE, class FUNCTOR, class LOCK> ACE_Timer_Node_T<TYPE> * +ACE_Timer_List_T<TYPE, FUNCTOR, LOCK>::get_first (void) +{ + ACE_TRACE ("ACE_Timer_List_T::get_first"); + + return this->head_->get_next (); +} // Removes the first node on the list and returns it. diff --git a/ace/Timer_List_T.h b/ace/Timer_List_T.h index 7cba67db318..eaec91b52e3 100644 --- a/ace/Timer_List_T.h +++ b/ace/Timer_List_T.h @@ -149,6 +149,9 @@ public: // Reschedule an "interval" <ACE_Timer_Node>. This should be private // but for now it needs to be public for <ACE_Timer_Hash_T> + virtual ACE_Timer_Node_T<TYPE> *get_first (void); + // Reads the earliest node from the queue and returns it. + protected: /* virtual ACE_Timer_Node_T<TYPE> *alloc_node (void); // Factory method that allocates a new node (uses operator new). |