#include <Timer_Queue_T.h>
Inheritance diagram for ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >:
Public Types | |
typedef ACE_Timer_Queue_Iterator_T< TYPE, FUNCTOR, ACE_LOCK > | ITERATOR |
Type of Iterator. | |
Public Member Functions | |
ACE_Timer_Queue_T (FUNCTOR *upcall_functor=0, ACE_Free_List< ACE_Timer_Node_T< TYPE > > *freelist=0) | |
virtual | ~ACE_Timer_Queue_T (void) |
virtual int | is_empty (void) const=0 |
True if queue is empty, else false. | |
virtual const ACE_Time_Value & | earliest_time (void) const=0 |
virtual long | schedule (const TYPE &type, const void *act, const ACE_Time_Value &future_time, const ACE_Time_Value &interval=ACE_Time_Value::zero) |
virtual int | reset_interval (long timer_id, const ACE_Time_Value &interval)=0 |
virtual int | cancel (const TYPE &type, int dont_call_handle_close=1)=0 |
virtual int | cancel (long timer_id, const void **act=0, int dont_call_handle_close=1)=0 |
virtual int | expire (const ACE_Time_Value ¤t_time) |
virtual int | dispatch_info (const ACE_Time_Value ¤t_time, ACE_Timer_Node_Dispatch_Info_T< TYPE > &info) |
int | expire (void) |
ACE_Time_Value | gettimeofday (void) |
void | gettimeofday (ACE_Time_Value(*gettimeofday)(void)) |
virtual ACE_Time_Value * | calculate_timeout (ACE_Time_Value *max) |
virtual ACE_Time_Value * | calculate_timeout (ACE_Time_Value *max, ACE_Time_Value *the_timeout) |
void | timer_skew (const ACE_Time_Value &skew) |
Set the timer skew for the Timer_Queue. | |
const ACE_Time_Value & | timer_skew (void) const |
Get the timer skew for the Timer_Queue. | |
ACE_LOCK & | mutex (void) |
Synchronization variable used by the queue. | |
FUNCTOR & | upcall_functor (void) |
Accessor to the upcall functor. | |
virtual ITERATOR & | iter (void)=0 |
Returns a pointer to this ACE_Timer_Queue's iterator. | |
virtual ACE_Timer_Node_T< TYPE > * | remove_first (void)=0 |
Removes the earliest node from the queue and returns it. | |
virtual void | dump (void) const |
Dump the state of a object. | |
virtual ACE_Timer_Node_T< TYPE > * | get_first (void)=0 |
Reads the earliest node from the queue and returns it. | |
virtual void | return_node (ACE_Timer_Node_T< TYPE > *) |
void | preinvoke (ACE_Timer_Node_Dispatch_Info_T< TYPE > &info, const ACE_Time_Value &cur_time, const void *&upcall_act) |
This method will call the preinvoke() on . | |
void | upcall (ACE_Timer_Node_Dispatch_Info_T< TYPE > &info, const ACE_Time_Value &cur_time) |
This method will call the timeout() on . | |
void | postinvoke (ACE_Timer_Node_Dispatch_Info_T< TYPE > &info, const ACE_Time_Value &cur_time, const void *upcall_act) |
This method will call the postinvoke() on . | |
Protected Member Functions | |
virtual long | schedule_i (const TYPE &type, const void *act, const ACE_Time_Value &future_time, const ACE_Time_Value &interval)=0 |
Schedule a timer. | |
virtual void | reschedule (ACE_Timer_Node_T< TYPE > *)=0 |
Reschedule an "interval" ACE_Timer_Node. | |
virtual ACE_Timer_Node_T< TYPE > * | alloc_node (void) |
Factory method that allocates a new node. | |
virtual void | free_node (ACE_Timer_Node_T< TYPE > *) |
Factory method that frees a previously allocated node. | |
virtual int | dispatch_info_i (const ACE_Time_Value ¤t_time, ACE_Timer_Node_Dispatch_Info_T< TYPE > &info) |
Non-locking version of dispatch_info (). | |
Protected Attributes | |
ACE_LOCK | mutex_ |
ACE_Free_List< ACE_Timer_Node_T< TYPE > > * | free_list_ |
Class that implements a free list. | |
ACE_Time_Value(* | gettimeofday_ )(void) |
Pointer to function that returns the current time of day. | |
FUNCTOR * | upcall_functor_ |
Upcall functor. | |
int | delete_upcall_functor_ |
To delete or not to delete is the question? | |
int | delete_free_list_ |
Flag to delete only if the class created the . | |
Private Member Functions | |
ACE_Timer_Queue_T (const ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK > &) | |
void | operator= (const ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK > &) |
Private Attributes | |
ACE_Time_Value | timeout_ |
Returned by . | |
ACE_Time_Value | timer_skew_ |
Adjusts for timer skew in various clocks. |
This is an abstract base class that provides hook for implementing specialized policies such as ACE_Timer_List and ACE_Timer_Heap.
Definition at line 207 of file Timer_Queue_T.h.
|
Type of Iterator.
Definition at line 211 of file Timer_Queue_T.h. |
|
Default constructor. is the instance of the FUNCTOR to be used by the queue. If is 0, Timer Queue will create a default FUNCTOR. the freelist of timer nodes. If 0, then a default freelist will be created. Definition at line 168 of file Timer_Queue_T.cpp. References ACE_NEW, ACE_TIMER_SKEW, ACE_TRACE, and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::upcall_functor_.
00170 : gettimeofday_ (ACE_OS::gettimeofday), 00171 delete_upcall_functor_ (upcall_functor == 0), 00172 delete_free_list_ (freelist == 0), 00173 timer_skew_ (0, ACE_TIMER_SKEW) 00174 { 00175 ACE_TRACE ("ACE_Timer_Queue_T::ACE_Timer_Queue_T"); 00176 00177 if (!freelist) 00178 ACE_NEW (free_list_, 00179 (ACE_Locked_Free_List<ACE_Timer_Node_T<TYPE>,ACE_Null_Mutex>)); 00180 else 00181 free_list_ = freelist; 00182 00183 if (!upcall_functor) 00184 ACE_NEW (upcall_functor_, 00185 FUNCTOR); 00186 else 00187 upcall_functor_ = upcall_functor; 00188 } |
|
Destructor - make virtual for proper destruction of inherited classes. Definition at line 191 of file Timer_Queue_T.cpp. References ACE_TRACE, ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::delete_free_list_, ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::delete_upcall_functor_, and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::upcall_functor_.
00192 { 00193 ACE_TRACE ("ACE_Timer_Queue_T::~ACE_Timer_Queue_T"); 00194 00195 // Cleanup the functor and free_list on the way out 00196 if (this->delete_upcall_functor_) 00197 delete this->upcall_functor_; 00198 00199 if (this->delete_free_list_) 00200 delete this->free_list_; 00201 } |
|
|
|
Factory method that allocates a new node.
Reimplemented in ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >. Definition at line 204 of file Timer_Queue_T.cpp. References ACE_Free_List< ACE_Timer_Node_T< TYPE > >::remove(). Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::schedule_i(), and ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::schedule_i().
00205 { 00206 return this->free_list_->remove (); 00207 } |
|
Determine the next event to timeout. Returns max if there are no pending timers or if all pending timers are longer than max. should be a pointer to storage for the timeout value, and this value is also returned. This method does not acquire a lock internally since it doesn't modify internal state. If you need to call this method when the queue is being modified concurrently, however, you should make sure to acquire the <mutex()> externally before making the call. Definition at line 113 of file Timer_Queue_T.cpp. References ACE_TRACE, ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::earliest_time(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::gettimeofday(), and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::is_empty().
00115 { 00116 ACE_TRACE ("ACE_Timer_Queue_T::calculate_timeout"); 00117 00118 if (the_timeout == 0) 00119 return 0; 00120 00121 if (this->is_empty ()) 00122 { 00123 // Nothing on the Timer_Queue, so use whatever the caller gave us. 00124 if (max_wait_time) 00125 *the_timeout = *max_wait_time; 00126 else 00127 return 0; 00128 } 00129 else 00130 { 00131 ACE_Time_Value cur_time = this->gettimeofday (); 00132 00133 if (this->earliest_time () > cur_time) 00134 { 00135 // The earliest item on the Timer_Queue is still in the 00136 // future. Therefore, use the smaller of (1) caller's wait 00137 // time or (2) the delta time between now and the earliest 00138 // time on the Timer_Queue. 00139 00140 *the_timeout = this->earliest_time () - cur_time; 00141 if (!(max_wait_time == 0 || *max_wait_time > *the_timeout)) 00142 *the_timeout = *max_wait_time; 00143 } 00144 else 00145 { 00146 // The earliest item on the Timer_Queue is now in the past. 00147 // Therefore, we've got to "poll" the Reactor, i.e., it must 00148 // just check the descriptors and then dispatch timers, etc. 00149 *the_timeout = ACE_Time_Value::zero; 00150 } 00151 } 00152 return the_timeout; 00153 } |
|
Determine the next event to timeout. Returns max if there are no pending timers or if all pending timers are longer than max. This method acquires a lock internally since it modifies internal state. Definition at line 76 of file Timer_Queue_T.cpp. References ACE_GUARD_RETURN, ACE_TRACE, ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::earliest_time(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::gettimeofday(), and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::is_empty().
00077 { 00078 ACE_TRACE ("ACE_Timer_Queue_T::calculate_timeout"); 00079 ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, max_wait_time)); 00080 00081 if (this->is_empty ()) 00082 // Nothing on the Timer_Queue, so use whatever the caller gave us. 00083 return max_wait_time; 00084 else 00085 { 00086 ACE_Time_Value const cur_time = this->gettimeofday (); 00087 00088 if (this->earliest_time () > cur_time) 00089 { 00090 // The earliest item on the Timer_Queue is still in the 00091 // future. Therefore, use the smaller of (1) caller's wait 00092 // time or (2) the delta time between now and the earliest 00093 // time on the Timer_Queue. 00094 00095 this->timeout_ = this->earliest_time () - cur_time; 00096 if (max_wait_time == 0 || *max_wait_time > timeout_) 00097 return &this->timeout_; 00098 else 00099 return max_wait_time; 00100 } 00101 else 00102 { 00103 // The earliest item on the Timer_Queue is now in the past. 00104 // Therefore, we've got to "poll" the Reactor, i.e., it must 00105 // just check the descriptors and then dispatch timers, etc. 00106 this->timeout_ = ACE_Time_Value::zero; 00107 return &this->timeout_; 00108 } 00109 } 00110 } |
|
Cancel the single timer that matches the value (which was returned from the method). If act is non-NULL then it will be set to point to the ``magic cookie'' argument passed in when the timer was registered. This makes it possible to free up the memory and avoid memory leaks. If is 0 then the will be invoked, which typically calls the hook. Returns 1 if cancellation succeeded and 0 if the wasn't found. Implemented in ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >, ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >, ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >, and ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >. |
|
Cancel all timer associated with . If is 0 then the will be invoked, which typically invokes the hook. Returns number of timers cancelled. Implemented in ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >, ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >, ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >, and ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >. Referenced by ACE_Select_Reactor_T< ACE_SELECT_REACTOR_TOKEN >::cancel_timer(). |
|
Get the dispatch information for a timer whose value is <= . This does not account for . Returns 1 if there is a node whose value <= else returns a 0. Definition at line 157 of file Timer_Queue_T.inl. References ACE_GUARD_RETURN, ACE_TRACE, and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::dispatch_info_i(). Referenced by ACE_TP_Reactor::handle_timer_events().
00159 { 00160 ACE_TRACE ("ACE_Timer_Queue_T::dispatch_info"); 00161 ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, 0)); 00162 00163 return this->dispatch_info_i (cur_time, info); 00164 } |
|
Non-locking version of dispatch_info ().
Reimplemented in ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >. Definition at line 288 of file Timer_Queue_T.cpp. References ACE_TRACE, ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::earliest_time(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::free_node(), ACE_Timer_Node_T< TYPE >::get_dispatch_info(), ACE_Timer_Node_T< TYPE >::get_interval(), ACE_Timer_Node_T< TYPE >::get_timer_value(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::is_empty(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::remove_first(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::reschedule(), and ACE_Timer_Node_T< TYPE >::set_timer_value(). Referenced by ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::dispatch_info(), ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >::dispatch_info_i(), and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::expire().
00290 { 00291 ACE_TRACE ("ACE_Timer_Queue_T::dispatch_info_i"); 00292 00293 if (this->is_empty ()) 00294 return 0; 00295 00296 ACE_Timer_Node_T<TYPE> *expired = 0; 00297 00298 if (this->earliest_time () <= cur_time) 00299 { 00300 expired = this->remove_first (); 00301 00302 // Get the dispatch info 00303 expired->get_dispatch_info (info); 00304 00305 // Check if this is an interval timer. 00306 if (expired->get_interval () > ACE_Time_Value::zero) 00307 { 00308 // Make sure that we skip past values that have already 00309 // "expired". 00310 do 00311 expired->set_timer_value (expired->get_timer_value () + 00312 expired->get_interval ()); 00313 while (expired->get_timer_value () <= cur_time); 00314 00315 // Since this is an interval timer, we need to reschedule 00316 // it. 00317 this->reschedule (expired); 00318 } 00319 else 00320 { 00321 // Call the factory method to free up the node. 00322 this->free_node (expired); 00323 } 00324 00325 return 1; 00326 } 00327 00328 return 0; 00329 } |
|
Dump the state of a object.
Reimplemented in ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >, ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >, ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >, and ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >. Definition at line 156 of file Timer_Queue_T.cpp. References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_TRACE, ACE_Time_Value::dump(), LM_DEBUG, and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::timer_skew_. Referenced by ACE_Select_Reactor_T< ACE_SELECT_REACTOR_TOKEN >::dump().
|
|
Returns the time of the earlier node in the Timer_Queue. Must be called on a non-empty queue. Implemented in ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >, ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >, ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >, and ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >. Referenced by ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::calculate_timeout(), and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::dispatch_info_i(). |
|
Run the for all timers whose values are <= <ACE_OS::gettimeofday>. Also accounts for . Depending on the resolution of the underlying OS the system calls like select()/poll() might return at time different than that is specified in the timeout. Suppose the OS guarantees a resolution of t ms. The timeline will look like A B | | V V |-------------|-------------|-------------|-------------| t t t t t If you specify a timeout value of A, then the timeout will not occur at A but at the next interval of the timer, which is later than that is expected. Similarly, if your timeout value is equal to B, then the timeout will occur at interval after B. Now depending upon the resolution of your timeouts and the accuracy of the timeouts needed for your application, you should set the value of . In the above case, if you want the timeout A to fire no later than A, then you should specify your to be A t. The timeout value should be specified via the macro ACE_TIMER_SKEW in your config.h file. The default value is zero. Things get interesting if the t before the timeout value B is zero i.e your timeout is less than the interval. In that case, you are almost sure of not getting the desired timeout behaviour. Maybe you should look for a better OS :-) Returns the number of timers canceled. Reimplemented in ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >, and ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >. Definition at line 148 of file Timer_Queue_T.inl. References ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::is_empty(), and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::timer_skew_. Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::expire(), and ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >::expire().
00149 { 00150 if (!this->is_empty ()) 00151 return this->expire (this->gettimeofday () + timer_skew_); 00152 else 00153 return 0; 00154 } |
|
Run the for all timers whose values are <= . This does not account for . Returns the number of timers canceled. Reimplemented in ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >, and ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >. Definition at line 252 of file Timer_Queue_T.cpp. References ACE_GUARD_RETURN, ACE_TRACE, ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::dispatch_info_i(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::is_empty(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::postinvoke(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::preinvoke(), and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::upcall().
00253 { 00254 ACE_TRACE ("ACE_Timer_Queue_T::expire"); 00255 ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); 00256 00257 // Keep looping while there are timers remaining and the earliest 00258 // timer is <= the <cur_time> passed in to the method. 00259 00260 if (this->is_empty ()) 00261 return 0; 00262 00263 int number_of_timers_expired = 0; 00264 int result = 0; 00265 00266 ACE_Timer_Node_Dispatch_Info_T<TYPE> info; 00267 00268 while ((result = this->dispatch_info_i (cur_time, 00269 info)) != 0) 00270 { 00271 const void *upcall_act = 0; 00272 00273 this->preinvoke (info, cur_time, upcall_act); 00274 00275 this->upcall (info, cur_time); 00276 00277 this->postinvoke (info, cur_time, upcall_act); 00278 00279 ++number_of_timers_expired; 00280 00281 } 00282 00283 ACE_UNUSED_ARG (result); 00284 return number_of_timers_expired; 00285 } |
|
Factory method that frees a previously allocated node.
Reimplemented in ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >. Definition at line 210 of file Timer_Queue_T.cpp. References ACE_Free_List< ACE_Timer_Node_T< TYPE > >::add(). Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::cancel_i(), ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::cancel_i(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::dispatch_info_i(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::expire(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::return_node(), ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::~ACE_Timer_List_T(), and ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::~ACE_Timer_Wheel_T().
00211 { 00212 this->free_list_->add (node); 00213 } |
|
Reads the earliest node from the queue and returns it.
Implemented in ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >, ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >, ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >, and ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >. |
|
Allows applications to control how the timer queue gets the time of day. Definition at line 211 of file Timer_Queue_T.inl. References ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::gettimeofday_.
00212 { 00213 this->gettimeofday_ = gettimeofday; 00214 } |
|
Returns the current time of day. This method allows different implementations of the timer queue to use special high resolution timers. Definition at line 204 of file Timer_Queue_T.inl. References ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::gettimeofday_. Referenced by ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >::ACE_Timer_Hash_T(), and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::calculate_timeout().
00205 { 00206 // Invoke gettimeofday via pointer to function. 00207 return this->gettimeofday_ (); 00208 } |
|
|
Returns a pointer to this ACE_Timer_Queue's iterator.
Implemented in ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >, ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >, ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >, and ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >. |
|
Synchronization variable used by the queue.
Definition at line 216 of file Timer_Queue_T.cpp.
00217 { 00218 return this->mutex_; 00219 } |
|
|
|
This method will call the postinvoke() on .
Definition at line 191 of file Timer_Queue_T.inl. References ACE_Timer_Node_Dispatch_Info_T< TYPE >::act_, ACE_Timer_Node_Dispatch_Info_T< TYPE >::recurring_timer_, ACE_Timer_Node_Dispatch_Info_T< TYPE >::type_, and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::upcall_functor(). Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::expire(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::expire(), ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >::expire(), and ACE_TP_Reactor::handle_timer_events().
00194 { 00195 this->upcall_functor ().postinvoke (*this, 00196 info.type_, 00197 info.act_, 00198 info.recurring_timer_, 00199 cur_time, 00200 upcall_act); 00201 } |
|
This method will call the preinvoke() on .
Definition at line 178 of file Timer_Queue_T.inl. References ACE_Timer_Node_Dispatch_Info_T< TYPE >::act_, ACE_Timer_Node_Dispatch_Info_T< TYPE >::recurring_timer_, ACE_Timer_Node_Dispatch_Info_T< TYPE >::type_, and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::upcall_functor(). Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::expire(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::expire(), ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >::expire(), and ACE_TP_Reactor::handle_timer_events().
00181 { 00182 this->upcall_functor ().preinvoke (*this, 00183 info.type_, 00184 info.act_, 00185 info.recurring_timer_, 00186 cur_time, 00187 upcall_act); 00188 } |
|
Removes the earliest node from the queue and returns it.
Implemented in ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >, ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >, ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >, and ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >. Referenced by ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::dispatch_info_i(). |
|
Reschedule an "interval" ACE_Timer_Node.
Implemented in ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >, ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >, ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >, and ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >. Referenced by ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::dispatch_info_i(). |
|
Resets the interval of the timer represented by to , which is specified in relative time to the current . If is equal to <ACE_Time_Value::zero>, the timer will become a non-rescheduling timer. Returns 0 if successful, -1 if not. Implemented in ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >, ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >, ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >, and ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >. |
|
Method used to return a timer node to the queue's ownership after it is returned by a method like . Definition at line 332 of file Timer_Queue_T.cpp. References ACE_GUARD, and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::free_node().
00333 { 00334 ACE_MT (ACE_GUARD (ACE_LOCK, ace_mon, this->mutex_)); 00335 this->free_node (node); 00336 } |
|
Schedule that will expire at , which is specified in absolute time. If it expires then is passed in as the value to the . If is != to <ACE_Time_Value::zero> then it is used to reschedule the automatically, using relative time to the current . This method returns a that uniquely identifies the the entry in an internal list. This can be used to cancel the timer before it expires. The cancellation ensures that are unique up to values of greater than 2 billion timers. As long as timers don't stay around longer than this there should be no problems with accidentally deleting the wrong timer. Returns -1 on failure (which is guaranteed never to be a valid ). Definition at line 222 of file Timer_Queue_T.cpp. References ACE_GUARD_RETURN, ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::schedule_i(), and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::upcall_functor().
00226 { 00227 ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, -1)); 00228 00229 // Schedule the timer. 00230 long const result = 00231 this->schedule_i (type, 00232 act, 00233 future_time, 00234 interval); 00235 00236 // Return on failure. 00237 if (result == -1) 00238 return result; 00239 00240 // Inform upcall functor of successful registration. 00241 this->upcall_functor ().registration (*this, 00242 type, 00243 act); 00244 00245 // Return result; 00246 return result; 00247 } |
|
Schedule a timer.
Implemented in ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >, ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >, ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >, and ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >. Referenced by ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::schedule(). |
|
Get the timer skew for the Timer_Queue.
Definition at line 142 of file Timer_Queue_T.inl. References ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::timer_skew_.
00143 { 00144 return timer_skew_; 00145 } |
|
Set the timer skew for the Timer_Queue.
Definition at line 136 of file Timer_Queue_T.inl. References ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::timer_skew_. Referenced by ACE_TP_Reactor::handle_timer_events().
00137 { 00138 timer_skew_ = skew; 00139 } |
|
This method will call the timeout() on .
Definition at line 167 of file Timer_Queue_T.inl. References ACE_Timer_Node_Dispatch_Info_T< TYPE >::act_, ACE_Timer_Node_Dispatch_Info_T< TYPE >::recurring_timer_, ACE_Timer_Node_Dispatch_Info_T< TYPE >::type_, and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::upcall_functor(). Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::expire(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::expire(), ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >::expire(), and ACE_TP_Reactor::handle_timer_events().
00169 { 00170 this->upcall_functor ().timeout (*this, 00171 info.type_, 00172 info.act_, 00173 info.recurring_timer_, 00174 cur_time); 00175 } |
|
|
Flag to delete only if the class created the .
Definition at line 451 of file Timer_Queue_T.h. Referenced by ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::~ACE_Timer_Queue_T(). |
|
To delete or not to delete is the question?
Definition at line 448 of file Timer_Queue_T.h. Referenced by ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::~ACE_Timer_Queue_T(). |
|
Class that implements a free list.
Definition at line 439 of file Timer_Queue_T.h. |
|
Pointer to function that returns the current time of day.
Referenced by ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::gettimeofday(). |
|
Synchronization variable for ACE_Timer_Queue.
Definition at line 436 of file Timer_Queue_T.h. |
|
Returned by .
Definition at line 456 of file Timer_Queue_T.h. |
|
Adjusts for timer skew in various clocks.
Definition at line 459 of file Timer_Queue_T.h. Referenced by ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::dump(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::expire(), and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::timer_skew(). |
|
Upcall functor.
Definition at line 445 of file Timer_Queue_T.h. Referenced by ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::ACE_Timer_Queue_T(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::upcall_functor(), and ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::~ACE_Timer_Queue_T(). |