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

ACE_Timer_Node_T Class Template Reference

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

#include <Timer_Queue_T.h>

Collaboration diagram for ACE_Timer_Node_T:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ACE_Timer_Node_Dispatch_Info_T<
TYPE > 
DISPATCH_INFO
 Useful typedef .. More...


Public Methods

 ACE_Timer_Node_T (void)
 Default constructor. More...

 ~ACE_Timer_Node_T (void)
 Destructor. More...

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. More...

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. More...

TYPE & get_type (void)
 Get the type. More...

void set_type (TYPE &type)
 Set the type. More...

const void * get_act (void)
 Get the asynchronous completion token. More...

void set_act (void *act)
 Set the asynchronous completion token. More...

const ACE_Time_Valueget_timer_value (void) const
 Get the timer value. More...

void set_timer_value (const ACE_Time_Value &timer_value)
 Set the timer value. More...

const ACE_Time_Valueget_interval (void) const
 Get the timer interval. More...

void set_interval (const ACE_Time_Value &interval)
 Set the timer interval. More...

ACE_Timer_Node_T< TYPE > * get_prev (void)
 Get the previous pointer. More...

void set_prev (ACE_Timer_Node_T< TYPE > *prev)
 Set the previous pointer. More...

ACE_Timer_Node_T< TYPE > * get_next (void)
 Get the next pointer. More...

void set_next (ACE_Timer_Node_T< TYPE > *next)
 Set the next pointer. More...

long get_timer_id (void) const
 Get the timer_id. More...

void set_timer_id (long timer_id)
 Set the timer_id. More...

void 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.. More...

void dump (void) const
 Dump the state of an TYPE. More...


Private Attributes

TYPE type_
 Type of object stored in the Queue. More...

const void * act_
 Asynchronous completion token associated with the timer. More...

ACE_Time_Value timer_value_
 Time until the timer expires. More...

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

ACE_Timer_Node_T< TYPE > * prev_
 Pointer to previous timer. More...

ACE_Timer_Node_T< TYPE > * next_
 Pointer to next timer. More...

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


Detailed Description

template<class TYPE>
class ACE_Timer_Node_T< TYPE >

Maintains the state associated with a Timer entry.

Definition at line 50 of file Timer_Queue_T.h.


Member Typedef Documentation

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

Useful typedef ..

Definition at line 60 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 37 of file Timer_Queue_T.cpp.

References ACE_TRACE.

00038 {
00039   ACE_TRACE ("ACE_Timer_Node_T::ACE_Timer_Node_T");
00040 }

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

Destructor.

Definition at line 43 of file Timer_Queue_T.cpp.

References ACE_TRACE.

00044 {
00045   ACE_TRACE ("ACE_Timer_Node_T::~ACE_Timer_Node_T");
00046 }


Member Function Documentation

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

Dump the state of an TYPE.

Definition at line 23 of file Timer_Queue_T.cpp.

References ACE_BEGIN_DUMP, ACE_DEBUG, ACE_END_DUMP, ACE_LIB_TEXT, ACE_TRACE, ACE_Time_Value::dump, interval_, LM_DEBUG, and timer_value_.

Referenced by ACE_Timer_Wheel_T::dump.

00024 {
00025   ACE_TRACE ("ACE_Timer_Node_T::dump");
00026   ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
00027   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nact_ = %x"), this->act_));
00028   this->timer_value_.dump ();
00029   this->interval_.dump ();
00030   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nprev_ = %x"), this->prev_));
00031   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nnext_ = %x"), this->next_));
00032   ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\ntimer_id_ = %d\n"), this->timer_id_));
00033   ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
00034 }

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

Get the asynchronous completion token.

Definition at line 52 of file Timer_Queue_T.i.

References act_.

Referenced by ACE_Timer_Wheel_T::cancel, ACE_Timer_List_T::cancel, ACE_Timer_Heap_T::cancel, ACE_Timer_Wheel_T::expire, ACE_Timer_Hash_T::expire, ACE_Timer_Wheel_T::generate_timer_id, ACE_Timer_Hash_T::reschedule, ACE_Timer_List_T::~ACE_Timer_List_T, and ACE_Timer_Wheel_T::~ACE_Timer_Wheel_T.

