ACE_Unbounded_Queue_Const_Iterator< T > Class Template Reference

Implement an iterator over an const unbounded queue. More...

#include <Unbounded_Queue.h>

List of all members.

Public Member Functions

 ACE_Unbounded_Queue_Const_Iterator (const ACE_Unbounded_Queue< T > &q, int end=0)
int next (T *&next_item)
int advance (void)
int first (void)
int done (void) const
 Returns 1 when all items have been seen, else 0.

void dump (void) const
 Dump the state of an object.


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.


Private Attributes

ACE_Node< T > * current_
 Pointer to the current node in the iteration.

const ACE_Unbounded_Queue<
T > & 
queue_
 Pointer to the queue we're iterating over.


Detailed Description

template<class T>
class ACE_Unbounded_Queue_Const_Iterator< T >

Implement an iterator over an const unbounded queue.

Definition at line 81 of file Unbounded_Queue.h.


Constructor & Destructor Documentation

template<class T>
ACE_Unbounded_Queue_Const_Iterator< T >::ACE_Unbounded_Queue_Const_Iterator const ACE_Unbounded_Queue< T > &  q,
int  end = 0
 

Definition at line 333 of file Unbounded_Queue.cpp.

00334   : current_ (end == 0 ? q.head_->next_ : q.head_ ),
00335     queue_ (q)
00336 {
00337   // ACE_TRACE ("ACE_Unbounded_Queue_Const_Iterator<T>::ACE_Unbounded_Queue_Const_Iterator");
00338 }


Member Function Documentation

template<class T>
int ACE_Unbounded_Queue_Const_Iterator< T >::advance void   ) 
 

Move forward by one element in the set. Returns 0 when all the items in the queue have been seen, else 1.

Definition at line 341 of file Unbounded_Queue.cpp.

00342 {
00343   // ACE_TRACE ("ACE_Unbounded_Queue_Const_Iterator<T>::advance");
00344   this->current_ = this->current_->next_;
00345   return this->current_ != this->queue_.head_;
00346 }

template<class T>
int ACE_Unbounded_Queue_Const_Iterator< T >::done void   )  const
 

Returns 1 when all items have been seen, else 0.

Definition at line 357 of file Unbounded_Queue.cpp.

References ACE_TRACE.

00358 {
00359   ACE_TRACE ("ACE_Unbounded_Queue_Const_Iterator<T>::done");
00360 
00361   return this->current_ == this->queue_.head_;
00362 }

template<class T>
void ACE_Unbounded_Queue_Const_Iterator< T >::dump void   )  const
 

Dump the state of an object.

Definition at line 325 of file Unbounded_Queue.cpp.

00326 {
00327 #if defined (ACE_HAS_DUMP)
00328   // ACE_TRACE ("ACE_Unbounded_Queue_Const_Iterator<T>::dump");
00329 #endif /* ACE_HAS_DUMP */
00330 }

template<class T>
int ACE_Unbounded_Queue_Const_Iterator< T >::first void   ) 
 

Move to the first element in the queue. Returns 0 if the queue is empty, else 1.

Definition at line 349 of file Unbounded_Queue.cpp.

00350 {
00351   // ACE_TRACE ("ACE_Unbounded_Queue_Const_Iterator<T>::first");
00352   this->current_ = this->queue_.head_->next_;
00353   return this->current_ != this->queue_.head_;
00354 }

template<class T>
int ACE_Unbounded_Queue_Const_Iterator< T >::next T *&  next_item  ) 
 

Pass back the next_item that hasn't been seen in the queue. Returns 0 when all items have been seen, else 1.

Definition at line 365 of file Unbounded_Queue.cpp.

00366 {
00367   // ACE_TRACE ("ACE_Unbounded_Queue_Const_Iterator<T>::next");
00368   if (this->current_ == this->queue_.head_)
00369     return 0;
00370   else
00371     {
00372       item = &this->current_->item_;
00373       return 1;
00374     }
00375 }


Member Data Documentation

template<class T>
ACE_Unbounded_Queue_Const_Iterator< T >::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 108 of file Unbounded_Queue.h.

template<class T>
ACE_Node<T>* ACE_Unbounded_Queue_Const_Iterator< T >::current_ [private]
 

Pointer to the current node in the iteration.

Definition at line 112 of file Unbounded_Queue.h.

template<class T>
const ACE_Unbounded_Queue<T>& ACE_Unbounded_Queue_Const_Iterator< T >::queue_ [private]
 

Pointer to the queue we're iterating over.

Definition at line 115 of file Unbounded_Queue.h.


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:32:10 2006 for ACE by doxygen 1.3.6