ACE_Timer_Node_T< TYPE > Class Template Reference

Maintains the state associated with a Timer entry. More...

#include <Timer_Queue_T.h>

Collaboration diagram for ACE_Timer_Node_T< TYPE >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Timer_Node_Dispatch_Info_T<
TYPE > 
DISPATCH_INFO
 Useful typedef ..

Public Member Functions

 ACE_Timer_Node_T (void)
 Default constructor.
 ~ACE_Timer_Node_T (void)
 Destructor.
void set (const TYPE &type, const void *a, const ACE_Time_Value &t, const ACE_Time_Value &i, ACE_Timer_Node_T< TYPE > *n, long timer_id)
 Singly linked list.
void set (const TYPE &type, const void *a, const ACE_Time_Value &t, const ACE_Time_Value &i, ACE_Timer_Node_T< TYPE > *p, ACE_Timer_Node_T< TYPE > *n, long timer_id)
 Doubly linked list version.
TYPE & get_type (void)
 Get the type.
void set_type (TYPE &type)
 Set the type.
const void * get_act (void)
 Get the asynchronous completion token.
void set_act (void *act)
 Set the asynchronous completion token.
const ACE_Time_Valueget_timer_value (void) const
 Get the timer value.
void set_timer_value (const ACE_Time_Value &timer_value)
 Set the timer value.
const ACE_Time_Valueget_interval (void) const
 Get the timer interval.
void set_interval (const ACE_Time_Value &interval)
 Set the timer interval.
ACE_Timer_Node_T< TYPE > * get_prev (void)
 Get the previous pointer.
void set_prev (ACE_Timer_Node_T< TYPE > *prev)
 Set the previous pointer.
ACE_Timer_Node_T< TYPE > * get_next (void)
 Get the next pointer.
void set_next (ACE_Timer_Node_T< TYPE > *next)
 Set the next pointer.
long get_timer_id (void) const
 Get the timer_id.
void set_timer_id (long timer_id)
 Set the timer_id.
void get_dispatch_info (ACE_Timer_Node_Dispatch_Info_T< TYPE > &info)
void dump (void) const
 Dump the state of an TYPE.

Private Attributes

TYPE type_
 Type of object stored in the Queue.
const void * act_
 Asynchronous completion token associated with the timer.
ACE_Time_Value timer_value_
 Time until the timer expires.
ACE_Time_Value interval_
ACE_Timer_Node_T< TYPE > * prev_
 Pointer to previous timer.
ACE_Timer_Node_T< TYPE > * next_
 Pointer to next timer.
long timer_id_
 Id of this timer (used to cancel timers before they expire).

Detailed Description

template<class TYPE>
class ACE_Timer_Node_T< TYPE >

Maintains the state associated with a Timer entry.

Definition at line 56 of file Timer_Queue_T.h.


Member Typedef Documentation

template<class TYPE>
typedef ACE_Timer_Node_Dispatch_Info_T<TYPE> ACE_Timer_Node_T< TYPE >::DISPATCH_INFO

Useful typedef ..

Definition at line 66 of file Timer_Queue_T.h.


Constructor & Destructor Documentation

template<class TYPE>
ACE_Timer_Node_T< TYPE >::ACE_Timer_Node_T ( void   ) 

Default constructor.

Definition at line 54 of file Timer_Queue_T.cpp.

References ACE_TRACE.

00055 {
00056   ACE_TRACE ("ACE_Timer_Node_T::ACE_Timer_Node_T");
00057 }

template<class TYPE>
ACE_Timer_Node_T< TYPE >::~ACE_Timer_Node_T ( void   ) 

Destructor.

Definition at line 60 of file Timer_Queue_T.cpp.

References ACE_TRACE.

00061 {
00062   ACE_TRACE ("ACE_Timer_Node_T::~ACE_Timer_Node_T");
00063 }


Member Function Documentation

template<class TYPE>
void ACE_Timer_Node_T< TYPE >::dump ( void   )  const

Dump the state of an TYPE.

Definition at line 38 of file Timer_Queue_T.cpp.

References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_TEXT, ACE_TRACE, ACE_Time_Value::dump(), ACE_Timer_Node_T< TYPE >::interval_, LM_DEBUG, and ACE_Timer_Node_T< TYPE >::timer_value_.

Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::dump().

