3 // $Id: Timer_Queue_T.inl 80826 2008-03-04 14:51:23Z wotte $
5 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
7 template <class TYPE> ACE_INLINE void
8 ACE_Timer_Node_T<TYPE>::set (const TYPE &type,
10 const ACE_Time_Value &t,
11 const ACE_Time_Value &i,
12 ACE_Timer_Node_T<TYPE> *n,
17 this->timer_value_ = t;
20 this->timer_id_ = timer_id;
23 template <class TYPE> ACE_INLINE void
24 ACE_Timer_Node_T<TYPE>::set (const TYPE &type,
26 const ACE_Time_Value &t,
27 const ACE_Time_Value &i,
28 ACE_Timer_Node_T<TYPE> *p,
29 ACE_Timer_Node_T<TYPE> *n,
34 this->timer_value_ = t;
38 this->timer_id_ = timer_id;
41 template <class TYPE> ACE_INLINE TYPE &
42 ACE_Timer_Node_T<TYPE>::get_type (void)
47 template <class TYPE> ACE_INLINE void
48 ACE_Timer_Node_T<TYPE>::set_type (TYPE &type)
53 template <class TYPE> ACE_INLINE const void *
54 ACE_Timer_Node_T<TYPE>::get_act (void)
59 template <class TYPE> ACE_INLINE void
60 ACE_Timer_Node_T<TYPE>::set_act (void *act)
65 template <class TYPE> ACE_INLINE const ACE_Time_Value &
66 ACE_Timer_Node_T<TYPE>::get_timer_value (void) const
68 return this->timer_value_;
71 template <class TYPE> ACE_INLINE void
72 ACE_Timer_Node_T<TYPE>::set_timer_value (const ACE_Time_Value &timer_value)
74 this->timer_value_ = timer_value;
77 template <class TYPE> ACE_INLINE const ACE_Time_Value &
78 ACE_Timer_Node_T<TYPE>::get_interval (void) const
80 return this->interval_;
83 template <class TYPE> ACE_INLINE void
84 ACE_Timer_Node_T<TYPE>::set_interval (const ACE_Time_Value &interval)
86 this->interval_ = interval;
89 template <class TYPE> ACE_INLINE ACE_Timer_Node_T<TYPE> *
90 ACE_Timer_Node_T<TYPE>::get_prev (void)
95 template <class TYPE> ACE_INLINE void
96 ACE_Timer_Node_T<TYPE>::set_prev (ACE_Timer_Node_T<TYPE> *prev)
101 template <class TYPE> ACE_INLINE ACE_Timer_Node_T<TYPE> *
102 ACE_Timer_Node_T<TYPE>::get_next (void)
107 template <class TYPE> ACE_INLINE void
108 ACE_Timer_Node_T<TYPE>::set_next (ACE_Timer_Node_T<TYPE> *next)
113 template <class TYPE> ACE_INLINE long
114 ACE_Timer_Node_T<TYPE>::get_timer_id (void) const
116 return this->timer_id_;
119 template <class TYPE> ACE_INLINE void
120 ACE_Timer_Node_T<TYPE>::set_timer_id (long timer_id)
122 this->timer_id_ = timer_id;
125 template <class TYPE> ACE_INLINE void
126 ACE_Timer_Node_T<TYPE>::get_dispatch_info (ACE_Timer_Node_Dispatch_Info_T<TYPE> &info)
129 info.type_ = this->type_;
130 info.act_ = this->act_;
131 info.recurring_timer_ =
132 this->interval_ > ACE_Time_Value::zero;
135 template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE void
136 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::timer_skew (const ACE_Time_Value &skew)
141 template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE const ACE_Time_Value &
142 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::timer_skew (void) const
147 template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE int
148 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::expire (void)
150 if (!this->is_empty ())
151 return this->expire (this->gettimeofday () + timer_skew_);
156 template <class TYPE, class FUNCTOR, class ACE_LOCK> int
157 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::dispatch_info (const ACE_Time_Value &cur_time,
158 ACE_Timer_Node_Dispatch_Info_T<TYPE> &info)
160 ACE_TRACE ("ACE_Timer_Queue_T::dispatch_info");
161 ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, 0));
163 return this->dispatch_info_i (cur_time, info);
166 template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE void
167 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::upcall (ACE_Timer_Node_Dispatch_Info_T<TYPE> &info,
168 const ACE_Time_Value &cur_time)
170 this->upcall_functor ().timeout (*this,
173 info.recurring_timer_,
177 template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE void
178 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::preinvoke (ACE_Timer_Node_Dispatch_Info_T<TYPE> &info,
179 const ACE_Time_Value &cur_time,
180 const void *&upcall_act)
182 this->upcall_functor ().preinvoke (*this,
185 info.recurring_timer_,
190 template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE void
191 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::postinvoke (ACE_Timer_Node_Dispatch_Info_T<TYPE> &info,
192 const ACE_Time_Value &cur_time,
193 const void *upcall_act)
195 this->upcall_functor ().postinvoke (*this,
198 info.recurring_timer_,
203 template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE ACE_Time_Value
204 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::gettimeofday (void)
206 // Invoke gettimeofday via pointer to function.
207 return this->gettimeofday_ ();
210 template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE void
211 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::gettimeofday (ACE_Time_Value (*gettimeofday)(void))
213 this->gettimeofday_ = gettimeofday;
216 template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE FUNCTOR &
217 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::upcall_functor (void)
219 return *this->upcall_functor_;
222 ACE_END_VERSIONED_NAMESPACE_DECL