00053 {
00054   return this->act_;
00055 }

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 124 of file Timer_Queue_T.i.

References act_, ACE_Timer_Node_Dispatch_Info_T::act_, type_, and ACE_Timer_Node_Dispatch_Info_T::type_.

Referenced by ACE_Timer_Queue_T::dispatch_info_i.

00125 {
00126   // Yes, do a copy
00127   info.type_ = this->type_;
00128   info.act_  = this->act_;
00129 }

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 76 of file Timer_Queue_T.i.

References interval_.

Referenced by ACE_Timer_Queue_T::dispatch_info_i, ACE_Timer_Wheel_T::expire, ACE_Timer_Hash_T::expire, and ACE_Timer_Hash_T::reschedule.

00077 {
00078   return this->interval_;
00079 }

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 100 of file Timer_Queue_T.i.

References next_.

Referenced by ACE_Timer_Wheel_T::cancel, ACE_Timer_List_T::cancel, ACE_Timer_Wheel_T::dump, ACE_Timer_List_T::dump, ACE_Timer_List_T::find_node, ACE_Timer_Wheel_T::find_spoke_node, ACE_Timer_Wheel_T::generate_timer_id, ACE_Timer_Wheel_T::get_first_i, ACE_Timer_Wheel_Iterator_T::goto_next, ACE_Timer_Heap_T::grow_heap, ACE_Timer_Wheel_T::recalc_earliest, ACE_Timer_Wheel_T::schedule_i, ACE_Timer_List_T::schedule_i, ACE_Timer_Wheel_T::unlink, ACE_Timer_List_T::unlink, ACE_Timer_List_T::~ACE_Timer_List_T, and ACE_Timer_Wheel_T::~ACE_Timer_Wheel_T.

00101 {
00102   return this->next_;
00103 }

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 88 of file Timer_Queue_T.i.

References prev_.

Referenced by ACE_Timer_Wheel_T::schedule_i, ACE_Timer_List_T::schedule_i, ACE_Timer_Wheel_T::unlink, and ACE_Timer_List_T::unlink.

00089 {
00090   return this->prev_;
00091 }

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

Get the timer_id.

Definition at line 112 of file Timer_Queue_T.i.

References timer_id_.

Referenced by ACE_Timer_Heap_T::copy, ACE_Timer_Hash_T::expire, ACE_Timer_List_T::find_node, ACE_Timer_Wheel_T::find_spoke_node, ACE_Timer_Heap_T::free_node, ACE_Timer_Wheel_T::generate_timer_id, ACE_Timer_Heap_T::remove, and ACE_Timer_Heap_T::reschedule.

00113 {
00114   return this->timer_id_;
00115 }

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 64 of file Timer_Queue_T.i.

References timer_value_.

Referenced by ACE_Timer_Wheel_T::cancel, ACE_Timer_Queue_T::dispatch_info_i, ACE_Timer_Wheel_T::earliest_time, ACE_Timer_List_T::earliest_time, ACE_Timer_Hash_T::expire, ACE_Timer_Wheel_T::recalc_earliest, ACE_Timer_Heap_T::reheap_down, ACE_Timer_Heap_T::reheap_up, ACE_Timer_Heap_T::remove, ACE_Timer_Wheel_T::remove_first_expired, ACE_Timer_Wheel_T::reschedule, ACE_Timer_List_T::reschedule, ACE_Timer_Hash_T::reschedule, ACE_Timer_Wheel_T::schedule_i, and ACE_Timer_List_T::schedule_i.

00065 {
00066   return this->timer_value_;
00067 }

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

Get the type.

Definition at line 40 of file Timer_Queue_T.i.

References type_.

