rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWTIsvSlistIterator< TL > Class Template Reference
[Traditional Collections]

Iterator for class RWTIsvSlist<T> . More...

#include <rw/tislist.h>

Inherits RWIsvSlistIterator.

List of all members.

Public Member Functions

 RWTIsvSlistIterator (RWTIsvSlist< TL > &c)
TL * operator++ ()
TL * operator+= (size_t n)
TL * operator() ()
RWTIsvSlist< TL > * container () const
TL * findNext (bool(*testFun)(const TL *, void *), void *)
void insertAfterPoint (TL *a)
TL * key () const
TL * remove ()
TL * removeNext (bool(*testFun)(const TL *, void *), void *)
void reset ()
void reset (RWTIsvSlist< TL > &c)

Detailed Description

template<class TL>
class RWTIsvSlistIterator< TL >

RWTIsvSlistIterator provides an iterator interface for class RWTIsvSlist<T>, allowing sequential access to all the elements of a singly-linked parameterized intrusive list. Elements are accessed in order, from first to last.

The "current item" is undefined immediately after construction; you must define it by using operator()() or some other (valid) operation.

Once the iterator has advanced beyond the end of the collection, it is no longer valid; its continued use will result in undefined behavior.

Synopsis

 #include <rw/tislist.h>
 RWTIsvSlist<T> list;
 RWTIsvSlistIterator<T> iterator(list);

Persistence

None


Constructor & Destructor Documentation

template<class TL>
RWTIsvSlistIterator< TL >::RWTIsvSlistIterator ( RWTIsvSlist< TL > &  c  )  [inline]

Constructs an iterator to be used with the list c.


Member Function Documentation

template<class TL>
RWTIsvSlist<TL>* RWTIsvSlistIterator< TL >::container (  )  const [inline]

Returns a pointer to the collection over which this iterator is iterating.

template<class TL>
TL* RWTIsvSlistIterator< TL >::findNext ( bool(*)(const TL *, void *)  testFun,
void *   
)

Advances the iterator to the first link for which the function pointed to by testFun returns true and returns it, or rwnil if there is no such link.

template<class TL>
void RWTIsvSlistIterator< TL >::insertAfterPoint ( TL *  a  )  [inline]

Inserts the link pointed to by a into the iterator's associated collection in the position immediately after the iterator's current position.

template<class TL>
TL* RWTIsvSlistIterator< TL >::key (  )  const [inline]

Returns the link at the iterator's current position. Returns rwnil if the iterator is not valid.

template<class TL>
TL* RWTIsvSlistIterator< TL >::operator() ( void   )  [inline]

Advances the iterator one position, returning a pointer to the new link, or rwnil if the end of the list has been reached.

template<class TL>
TL* RWTIsvSlistIterator< TL >::operator++ (  )  [inline]

Advances the iterator one position, returning a pointer to the new link, or rwnil if the end of the list has been reached.

template<class TL>
TL* RWTIsvSlistIterator< TL >::operator+= ( size_t  n  )  [inline]

Advances the iterator n positions, returning a pointer to the new link, or rwnil if the end of the list has been reached.

template<class TL>
TL* RWTIsvSlistIterator< TL >::remove (  )  [inline]

Removes and returns the current link from the iterator's associated collection. Returns rwnil if unsuccessful. If successful, the iterator will be positioned at the element immediately before the removed link. This function is relatively inefficient for a singly-linked list.

template<class TL>
TL* RWTIsvSlistIterator< TL >::removeNext ( bool(*)(const TL *, void *)  testFun,
void *   
)

Advances the iterator to the first link for which the function pointed to by testFun returns true, removes and returns it. Returns false if unsuccessful. If successful, the iterator will be positioned at the element immediately before the removed element.

template<class TL>
void RWTIsvSlistIterator< TL >::reset ( RWTIsvSlist< TL > &  c  )  [inline]

Resets the iterator to iterate over the collection c.

template<class TL>
void RWTIsvSlistIterator< TL >::reset (  )  [inline]

Resets the iterator to the state it had immediately after construction.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.