ACE_Unbounded_Stack_Iterator< T > Class Template Reference

Implement an iterator over an unbounded Stack. More...

#include <Containers_T.h>

Collaboration diagram for ACE_Unbounded_Stack_Iterator< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ACE_Unbounded_Stack_Iterator (ACE_Unbounded_Stack< T > &stack)
 Move to the first element in the {stack}.
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_Stack< T > & stack_
 Pointer to the Stack we're iterating over.

Detailed Description

template<class T>
class ACE_Unbounded_Stack_Iterator< T >

Implement an iterator over an unbounded Stack.

Definition at line 508 of file Containers_T.h.


Constructor & Destructor Documentation

template<class T >
ACE_Unbounded_Stack_Iterator< T >::ACE_Unbounded_Stack_Iterator ( ACE_Unbounded_Stack< T > &  stack  )  [inline]

Move to the first element in the {stack}.

Definition at line 1471 of file Containers_T.cpp.

01472   : current_ (q.head_->next_),
01473     stack_ (q)
01474 {
01475   // ACE_TRACE ("ACE_Unbounded_Stack_Iterator<T>::ACE_Unbounded_Stack_Iterator");
01476 }


Member Function Documentation

template<class T >
int ACE_Unbounded_Stack_Iterator< T >::advance ( void   )  [inline]

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

Definition at line 1479 of file Containers_T.cpp.

01480 {
01481   // ACE_TRACE ("ACE_Unbounded_Stack_Iterator<T>::advance");
01482   this->current_ = this->current_->next_;
01483   return this->current_ != this->stack_.head_;
01484 }

template<class T >
int ACE_Unbounded_Stack_Iterator< T >::done ( void   )  const [inline]

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

Definition at line 1495 of file Containers_T.cpp.

01496 {
01497   ACE_TRACE ("ACE_Unbounded_Stack_Iterator<T>::done");
01498 
01499   return this->current_ == this->stack_.head_;
01500 }

template<class T >
void ACE_Unbounded_Stack_Iterator< T >::dump ( void   )  const [inline]

Dump the state of an object.

Definition at line 1463 of file Containers_T.cpp.

01464 {
01465 #if defined (ACE_HAS_DUMP)
01466   // ACE_TRACE ("ACE_Unbounded_Stack_Iterator<T>::dump");
01467 #endif /* ACE_HAS_DUMP */
01468 }

template<class T >
int ACE_Unbounded_Stack_Iterator< T >::first ( void   )  [inline]

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

Definition at line 1487 of file Containers_T.cpp.

01488 {
01489   // ACE_TRACE ("ACE_Unbounded_Stack_Iterator<T>::first");
01490   this->current_ = this->stack_.head_->next_;
01491   return this->current_ != this->stack_.head_;
01492 }

template<class T >
int ACE_Unbounded_Stack_Iterator< T >::next ( T *&  next_item  )  [inline]

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

Definition at line 1503 of file Containers_T.cpp.

01504 {
01505   // ACE_TRACE ("ACE_Unbounded_Stack_Iterator<T>::next");
01506   if (this->current_ == this->stack_.head_)
01507     return 0;
01508   else
01509     {
01510       item = &this->current_->item_;
01511       return 1;
01512     }
01513 }


Member Data Documentation

Declare the dynamic allocation hooks.

Definition at line 536 of file Containers_T.h.

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

Pointer to the current node in the iteration.

Definition at line 540 of file Containers_T.h.

template<class T >
ACE_Unbounded_Stack<T>& ACE_Unbounded_Stack_Iterator< T >::stack_ [private]

Pointer to the Stack we're iterating over.

Definition at line 543 of file Containers_T.h.


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

Generated on Sun Nov 22 23:17:12 2009 for ACE by  doxygen 1.6.1