User Documentation
RAVL, Recognition And Vision Library
DEVELOP HOME PAGE CLASS LIST CONTENTS
Ravl - Core - Lists - DLIterC<class DataT>
 

  PUBLIC
DLIterC::DLIterC(void)
DLIterC::IsValid(void) const
DLIterC::First(void)
DLIterC::Last(void)
DLIterC::DLIterC(const DListC &)
DLIterC::List(void) const
DLIterC::Copy(void) const
DLIterC::operator bool(void) const
DLIterC::operator !(void) const
DLIterC::operator ++(int)
DLIterC::operator ++(void)
DLIterC::operator --(int)
DLIterC::operator --(void)
DLIterC::InsertBef(const DataT &)
DLIterC::InsertAft(const DataT &)
DLIterC::MoveBef(DLIterC &)
DLIterC::MoveAft(DLIterC &)
DLIterC::Del(void)
DLIterC::DelMoveNext(void)
DLIterC::operator ==(const DLIterC &) const
DLIterC::operator !=(const DLIterC &) const
DLIterC::IsElm(void) const
DLIterC::IsFirst(void) const
DLIterC::IsLast(void) const
DLIterC::Next(void)
DLIterC::Prev(void)
DLIterC::NextCrc(void)
DLIterC::PrevCrc(void)
DLIterC::RelNth(IntT)
DLIterC::Nth(IntT)
DLIterC::Data(void)
DLIterC::Data(void) const
DLIterC::operator *(void)
DLIterC::operator *(void) const
DLIterC::operator ->(void)
DLIterC::operator ->(void) const
DLIterC::NextData(void)
DLIterC::NextData(void) const
DLIterC::PrevData(void)
DLIterC::PrevData(void) const
DLIterC::Tail(void)
DLIterC::Head(void)
DLIterC::InclusiveTail(void)
DLIterC::InclusiveHead(void)
DLIterC::Clip(const DLIterC &)

   DLIterC<class DataT>   
 
Double linked list iterator.
 
include "Ravl/DLIter.hh"
User Level:Normal
Library:RavlCore
Example:exDList.cc
In Scope:RavlN

Comments:
Note: This iterator holds a reference to the list it is iterating. (Unlike some other iterators.)

Derived Classes: Variables:
Methods:
DLIterC()
Default constructor.
Creates an invalid iterator.

bool IsValid() const
Is a valid iterator ?

void First()
Goto first item in list.

void Last()
Goto last item in list.

DLIterC(const DListC<DataT> & nlst)
Construct an iterator from a list.
The iterator is placed at the first element in the list. If there is any.

const DListC<DataT> & List() const
Access list we're iterating.

DListC<DataT> Copy() const
Make a copy of this list.

operator bool() const
Is iterator at a valid position ?

bool operator !() const
Is iterator at a invalid position ?

void operator ++(int)
Goto next element.

void operator ++()
Goto next element.

void operator --(int)
Goto previous element.

void operator --()
Goto previous element.

void InsertBef(const DataT & dat)
Insert data before current element.
if at the head of the list (i.e. operator bool() failes.) then add at end.

void InsertAft(const DataT & dat)
Insert data after current element.
if at the head of the list (i.e. operator bool() failes.) then add at begining.

void MoveBef(DLIterC<DataT> & it)
Move the list element indicated by 'it' to before the element in this list.

void MoveAft(DLIterC<DataT> & it)
Move the list element indicated by 'it' to before the element in this list.

void Del()
Remove current element from the list.
This moves the iterator to the previous element. NB. The iterator must be pointing to a valid element.

Because the moves the prevous element it makes it easy to delete elements from a list in a for() loop. e.g. the following will work correctly.

 for(DLIterC it(x);it;it++) 
   if(*it == 2)
     it.Del();
 


void DelMoveNext()
Remove current element from the list.
This moves the iterator to the previous element. NB. The iterator must be pointing to a valid element.

bool operator ==(const DLIterC<DataT> & oth) const
Are these iterators equal ?
True if both iterators point to the same element in the same list. False otherwise.

bool operator !=(const DLIterC<DataT> & oth) const
Are these iterators unequal ?
True if the iterators point to different elements in any lists. False otherwise.

bool IsElm() const
Is iterator at a valid position ?
AMMA compatibility function, use cast to bool instead ie if(iter) {..}

bool IsFirst() const
Returns true if the current element is the first in the list.

bool IsLast() const
Returns true if the current element is the last in the list.

void Next()
Goto next element.

void Prev()
Goto previous element.

void NextCrc()
Goto next element.
If the next element is the head of the list, loop back to the begining of the list.

void PrevCrc()
Goto previous element.
If the next element is the head of the list, go to the begining of the list.

DLIterC<DataT> & RelNth(IntT n)
Move to the n-th element from the current element.
The index 'n' can be positive, zero, or negative. Particularly, the n = 0 means no move, n = 1 means the move to the next element, and n = -1 means the move to the previous element.

Returns a reference to this iterator.


DLIterC<DataT> & Nth(IntT n)
Sets to the n-th element of the list.
The index 'n' can be negative. The first element of the list has the index 0, the last element has the index -1. It does not skip the head of the list.

Returns a reference to this iterator.


DataT & Data()
Access data

const DataT & Data() const
Constant access to data.

DataT & operator *()
Access data.

const DataT & operator *() const
Constant access to data.

DataT * operator ->()
Access member function of data..

const DataT * operator ->() const
Constant access to member function of data..

DataT & NextData()
Access data following this element.
The iterator must not be on the last element of the list.

const DataT & NextData() const
Access data following this element.
The iterator must not be on the last element of the list.

DataT & PrevData()
Access data before this element.
The iterator must not be on the first element in the list.

const DataT & PrevData() const
Access data before this element.
The iterator must not be on the first element in the list.

DListC<DataT> Tail()
Clip out the tail of the list.
Return all of the elements after this element in the list.

DListC<DataT> Head()
Clip out the head of the list.
Return all of the elements before this element in the list.

DListC<DataT> InclusiveTail()
Clip out the tail of the list including this element.
Returns this element and the following elements from the list. The interator is left point to the last element in the remaining list.

DListC<DataT> InclusiveHead()
Clip out the head of the list including this element.
Returns this element and the following elements from the list. The interator is left point to the last element in the remaining list.

DListC<DataT> Clip(const DLIterC<DataT> & end)
Clip out section of the list
Returns the elements starting from this one to the element before the end. This iterator is moved the previous element.

NB. It is the user's responsibility to ensure 'end' is an element following this element in the same list.



Maintainer:Radek Marik, Charles Galambos, Documentation by CxxDoc: Tue Aug 13 09:59:02 2002