// Timer_Queue_T.i,v 4.16 2003/07/07 23:58:33 irfan Exp /* -*- C++ -*- */ template ACE_INLINE void ACE_Timer_Node_T::set (const TYPE &type, const void *a, const ACE_Time_Value &t, const ACE_Time_Value &i, ACE_Timer_Node_T *n, long timer_id) { this->type_ = type; this->act_ = a; this->timer_value_ = t; this->interval_ = i; this->next_ = n; this->timer_id_ = timer_id; } template ACE_INLINE void ACE_Timer_Node_T::set (const TYPE &type, const void *a, const ACE_Time_Value &t, const ACE_Time_Value &i, ACE_Timer_Node_T *p, ACE_Timer_Node_T *n, long timer_id) { this->type_ = type; this->act_ = a; this->timer_value_ = t; this->interval_ = i; this->prev_ = p; this->next_ = n; this->timer_id_ = timer_id; } template ACE_INLINE TYPE & ACE_Timer_Node_T::get_type (void) { return this->type_; } template ACE_INLINE void ACE_Timer_Node_T::set_type (TYPE &type) { this->type_ = type; } template ACE_INLINE const void * ACE_Timer_Node_T::get_act (void) { return this->act_; } template ACE_INLINE void ACE_Timer_Node_T::set_act (void *act) { this->act_ = act; } template ACE_INLINE const ACE_Time_Value & ACE_Timer_Node_T::get_timer_value (void) const { return this->timer_value_; } template ACE_INLINE void ACE_Timer_Node_T::set_timer_value (const ACE_Time_Value &timer_value) { this->timer_value_ = timer_value; } template ACE_INLINE const ACE_Time_Value & ACE_Timer_Node_T::get_interval (void) const { return this->interval_; } template ACE_INLINE void ACE_Timer_Node_T::set_interval (const ACE_Time_Value &interval) { this->interval_ = interval; } template ACE_INLINE ACE_Timer_Node_T * ACE_Timer_Node_T::get_prev (void) { return this->prev_; } template ACE_INLINE void ACE_Timer_Node_T::set_prev (ACE_Timer_Node_T *prev) { this->prev_ = prev; } template ACE_INLINE ACE_Timer_Node_T * ACE_Timer_Node_T::get_next (void) { return this->next_; } template ACE_INLINE void ACE_Timer_Node_T::set_next (ACE_Timer_Node_T *next) { this->next_ = next; } template ACE_INLINE long ACE_Timer_Node_T::get_timer_id (void) const { return this->timer_id_; } template ACE_INLINE void ACE_Timer_Node_T::set_timer_id (long timer_id) { this->timer_id_ = timer_id; } template ACE_INLINE void ACE_Timer_Node_T::get_dispatch_info (ACE_Timer_Node_Dispatch_Info_T &info) { // Yes, do a copy info.type_ = this->type_; info.act_ = this->act_; info.recurring_timer_ = this->interval_ > ACE_Time_Value::zero; } template ACE_INLINE void ACE_Timer_Queue_T::timer_skew (const ACE_Time_Value &skew) { timer_skew_ = skew; } template ACE_INLINE const ACE_Time_Value & ACE_Timer_Queue_T::timer_skew (void) const { return timer_skew_; } template ACE_INLINE int ACE_Timer_Queue_T::expire (void) { if (!this->is_empty ()) return this->expire (this->gettimeofday () + timer_skew_); else return 0; } template int ACE_Timer_Queue_T::dispatch_info (const ACE_Time_Value &cur_time, ACE_Timer_Node_Dispatch_Info_T &info) { ACE_TRACE ("ACE_Timer_Queue_T::dispatch_info"); ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, 0)); return this->dispatch_info_i (cur_time, info); } template ACE_INLINE void ACE_Timer_Queue_T::upcall (ACE_Timer_Node_Dispatch_Info_T &info, const ACE_Time_Value &cur_time) { this->upcall_functor ().timeout (*this, info.type_, info.act_, info.recurring_timer_, cur_time); } template ACE_INLINE void ACE_Timer_Queue_T::preinvoke (ACE_Timer_Node_Dispatch_Info_T &info, const ACE_Time_Value &cur_time, const void *&upcall_act) { this->upcall_functor ().preinvoke (*this, info.type_, info.act_, info.recurring_timer_, cur_time, upcall_act); } template ACE_INLINE void ACE_Timer_Queue_T::postinvoke (ACE_Timer_Node_Dispatch_Info_T &info, const ACE_Time_Value &cur_time, const void *upcall_act) { this->upcall_functor ().postinvoke (*this, info.type_, info.act_, info.recurring_timer_, cur_time, upcall_act); } template ACE_INLINE ACE_Time_Value ACE_Timer_Queue_T::gettimeofday (void) { // Invoke gettimeofday via pointer to function. return this->gettimeofday_ (); } template ACE_INLINE void ACE_Timer_Queue_T::gettimeofday (ACE_Time_Value (*gettimeofday)(void)) { this->gettimeofday_ = gettimeofday; } template ACE_INLINE FUNCTOR & ACE_Timer_Queue_T::upcall_functor (void) { return *this->upcall_functor_; }