Referenced by ACE_Timer_Wheel_T::cancel, ACE_Timer_List_T::cancel, ACE_Timer_Heap_T::cancel, ACE_Timer_Wheel_T::cancel_i, ACE_Timer_List_T::cancel_i, ACE_Timer_Wheel_T::expire, ACE_Timer_Hash_T::expire, ACE_Timer_Hash_T::reschedule, ACE_Timer_List_T::~ACE_Timer_List_T, and ACE_Timer_Wheel_T::~ACE_Timer_Wheel_T.

00041 {
00042   return this->type_;
00043 }

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 22 of file Timer_Queue_T.i.

References act_, interval_, next_, prev_, timer_id_, timer_value_, and type_.

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 }

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 > *    n,
long    timer_id
 

Singly linked list.

Definition at line 6 of file Timer_Queue_T.i.

References act_, interval_, next_, timer_id_, timer_value_, and type_.

Referenced by ACE_Timer_Wheel_T::open_i, ACE_Timer_Wheel_T::schedule, ACE_Timer_List_T::schedule, and ACE_Timer_Heap_T::schedule.

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 }

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

Set the asynchronous completion token.

Definition at line 58 of file Timer_Queue_T.i.

References act_.

Referenced by ACE_Timer_Wheel_T::generate_timer_id.

00059 {
00060   this->act_ = act;
00061 }

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 82 of file Timer_Queue_T.i.

References interval_.

Referenced by ACE_Timer_Wheel_T::reset_interval, and ACE_Timer_List_T::reset_interval.

00083 {
00084   this->interval_ = interval;
00085 }

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 106 of file Timer_Queue_T.i.

References next_.

Referenced by ACE_Timer_Heap_T::free_node, ACE_Timer_Heap_T::grow_heap, ACE_Timer_Wheel_T::schedule_i, ACE_Timer_List_T::schedule_i, ACE_Timer_Wheel_T::unlink, and ACE_Timer_List_T::unlink.

00107 {
00108   this->next_ = next;
00109 }

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 94 of file Timer_Queue_T.i.

References prev_.

Referenced by ACE_Timer_Wheel_T::schedule_i, ACE_Timer_List_T::schedule_i, ACE_Timer_Wheel_T::unlink, and ACE_Timer_List_T::unlink.

00095 {
00096   this->prev_ = prev;
00097 }

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

Set the timer_id.

Definition at line 118 of file Timer_Queue_T.i.

References timer_id_.

Referenced by ACE_Timer_Wheel_T::generate_timer_id.

00119 {
00120   this->timer_id_ = timer_id;
00121 }

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 70 of file Timer_Queue_T.i.

References timer_value_.

Referenced by ACE_Timer_Queue_T::dispatch_info_i, ACE_Timer_Wheel_T::expire, and ACE_Timer_Hash_T::expire.

00071 {
00072   this->timer_value_ = timer_value;
00073 }

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

Set the type.

Definition at line 46 of file Timer_Queue_T.i.

References type_.

00047 {
00048   this->type_ = type;
00049 }


Member Data Documentation

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

Asynchronous completion token associated with the timer.

Definition at line 138 of file Timer_Queue_T.h.

Referenced by get_act, get_dispatch_info, set, and set_act.

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

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

Definition at line 145 of file Timer_Queue_T.h.

Referenced by dump, get_interval, set, and set_interval.

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

Pointer to next timer.

Definition at line 151 of file Timer_Queue_T.h.

Referenced by get_next, set, and set_next.

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

Pointer to previous timer.

Definition at line 148 of file Timer_Queue_T.h.

Referenced by get_prev, set, and set_prev.

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

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

Definition at line 154 of file Timer_Queue_T.h.

Referenced by get_timer_id, set, and set_timer_id.

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

Time until the timer expires.

Definition at line 141 of file Timer_Queue_T.h.

Referenced by dump, get_timer_value, set, and set_timer_value.

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

Type of object stored in the Queue.

Definition at line 135 of file Timer_Queue_T.h.

Referenced by get_dispatch_info, get_type, set, and set_type.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:58:04 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002