ACE_Unbounded_Queue_Iterator< T > Class Template Reference

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

#include <Unbounded_Queue.h>

List of all members.

Public Member Functions

 ACE_Unbounded_Queue_Iterator (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.

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


Detailed Description

template<class T>
class ACE_Unbounded_Queue_Iterator< T >

Implement an iterator over an unbounded queue.

Definition at line 38 of file Unbounded_Queue.h.


Constructor & Destructor Documentation

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

Definition at line 388 of file Unbounded_Queue.cpp.

00389   : current_ (end == 0 ? q.head_->next_ : q.head_ ),
00390     queue_ (q)
00391 {
00392   // ACE_TRACE ("ACE_Unbounded_Queue_Iterator<T>::ACE_Unbounded_Queue_Iterator");
00393 }


Member Function Documentation

template<class T>
int ACE_Unbounded_Queue_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 396 of file Unbounded_Queue.cpp.

Referenced by ACE_Select_Reactor_Notify::close(), ACE_Dev_Poll_Reactor_Notify::close(), ACE_ARGV_T< CHAR_TYPE >::create_buf_from_queue(), ACE_Unbounded_Queue< T >::dump(), ACE_Stats::mean(), ACE_Service_Gestalt::process_commandline_directives(), ACE_Service_Gestalt::process_directives(), and ACE_Stats::std_dev().

00397 {
00398   // ACE_TRACE ("ACE_Unbounded_Queue_Iterator<T>::advance");
00399   this->current_ = this->current_->next_;
00400   return this->current_ != this->queue_.head_;
00401 }

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

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

Definition at line 412 of file Unbounded_Queue.cpp.

References ACE_TRACE.

Referenced by ACE_ARGV_T< CHAR_TYPE >::create_buf_from_queue(), ACE_Stats::mean(), and ACE_Stats::std_dev().

00413 {
00414   ACE_TRACE ("ACE_Unbounded_Queue_Iterator<T>::done");
00415 
00416   return this->current_ == this->queue_.head_;
00417 }

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

Dump the state of an object.

Definition at line 380 of file Unbounded_Queue.cpp.

00381 {
00382 #if defined (ACE_HAS_DUMP)
00383   // ACE_TRACE ("ACE_Unbounded_Queue_Iterator<T>::dump");
00384 #endif /* ACE_HAS_DUMP */
00385 }

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

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

Definition at line 404 of file Unbounded_Queue.cpp.

00405 {
00406   // ACE_TRACE ("ACE_Unbounded_Queue_Iterator<T>::first");
00407   this->current_ = this->queue_.head_->next_;
00408   return this->current_ != this->queue_.head_;
00409 }

template<class T>
int ACE_Unbounded_Queue_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 420 of file Unbounded_Queue.cpp.

Referenced by ACE_Select_Reactor_Notify::close(), ACE_Dev_Poll_Reactor_Notify::close(), ACE_ARGV_T< CHAR_TYPE >::create_buf_from_queue(), ACE_Unbounded_Queue< T >::dump(), ACE_Stats::mean(), ACE_Service_Gestalt::process_commandline_directives(), ACE_Service_Gestalt::process_directives(), and ACE_Stats::std_dev().

00421 {
00422   // ACE_TRACE ("ACE_Unbounded_Queue_Iterator<T>::next");
00423   if (this->current_ == this->queue_.head_)
00424     return 0;
00425   else
00426     {
00427       item = &this->current_->item_;
00428       return 1;
00429     }
00430 }


Member Data Documentation

template<class T>
ACE_Unbounded_Queue_Iterator< T >::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 65 of file Unbounded_Queue.h.

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

Pointer to the current node in the iteration.

Definition at line 69 of file Unbounded_Queue.h.

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

Pointer to the queue we're iterating over.

Definition at line 72 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