00039 {
00040 #if defined (ACE_HAS_DUMP)
00041   ACE_TRACE ("ACE_Timer_Node_T::dump");
00042   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00043   ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nact_ = %x"), this->act_));
00044   this->timer_value_.dump ();
00045   this->interval_.dump ();
00046   ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nprev_ = %x"), this->prev_));
00047   ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nnext_ = %x"), this->next_));
00048   ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntimer_id_ = %d\n"), this->timer_id_));
00049   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00050 #endif /* ACE_HAS_DUMP */
00051 }

template<class TYPE>
ACE_INLINE const void * ACE_Timer_Node_T< TYPE >::get_act ( void   ) 

Get the asynchronous completion token.

Definition at line 54 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::act_.

Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::cancel(), ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::cancel(), ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >::cancel(), ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >::expire(), ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >::free_node(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::generate_timer_id(), and ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >::reschedule().

00055 {
00056   return this->act_;
00057 }

template<class TYPE>
ACE_INLINE void ACE_Timer_Node_T< TYPE >::get_dispatch_info ( ACE_Timer_Node_Dispatch_Info_T< TYPE > &  info  ) 

Get the dispatch info. The dispatch information is got through <info>. This form helps us in preventing allocation and deleting data along the criticl path. @TODO: We may want to have a copying version too, so that our interface will be complete..

Definition at line 126 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::act_, ACE_Timer_Node_Dispatch_Info_T< TYPE >::act_, ACE_Timer_Node_T< TYPE >::interval_, ACE_Timer_Node_Dispatch_Info_T< TYPE >::recurring_timer_, ACE_Timer_Node_T< TYPE >::type_, ACE_Timer_Node_Dispatch_Info_T< TYPE >::type_, and ACE_Time_Value::zero.

Referenced by ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::dispatch_info_i(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::expire(), and ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >::expire().

00127 {
00128   // Yes, do a copy
00129   info.type_ = this->type_;
00130   info.act_  = this->act_;
00131   info.recurring_timer_ =
00132     this->interval_ > ACE_Time_Value::zero;
00133 }

template<class TYPE>
ACE_INLINE const ACE_Time_Value & ACE_Timer_Node_T< TYPE >::get_interval ( void   )  const

Get the timer interval.

Definition at line 78 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::interval_.

Referenced by ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::dispatch_info_i(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::expire(), ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >::expire(), and ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >::reschedule().

00079 {
00080   return this->interval_;
00081 }

template<class TYPE>
ACE_INLINE ACE_Timer_Node_T< TYPE > * ACE_Timer_Node_T< TYPE >::get_next ( void   ) 

Get the next pointer.

Definition at line 102 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::next_.

Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::cancel(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::dump(), ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::dump(), ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::find_node(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::find_spoke_node(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::generate_timer_id(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::get_first_i(), ACE_Timer_Wheel_Iterator_T< TYPE, FUNCTOR, ACE_LOCK >::goto_next(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::recalc_earliest(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::schedule_i(), ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::schedule_i(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::unlink(), and ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::unlink().

00103 {
00104   return this->next_;
00105 }

template<class TYPE>
ACE_INLINE ACE_Timer_Node_T< TYPE > * ACE_Timer_Node_T< TYPE >::get_prev ( void   ) 

Get the previous pointer.

Definition at line 90 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::prev_.

Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::schedule_i(), ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::schedule_i(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::unlink(), and ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::unlink().

00091 {
00092   return this->prev_;
00093 }

template<class TYPE>
ACE_INLINE long ACE_Timer_Node_T< TYPE >::get_timer_id ( void   )  const

Get the timer_id.

Definition at line 114 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::timer_id_.

Referenced by ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >::copy(), ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::find_node(), ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >::free_node(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::generate_timer_id(), ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >::remove(), and ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >::reschedule().

00115 {
00116   return this->timer_id_;
00117 }

template<class TYPE>
ACE_INLINE const ACE_Time_Value & ACE_Timer_Node_T< TYPE >::get_timer_value ( void   )  const

Get the timer value.

Definition at line 66 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::timer_value_.

Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::cancel(), ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::dispatch_info_i(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::earliest_time(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::expire(), ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >::expire(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::recalc_earliest(), ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >::reheap_down(), ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >::reheap_up(), ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >::remove(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::remove_first_expired(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::reschedule(), ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::reschedule(), ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >::reschedule(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::schedule_i(), and ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::schedule_i().

00067 {
00068   return this->timer_value_;
00069 }

template<class TYPE>
ACE_INLINE TYPE & ACE_Timer_Node_T< TYPE >::get_type ( void   ) 

Get the type.

Definition at line 42 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::type_.

Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::cancel(), ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::cancel(), ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >::cancel(), and ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >::reschedule().

00043 {
00044   return this->type_;
00045 }

template<class TYPE>
ACE_INLINE void ACE_Timer_Node_T< TYPE >::set ( const TYPE &  type,
const void *  a,
const ACE_Time_Value t,
const ACE_Time_Value i,
ACE_Timer_Node_T< TYPE > *  p,
ACE_Timer_Node_T< TYPE > *  n,
long  timer_id 
)

Doubly linked list version.

Definition at line 24 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::act_, ACE_Timer_Node_T< TYPE >::interval_, ACE_Timer_Node_T< TYPE >::next_, ACE_Timer_Node_T< TYPE >::prev_, ACE_Timer_Node_T< TYPE >::timer_id_, ACE_Timer_Node_T< TYPE >::timer_value_, and ACE_Timer_Node_T< TYPE >::type_.

00031 {
00032   this->type_ = type;
00033   this->act_ = a;
00034   this->timer_value_ = t;
00035   this->interval_ = i;
00036   this->prev_ = p;
00037   this->next_ = n;
00038   this->timer_id_ = timer_id;
00039 }

template<class TYPE>
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE void ACE_Timer_Node_T< TYPE >::set ( const TYPE &  type,
const void *  a,
const ACE_Time_Value t,
const ACE_Time_Value i,
ACE_Timer_Node_T< TYPE > *  n,
long  timer_id 
)

Singly linked list.

Definition at line 8 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::act_, ACE_Timer_Node_T< TYPE >::interval_, ACE_Timer_Node_T< TYPE >::next_, ACE_Timer_Node_T< TYPE >::timer_id_, ACE_Timer_Node_T< TYPE >::timer_value_, and ACE_Timer_Node_T< TYPE >::type_.

Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::schedule_i(), ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::schedule_i(), and ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >::schedule_i().

00014 {
00015   this->type_ = type;
00016   this->act_ = a;
00017   this->timer_value_ = t;
00018   this->interval_ = i;
00019   this->next_ = n;
00020   this->timer_id_ = timer_id;
00021 }

template<class TYPE>
ACE_INLINE void ACE_Timer_Node_T< TYPE >::set_act ( void *  act  ) 

Set the asynchronous completion token.

Definition at line 60 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::act_.

Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::generate_timer_id().

00061 {
00062   this->act_ = act;
00063 }

template<class TYPE>
ACE_INLINE void ACE_Timer_Node_T< TYPE >::set_interval ( const ACE_Time_Value interval  ) 

Set the timer interval.

Definition at line 84 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::interval_.

Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::reset_interval(), and ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::reset_interval().

00085 {
00086   this->interval_ = interval;
00087 }

template<class TYPE>
ACE_INLINE void ACE_Timer_Node_T< TYPE >::set_next ( ACE_Timer_Node_T< TYPE > *  next  ) 

Set the next pointer.

Definition at line 108 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::next_.

Referenced by ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >::free_node(), ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >::grow_heap(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::schedule_i(), ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::schedule_i(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::unlink(), and ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::unlink().

00109 {
00110   this->next_ = next;
00111 }

template<class TYPE>
ACE_INLINE void ACE_Timer_Node_T< TYPE >::set_prev ( ACE_Timer_Node_T< TYPE > *  prev  ) 

Set the previous pointer.

Definition at line 96 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::prev_.

Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::schedule_i(), ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::schedule_i(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::unlink(), and ACE_Timer_List_T< TYPE, FUNCTOR, ACE_LOCK >::unlink().

00097 {
00098   this->prev_ = prev;
00099 }

template<class TYPE>
ACE_INLINE void ACE_Timer_Node_T< TYPE >::set_timer_id ( long  timer_id  ) 

Set the timer_id.

Definition at line 120 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::timer_id_.

Referenced by ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::generate_timer_id().

00121 {
00122   this->timer_id_ = timer_id;
00123 }

template<class TYPE>
ACE_INLINE void ACE_Timer_Node_T< TYPE >::set_timer_value ( const ACE_Time_Value timer_value  ) 

Set the timer value.

Definition at line 72 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::timer_value_.

Referenced by ACE_Timer_Queue_T< TYPE, FUNCTOR, ACE_LOCK >::dispatch_info_i(), ACE_Timer_Wheel_T< TYPE, FUNCTOR, ACE_LOCK >::expire(), and ACE_Timer_Hash_T< TYPE, FUNCTOR, ACE_LOCK, BUCKET >::expire().

00073 {
00074   this->timer_value_ = timer_value;
00075 }

template<class TYPE>
ACE_INLINE void ACE_Timer_Node_T< TYPE >::set_type ( TYPE &  type  ) 

Set the type.

Definition at line 48 of file Timer_Queue_T.inl.

References ACE_Timer_Node_T< TYPE >::type_.

00049 {
00050   this->type_ = type;
00051 }


Member Data Documentation

template<class TYPE>
const void* ACE_Timer_Node_T< TYPE >::act_ [private]

Asynchronous completion token associated with the timer.

Definition at line 144 of file Timer_Queue_T.h.

Referenced by ACE_Timer_Node_T< TYPE >::get_act(), ACE_Timer_Node_T< TYPE >::get_dispatch_info(), ACE_Timer_Node_T< TYPE >::set(), and ACE_Timer_Node_T< TYPE >::set_act().

template<class TYPE>
ACE_Time_Value ACE_Timer_Node_T< TYPE >::interval_ [private]

If this is a periodic timer this holds the time until the next timeout.

Definition at line 151 of file Timer_Queue_T.h.

Referenced by ACE_Timer_Node_T< TYPE >::dump(), ACE_Timer_Node_T< TYPE >::get_dispatch_info(), ACE_Timer_Node_T< TYPE >::get_interval(), ACE_Timer_Node_T< TYPE >::set(), and ACE_Timer_Node_T< TYPE >::set_interval().

template<class TYPE>
ACE_Timer_Node_T<TYPE>* ACE_Timer_Node_T< TYPE >::next_ [private]

Pointer to next timer.

Definition at line 157 of file Timer_Queue_T.h.

Referenced by ACE_Timer_Node_T< TYPE >::get_next(), ACE_Timer_Node_T< TYPE >::set(), and ACE_Timer_Node_T< TYPE >::set_next().

template<class TYPE>
ACE_Timer_Node_T<TYPE>* ACE_Timer_Node_T< TYPE >::prev_ [private]

Pointer to previous timer.

Definition at line 154 of file Timer_Queue_T.h.

Referenced by ACE_Timer_Node_T< TYPE >::get_prev(), ACE_Timer_Node_T< TYPE >::set(), and ACE_Timer_Node_T< TYPE >::set_prev().

template<class TYPE>
long ACE_Timer_Node_T< TYPE >::timer_id_ [private]

Id of this timer (used to cancel timers before they expire).

Definition at line 160 of file Timer_Queue_T.h.

Referenced by ACE_Timer_Node_T< TYPE >::get_timer_id(), ACE_Timer_Node_T< TYPE >::set(), and ACE_Timer_Node_T< TYPE >::set_timer_id().

template<class TYPE>
ACE_Time_Value ACE_Timer_Node_T< TYPE >::timer_value_ [private]

Time until the timer expires.

Definition at line 147 of file Timer_Queue_T.h.

Referenced by ACE_Timer_Node_T< TYPE >::dump(), ACE_Timer_Node_T< TYPE >::get_timer_value(), ACE_Timer_Node_T< TYPE >::set(), and ACE_Timer_Node_T< TYPE >::set_timer_value().

template<class TYPE>
TYPE ACE_Timer_Node_T< TYPE >::type_ [private]

Type of object stored in the Queue.

Definition at line 141 of file Timer_Queue_T.h.

Referenced by ACE_Timer_Node_T< TYPE >::get_dispatch_info(), ACE_Timer_Node_T< TYPE >::get_type(), ACE_Timer_Node_T< TYPE >::set(), and ACE_Timer_Node_T< TYPE >::set_type().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:35:48 2010 for ACE by  doxygen 1.4.7