Public Types | Public Member Functions | Private Attributes

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.

{
  ACE_TRACE ("ACE_Timer_Node_T::ACE_Timer_Node_T");
}

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

Destructor.

Definition at line 60 of file Timer_Queue_T.cpp.

{
  ACE_TRACE ("ACE_Timer_Node_T::~ACE_Timer_Node_T");
}


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.

{
#if defined (ACE_HAS_DUMP)
  ACE_TRACE ("ACE_Timer_Node_T::dump");
  ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
  ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nact_ = %x"), this->act_));
  this->timer_value_.dump ();
  this->interval_.dump ();
  ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nprev_ = %x"), this->prev_));
  ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\nnext_ = %x"), this->next_));
  ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntimer_id_ = %d\n"), this->timer_id_));
  ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP));
#endif /* ACE_HAS_DUMP */
}

template<class TYPE >
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.

{
  return this->act_;
}

template<class TYPE >
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.

{
  // Yes, do a copy
  info.type_ = this->type_;
  info.act_  = this->act_;
  info.recurring_timer_ =
    this->interval_ > ACE_Time_Value::zero;
}

template<class TYPE >
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.

{
  return this->interval_;
}

template<class TYPE >
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.

{
  return this->next_;
}

template<class TYPE >
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.

{
  return this->prev_;
}

template<class TYPE >
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.

{
  return this->timer_id_;
}

template<class TYPE >
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.

{
  return this->timer_value_;
}

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

Get the type.

Definition at line 42 of file Timer_Queue_T.inl.

{
  return this->type_;
}

template<class TYPE >
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.

{
  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<class TYPE >
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.

{
  this->type_ = type;
  this->act_ = a;
  this->timer_value_ = t;
  this->interval_ = i;
  this->next_ = n;
  this->timer_id_ = timer_id;
}

template<class TYPE >
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.

{
  this->act_ = act;
}

template<class TYPE >
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.

{
  this->interval_ = interval;
}

template<class TYPE >
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.

{
  this->next_ = next;
}

template<class TYPE >
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.

{
  this->prev_ = prev;
}

template<class TYPE >
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.

{
  this->timer_id_ = timer_id;
}

template<class TYPE >
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.

{
  this->timer_value_ = timer_value;
}

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

Set the type.

Definition at line 48 of file Timer_Queue_T.inl.

{
  this->type_ = type;
}


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.

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.

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.

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.

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.

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.

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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines