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

ACE_Unbounded_Set_Const_Iterator Class Template Reference

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

#include <Unbounded_Set.h>

Collaboration diagram for ACE_Unbounded_Set_Const_Iterator:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Unbounded_Set_Const_Iterator (const ACE_Unbounded_Set< T > &s, int end=0)
int next (T *&next_item)
 Pass back the <next_item> that hasn't been seen in the Set. Returns 0 when all items have been seen, else 1. More...

int advance (void)
 Move forward by one element in the set. Returns 0 when all the items in the set have been seen, else 1. More...

int first (void)
 Move to the first element in the set. Returns 0 if the set is empty, else 1. More...

int done (void) const
 Returns 1 when all items have been seen, else 0. More...

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

ACE_Unbounded_Set_Const_Iterator<
T > 
operator++ (int)
 Postfix advance. More...

ACE_Unbounded_Set_Const_Iterator<
T > & 
operator++ (void)
 Prefix advance. More...

T & operator * (void)
 Returns a reference to the internal element <this> is pointing to. More...

int operator== (const ACE_Unbounded_Set_Const_Iterator< T > &) const
 Check if two iterators point to the same position. More...

int operator!= (const ACE_Unbounded_Set_Const_Iterator< T > &) const

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Private Attributes

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

const ACE_Unbounded_Set< T > * set_
 Pointer to the set we're iterating over. More...


Detailed Description

template<class T>
class ACE_Unbounded_Set_Const_Iterator< T >

Implement an const iterator over an unbounded set.

Definition at line 90 of file Unbounded_Set.h.


Constructor & Destructor Documentation

template<class T>
ACE_Unbounded_Set_Const_Iterator< T >::ACE_Unbounded_Set_Const_Iterator const ACE_Unbounded_Set< T > &    s,
int    end = 0
 

Definition at line 363 of file Unbounded_Set.cpp.

00364   : current_ (end == 0 ? s.head_->next_ : s.head_ ),
00365     set_ (&s)
00366 {
00367   // ACE_TRACE ("ACE_Unbounded_Set_Const_Iterator<T>::ACE_Unbounded_Set_Const_Iterator");
00368 }


Member Function Documentation

template<class T>
int ACE_Unbounded_Set_Const_Iterator< T >::advance void   
 

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

Definition at line 371 of file Unbounded_Set.cpp.

References current_, and set_.

Referenced by operator++.

00372 {
00373   // ACE_TRACE ("ACE_Unbounded_Set_Const_Iterator<T>::advance");
00374   this->current_ = this->current_->next_;
00375   return this->current_ != this->set_->head_;
00376 }

template<class T>
int ACE_Unbounded_Set_Const_Iterator< T >::done void    const
 

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

Definition at line 387 of file Unbounded_Set.cpp.

References ACE_TRACE, current_, and set_.

00388 {
00389   ACE_TRACE ("ACE_Unbounded_Set_Const_Iterator<T>::done");
00390 
00391   return this->current_ == this->set_->head_;
00392 }

template<class T>
void ACE_Unbounded_Set_Const_Iterator< T >::dump void    const
 

Dump the state of an object.

Definition at line 357 of file Unbounded_Set.cpp.

00358 {
00359   // ACE_TRACE ("ACE_Unbounded_Set_Const_Iterator<T>::dump");
00360 }

template<class T>
int ACE_Unbounded_Set_Const_Iterator< T >::first void   
 

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

Definition at line 379 of file Unbounded_Set.cpp.

References current_, and set_.

00380 {
00381   // ACE_TRACE ("ACE_Unbounded_Set_Const_Iterator<T>::first");
00382   this->current_ = this->set_->head_->next_;
00383   return this->current_ != this->set_->head_;
00384 }

template<class T>
int ACE_Unbounded_Set_Const_Iterator< T >::next T *&    next_item
 

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

Definition at line 395 of file Unbounded_Set.cpp.

References current_, and set_.

Referenced by operator *.

00396 {
00397   // ACE_TRACE ("ACE_Unbounded_Set_Const_Iterator<T>::next");
00398   if (this->current_ == this->set_->head_)
00399     return 0;
00400   else
00401     {
00402       item = &this->current_->item_;
00403       return 1;
00404     }
00405 }

template<class T>
T & ACE_Unbounded_Set_Const_Iterator< T >::operator * void   
 

Returns a reference to the internal element <this> is pointing to.

Definition at line 431 of file Unbounded_Set.cpp.

References ACE_ASSERT, and next.

00432 {
00433   //ACE_TRACE ("ACE_Unbounded_Set_Const_Iterator<T>::operator*");
00434   T *retv = 0;
00435 
00436   int result = this->next (retv);
00437   ACE_ASSERT (result != 0);
00438   ACE_UNUSED_ARG (result);
00439 
00440   return *retv;
00441 }

template<class T>
int ACE_Unbounded_Set_Const_Iterator< T >::operator!= const ACE_Unbounded_Set_Const_Iterator< T > &    const
 

template<class T>
ACE_Unbounded_Set_Const_Iterator< T > & ACE_Unbounded_Set_Const_Iterator< T >::operator++ void   
 

Prefix advance.

Definition at line 420 of file Unbounded_Set.cpp.

References advance.

00421 {
00422   // ACE_TRACE ("ACE_Unbounded_Set_Const_Iterator<T>::operator++ (void)");
00423 
00424   // prefix operator
00425 
00426   this->advance ();
00427   return *this;
00428 }

template<class T>
ACE_Unbounded_Set_Const_Iterator< T > ACE_Unbounded_Set_Const_Iterator< T >::operator++ int   
 

Postfix advance.

Definition at line 408 of file Unbounded_Set.cpp.

References advance.

00409 {
00410   //ACE_TRACE ("ACE_Unbounded_Set_Const_Iterator<T>::operator++ (int)");
00411   ACE_Unbounded_Set_Const_Iterator<T> retv (*this);
00412 
00413   // postfix operator
00414 
00415   this->advance ();
00416   return retv;
00417 }

template<class T>
int ACE_Unbounded_Set_Const_Iterator< T >::operator== const ACE_Unbounded_Set_Const_Iterator< T > &    const
 

Check if two iterators point to the same position.


Member Data Documentation

template<class T>
ACE_Unbounded_Set_Const_Iterator::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 132 of file Unbounded_Set.h.

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

Pointer to the current node in the iteration.

Definition at line 137 of file Unbounded_Set.h.

Referenced by advance, done, first, and next.

template<class T>
const ACE_Unbounded_Set<T>* ACE_Unbounded_Set_Const_Iterator::set_ [private]
 

Pointer to the set we're iterating over.

Definition at line 140 of file Unbounded_Set.h.

Referenced by advance, done, first, and next.


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