Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Timer_Queue_T.i

Go to the documentation of this file.
00001 // $Id: Timer_Queue_T.i,v 1.1.1.2 2001/12/04 14:33:10 chad Exp $
00002 
00003 /* -*- C++ -*- */
00004 
00005 template <class TYPE> ACE_INLINE void
00006 ACE_Timer_Node_T<TYPE>::set (const TYPE &type,
00007                              const void *a,
00008                              const ACE_Time_Value &t,
00009                              const ACE_Time_Value &i,
00010                              ACE_Timer_Node_T<TYPE> *n,
00011                              long timer_id)
00012 {
00013   this->type_ = type;
00014   this->act_ = a;
00015   this->timer_value_ = t;
00016   this->interval_ = i;
00017   this->next_ = n;
00018   this->timer_id_ = timer_id;
00019 }
00020 
00021 template <class TYPE> ACE_INLINE void
00022 ACE_Timer_Node_T<TYPE>::set (const TYPE &type,
00023                              const void *a,
00024                              const ACE_Time_Value &t,
00025                              const ACE_Time_Value &i,
00026                              ACE_Timer_Node_T<TYPE> *p,
00027                              ACE_Timer_Node_T<TYPE> *n,
00028                              long timer_id)
00029 {
00030   this->type_ = type;
00031   this->act_ = a;
00032   this->timer_value_ = t;
00033   this->interval_ = i;
00034   this->prev_ = p;
00035   this->next_ = n;
00036   this->timer_id_ = timer_id;
00037 }
00038 
00039 template <class TYPE> ACE_INLINE TYPE &
00040 ACE_Timer_Node_T<TYPE>::get_type (void)
00041 {
00042   return this->type_;
00043 }
00044 
00045 template <class TYPE> ACE_INLINE void
00046 ACE_Timer_Node_T<TYPE>::set_type (TYPE &type)
00047 {
00048   this->type_ = type;
00049 }
00050 
00051 template <class TYPE> ACE_INLINE const void *
00052 ACE_Timer_Node_T<TYPE>::get_act (void)
00053 {
00054   return this->act_;
00055 }
00056 
00057 template <class TYPE> ACE_INLINE void
00058 ACE_Timer_Node_T<TYPE>::set_act (void *act)
00059 {
00060   this->act_ = act;
00061 }
00062 
00063 template <class TYPE> ACE_INLINE const ACE_Time_Value &
00064 ACE_Timer_Node_T<TYPE>::get_timer_value (void) const
00065 {
00066   return this->timer_value_;
00067 }
00068 
00069 template <class TYPE> ACE_INLINE void
00070 ACE_Timer_Node_T<TYPE>::set_timer_value (const ACE_Time_Value &timer_value)
00071 {
00072   this->timer_value_ = timer_value;
00073 }
00074 
00075 template <class TYPE> ACE_INLINE const ACE_Time_Value &
00076 ACE_Timer_Node_T<TYPE>::get_interval (void) const
00077 {
00078   return this->interval_;
00079 }
00080 
00081 template <class TYPE> ACE_INLINE void
00082 ACE_Timer_Node_T<TYPE>::set_interval (const ACE_Time_Value &interval)
00083 {
00084   this->interval_ = interval;
00085 }
00086 
00087 template <class TYPE> ACE_INLINE ACE_Timer_Node_T<TYPE> *
00088 ACE_Timer_Node_T<TYPE>::get_prev (void)
00089 {
00090   return this->prev_;
00091 }
00092 
00093 template <class TYPE> ACE_INLINE void
00094 ACE_Timer_Node_T<TYPE>::set_prev (ACE_Timer_Node_T<TYPE> *prev)
00095 {
00096   this->prev_ = prev;
00097 }
00098 
00099 template <class TYPE> ACE_INLINE ACE_Timer_Node_T<TYPE> *
00100 ACE_Timer_Node_T<TYPE>::get_next (void)
00101 {
00102   return this->next_;
00103 }
00104 
00105 template <class TYPE> ACE_INLINE void
00106 ACE_Timer_Node_T<TYPE>::set_next (ACE_Timer_Node_T<TYPE> *next)
00107 {
00108   this->next_ = next;
00109 }
00110 
00111 template <class TYPE> ACE_INLINE long
00112 ACE_Timer_Node_T<TYPE>::get_timer_id (void) const
00113 {
00114   return this->timer_id_;
00115 }
00116 
00117 template <class TYPE> ACE_INLINE void
00118 ACE_Timer_Node_T<TYPE>::set_timer_id (long timer_id)
00119 {
00120   this->timer_id_ = timer_id;
00121 }
00122 
00123 template <class TYPE> ACE_INLINE void
00124 ACE_Timer_Node_T<TYPE>::get_dispatch_info (ACE_Timer_Node_Dispatch_Info_T<TYPE> &info)
00125 {
00126   // Yes, do a copy
00127   info.type_ = this->type_;
00128   info.act_  = this->act_;
00129 }
00130 
00131 template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE void
00132 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::timer_skew (const ACE_Time_Value &skew)
00133 {
00134   timer_skew_ = skew;
00135 }
00136 
00137 template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE const ACE_Time_Value &
00138 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::timer_skew (void) const
00139 {
00140   return timer_skew_;
00141 }
00142 
00143 template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE int
00144 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::expire (void)
00145 {
00146   if (!this->is_empty ())
00147     return this->expire (this->gettimeofday () + timer_skew_);
00148   else
00149     return 0;
00150 }
00151 
00152 template <class TYPE, class FUNCTOR, class ACE_LOCK> int
00153 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::dispatch_info (const ACE_Time_Value &cur_time,
00154                                                            ACE_Timer_Node_Dispatch_Info_T<TYPE> &info)
00155 {
00156   ACE_TRACE ("ACE_Timer_Queue_T::dispatch_info");
00157   ACE_MT (ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, 0));
00158 
00159   return this->dispatch_info_i (cur_time, info);
00160 }
00161 
00162 template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE void
00163 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::upcall (TYPE &type,
00164                                                 const void *act,
00165                                                 const ACE_Time_Value &cur_time)
00166 {
00167   this->upcall_functor ().timeout (*this, type, act, cur_time);
00168 }
00169 
00170 
00171 template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE ACE_Time_Value
00172 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::gettimeofday (void)
00173 {
00174   // Invoke gettimeofday via pointer to function.
00175   return this->gettimeofday_ ();
00176 }
00177 
00178 template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE void
00179 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::gettimeofday (ACE_Time_Value (*gettimeofday)(void))
00180 {
00181   this->gettimeofday_ = gettimeofday;
00182 }
00183 
00184 template <class TYPE, class FUNCTOR, class ACE_LOCK> ACE_INLINE FUNCTOR &
00185 ACE_Timer_Queue_T<TYPE, FUNCTOR, ACE_LOCK>::upcall_functor (void)
00186 {
00187   return *this->upcall_functor_;
00188 }

Generated on Mon Jun 16 11:21:52 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002