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

ACE_Timer_Wheel_Iterator_T Class Template Reference

Iterates over an . More...

#include <Timer_Wheel_T.h>

Inheritance diagram for ACE_Timer_Wheel_Iterator_T

Inheritance graph
[legend]
Collaboration diagram for ACE_Timer_Wheel_Iterator_T:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Timer_Wheel_Iterator_T (ACE_Timer_Wheel_T<TYPE, FUNCTOR, ACE_LOCK> &)
 Constructor. More...

 ~ACE_Timer_Wheel_Iterator_T (void)
 Destructor. More...

virtual void first (void)
 Positions the iterator at the earliest node in the Timer Queue. More...

virtual void next (void)
 Positions the iterator at the next node in the Timer Queue. More...

virtual int isdone (void) const
 Returns true when there are no more nodes in the sequence. More...

virtual ACE_Timer_Node_T<TYPE>* item (void)
 Returns the node at the current position in the sequence. More...


Protected Attributes

ACE_Timer_Wheel_T<TYPE, FUNCTOR,
ACE_LOCK>& 
timer_wheel_
 Pointer to the that we are iterating over.

size_t pos_
 Current position in the timing wheel.

ACE_Timer_Node_T<TYPE>* list_item_
 Pointer to the position in the the <pos_>th list.


Detailed Description

template<class TYPE, class FUNCTOR, class ACE_LOCK> template class ACE_Timer_Wheel_Iterator_T

Iterates over an .

This is a generic iterator that can be used to visit every node of a timer queue. Be aware that it doesn't transverse in the order of timeout values.


Constructor & Destructor Documentation

template<classTYPE, classFUNCTOR, classACE_LOCK>
ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> ( ACE_Timer_Wheel_T< TYPE,FUNCTOR,ACE_LOCK >& wheel ) [inline]
 

Constructor.

Just initializes the iterator with a ACE_Timer_Wheel_T and then calls first() to initialize the rest of itself.

Parameters:
wheel   A reference for a timer queue to iterate over

template<classTYPE, classFUNCTOR, classACE_LOCK>
ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::~ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK> ( void )
 

Destructor.

Destructor, at this level does nothing.


Member Function Documentation

template<classTYPE, classFUNCTOR, classACE_LOCK>
void ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::first ( void ) [virtual]
 

Positions the iterator at the earliest node in the Timer Queue.

Positions the iterator at the first position in the timing wheel that contains something. pos_ will be set to the position of this entry and list_item_ will point to the first entry in that position. Since this is an iterator,

If the wheel is empty, pos_ will be equal timer_wheel_.wheel_size_ and list_item_ would be 0.

Reimplemented from ACE_Timer_Queue_Iterator_T.

template<classTYPE, classFUNCTOR, classACE_LOCK>
int ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::isdone ( void ) const [virtual]
 

Returns true when there are no more nodes in the sequence.

Returns:
True when we there isn't anymore items (when list_item_ == 0)

Reimplemented from ACE_Timer_Queue_Iterator_T.

template<classTYPE, classFUNCTOR, classACE_LOCK>
ACE_Timer_Node_T< TYPE >* ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::item ( void ) [virtual]
 

Returns the node at the current position in the sequence.

Returns:
The node at the current position in the sequence or 0 if the wheel is empty

Reimplemented from ACE_Timer_Queue_Iterator_T.

template<classTYPE, classFUNCTOR, classACE_LOCK>
void ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::next ( void ) [virtual]
 

Positions the iterator at the next node in the Timer Queue.

Positions the iterator at the next node in list or goes to the next list

Reimplemented from ACE_Timer_Queue_Iterator_T.


Member Data Documentation

template<classTYPE, classFUNCTOR, classACE_LOCK>
ACE_Timer_Node_T< TYPE >* ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::list_item_ [protected]
 

Pointer to the position in the the <pos_>th list.

template<classTYPE, classFUNCTOR, classACE_LOCK>
size_t ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::pos_ [protected]
 

Current position in the timing wheel.

template<classTYPE, classFUNCTOR, classACE_LOCK>
ACE_Timer_Wheel_T< TYPE,FUNCTOR,ACE_LOCK >& ACE_Timer_Wheel_Iterator_T<TYPE, FUNCTOR, ACE_LOCK>::timer_wheel_ [protected]
 

Pointer to the that we are iterating over.


The documentation for this class was generated from the following files:
Generated at Wed Nov 21 10:34:22 2001 for ACE by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000