diff options
author | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2011-12-15 11:09:41 +0000 |
---|---|---|
committer | mcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2011-12-15 11:09:41 +0000 |
commit | 9d1004206324867a4287e99b9675d24e536fa090 (patch) | |
tree | 89d59383f294627917ee3cf054f347884a914f32 /ACE/ace/Timer_Heap_T.h | |
parent | b8d69007a4e25977f11cc3de8eb3793c0c61161a (diff) | |
download | ATCD-9d1004206324867a4287e99b9675d24e536fa090.tar.gz |
Thu Dec 15 11:00:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
Merged timer_policy branch.
Diffstat (limited to 'ACE/ace/Timer_Heap_T.h')
-rw-r--r-- | ACE/ace/Timer_Heap_T.h | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/ACE/ace/Timer_Heap_T.h b/ACE/ace/Timer_Heap_T.h index 00c128b1aa9..c1e4e83d368 100644 --- a/ACE/ace/Timer_Heap_T.h +++ b/ACE/ace/Timer_Heap_T.h @@ -26,7 +26,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL // Forward declaration -template <class TYPE, class FUNCTOR, class ACE_LOCK> +template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY> class ACE_Timer_Heap_T; /** @@ -38,15 +38,16 @@ class ACE_Timer_Heap_T; * node of a timer queue. Be aware that it doesn't transverse * in the order of timeout values. */ -template <class TYPE, class FUNCTOR, class ACE_LOCK> -class ACE_Timer_Heap_Iterator_T : public ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> +template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY = ACE_Default_Time_Policy> +class ACE_Timer_Heap_Iterator_T : public ACE_Timer_Queue_Iterator_T<TYPE> { public: + typedef ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY> Heap; /// Constructor. - ACE_Timer_Heap_Iterator_T (ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK> &); + ACE_Timer_Heap_Iterator_T (Heap &); /// Destructor. - ~ACE_Timer_Heap_Iterator_T (void); + virtual ~ACE_Timer_Heap_Iterator_T (void); /// Positions the iterator at the earliest node in the Timer Queue virtual void first (void); @@ -62,7 +63,7 @@ public: protected: /// Pointer to the ACE_Timer_Heap that we are iterating over. - ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK> &timer_heap_; + Heap & timer_heap_; /// Position in the array where the iterator is at size_t position_; @@ -82,14 +83,14 @@ protected: * dynamic memory allocation, which is important for real-time * systems. */ -template <class TYPE, class FUNCTOR, class ACE_LOCK> -class ACE_Timer_Heap_T : public ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK> +template <class TYPE, class FUNCTOR, class ACE_LOCK, typename TIME_POLICY = ACE_Default_Time_Policy> +class ACE_Timer_Heap_T : public ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY> { public: - typedef ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> HEAP_ITERATOR; - friend class ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>; + typedef ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY> HEAP_ITERATOR; + friend class ACE_Timer_Heap_Iterator_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY>; - typedef ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK> INHERITED; + typedef ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK, TIME_POLICY> Base_Time_Policy; // = Initialization and termination methods. /** @@ -109,7 +110,8 @@ public: ACE_Timer_Heap_T (size_t size, bool preallocated = false, FUNCTOR *upcall_functor = 0, - ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0); + ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0, + TIME_POLICY const & time_policy = TIME_POLICY()); /** * Default constructor. @c upcall_functor is the instance of the @@ -119,7 +121,8 @@ public: * size will be ACE_DEFAULT_TIMERS and there will be no preallocation. */ ACE_Timer_Heap_T (FUNCTOR *upcall_functor = 0, - ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0); + ACE_Free_List<ACE_Timer_Node_T <TYPE> > *freelist = 0, + TIME_POLICY const & time_policy = TIME_POLICY()); /// Destructor. virtual ~ACE_Timer_Heap_T (void); @@ -163,7 +166,7 @@ public: int dont_call_handle_close = 1); /// Returns a pointer to this ACE_Timer_Queue's iterator. - virtual ACE_Timer_Queue_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> &iter (void); + virtual ACE_Timer_Queue_Iterator_T<TYPE> &iter (void); /** * Removes the earliest node from the queue and returns it. Note that @@ -318,10 +321,6 @@ private: /// Set of pointers to the arrays of preallocated timer nodes. /// Used to delete the allocated memory when required. ACE_Unbounded_Set<ACE_Timer_Node_T<TYPE> *> preallocated_node_set_; - - // = Don't allow these operations for now. - ACE_UNIMPLEMENTED_FUNC (ACE_Timer_Heap_T (const ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK> &)) - ACE_UNIMPLEMENTED_FUNC (void operator= (const ACE_Timer_Heap_T<TYPE, FUNCTOR, ACE_LOCK> &)) }; ACE_END_VERSIONED_NAMESPACE_DECL |