SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWTIsvDlistIterator< TL > Class Template Reference

Iterator for class RWTIsvDlist. More...

#include <rw/tidlist.h>

Inherits RWIsvDlistIterator.

Public Member Functions

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

Detailed Description

template<class TL>
class RWTIsvDlistIterator< TL >

RWTIsvDlistIterator provides an iterator interface for class RWTIsvDlist, allowing sequential access to all the elements of a doubly-linked parameterized intrusive list. Elements are accessed in order, in either direction.

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/tidlist.h>
RWTIsvDlistIterator<T> iterator(list);
Iterator for class RWTIsvDlist.
Definition tidlist.h:386
Implements intrusive doubly-linked lists.
Definition tidlist.h:113
Persistence
None

Constructor & Destructor Documentation

◆ RWTIsvDlistIterator()

template<class TL >
RWTIsvDlistIterator< TL >::RWTIsvDlistIterator ( RWTIsvDlist< TL > & c)
inline

Constructs an iterator to be used with the list c.

Member Function Documentation

◆ container()

template<class TL >
RWTIsvDlist< TL > * RWTIsvDlistIterator< TL >::container ( ) const
inline

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

◆ findNext()

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

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

◆ insertAfterPoint()

template<class TL >
void RWTIsvDlistIterator< 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.

◆ key()

template<class TL >
TL * RWTIsvDlistIterator< TL >::key ( ) const
inline

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

◆ operator()()

template<class TL >
TL * RWTIsvDlistIterator< 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.

◆ operator++()

template<class TL >
TL * RWTIsvDlistIterator< 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.

◆ operator+=()

template<class TL >
TL * RWTIsvDlistIterator< 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.

◆ operator--()

template<class TL >
TL * RWTIsvDlistIterator< TL >::operator-- ( )
inline

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

◆ operator-=()

template<class TL >
TL * RWTIsvDlistIterator< TL >::operator-= ( size_t n)
inline

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

◆ remove()

template<class TL >
TL * RWTIsvDlistIterator< 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.

◆ removeNext()

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

Advances the iterator to the first link for which the tester 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.

◆ reset() [1/2]

template<class TL >
void RWTIsvDlistIterator< TL >::reset ( )
inline

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

◆ reset() [2/2]

template<class TL >
void RWTIsvDlistIterator< TL >::reset ( RWTIsvDlist< TL > & c)
inline

Resets the iterator to iterate over the collection c.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.