Developer Documentation
RAVL, Recognition And Vision Library
USER HOME PAGE CLASS LIST CONTENTS
Ravl - Core - Lists - DListC<class DataT>
 

  PUBLIC
DListC::DListC(void)
DListC::DListC(DListBodyC &)
DListC::Body(void)
DListC::Body(void) const
DListC::Head(void)
DListC::Head(void) const
DListC::IsEmpty(void) const
DListC::Size(void) const
DListC::Reverse(void)
DListC::Copy(void) const
DListC::InsFirst(const DataT &)
DListC::InsLast(const DataT &)
DListC::PopFirst(void)
DListC::PopLast(void)
DListC::DelFirst(void)
DListC::DelLast(void)
DListC::Empty(void)
DListC::operator +=(const DataT &)
DListC::operator +=(const DListC &)
DListC::MoveFirst(DListC &)
DListC::MoveLast(DListC &)
DListC::MoveFirst(DLIterC &)
DListC::MoveLast(DLIterC &)
DListC::operator ==(const DListC &) const
DListC::operator !=(const DListC &) const
DListC::First(void)
DListC::Last(void)
DListC::First(void) const
DListC::Last(void) const
DListC::Del(const DataT &)
DListC::Contains(const DataT &)
DListC::Nth(int)
DListC::Nth(int) const
DListC::operator <<(ostream &,const DListC &)
DListC::operator >>(istream &,DListC &)
DListC::operator <<(BinOStreamC &,const DListC &)
DListC::operator >>(BinIStreamC &,DListC &)
RCHandleC::operator =(const RCHandleC &)
RCHandleC::DeepCopy(UIntT) const
RCHandleC::operator ==(const RCHandleC &) const
RCHandleC::operator !=(const RCHandleC &) const
RCHandleC::Hash(void) const
RCHandleC::IsValid(void) const
RCHandleC::Invalidate(void)
RCHandleC::IsHandleType(const DT &) const
RCHandleC::CheckHandleType(const DT &) const
RCHandleC::Body(void)
RCHandleC::Body(void) const
RCHandleC::References(void) const
RCHandleC::operator <<(ostream &,const RCHandleC &)
RCHandleC::operator >>(istream &,RCHandleC &)

   DListC<class DataT>   
 
Double linked List
 
include "Ravl/DList.hh"
Source file:Ravl/Core/Container/DList/DList.hh
User Level:Normal
Library:RavlCore
Example:exDList.cc
In Scope:RavlN

Comments:
This is a reference counted, doubly linked list.

Implementation:

The list contains a head element and a chain of elements. Empty list contains just its head element. Because of efficiency references to elements of a list are not checked if they are proper elements of a list or its head.

To iterate through a list efficiently, you need to use on of the list iterator class DLIterC

Parent Classes: Derived Classes: Typedefs:
typedef DLIterC<DataT> IteratorT;
Make iterator type accessible.

typedef DataT ElementT;
Make element type accessible.

Methods:
DListC()
Default constructor.
This creates an empty list.

DListC(DListBodyC<DataT> & bod)
Body constructor.

DListBodyC<DataT> & Body()
Access body.

const DListBodyC<DataT> & Body() const
Constant access to body.

DLinkC & Head()
Get head of list.

const DLinkC & Head() const
Get head of list.

bool IsEmpty() const
Test is the list is empty.

UIntT Size() const
Count the number of elements in the list.
This is slow! It goes through the list counting the elements.

void Reverse()
Reverse the order of the list.

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

void InsFirst(const DataT & dat)
Push element onto the begining of the list.

void InsLast(const DataT & dat)
Push element onto the end of the list.

DataT PopFirst()
Pop item off front of list.

DataT PopLast()
Pop item off end of list.

void DelFirst()
Delete the first element from the list.

void DelLast()
Delete the last element from the list.

void Empty()
Empty the list of all its contents.

DListC<DataT> & operator +=(const DataT & dat)
Add element to the end of the list.

DListC<DataT> & operator +=(const DListC<DataT> & dat)
Copy contents of other list to end of this one.

void MoveFirst(DListC<DataT> & lst)
Move the entire contents of 'lst' to the beginning of this one.
this leaves 'lst' empty.

void MoveLast(DListC<DataT> & lst)
Move the entire contents of 'lst' to the end of this one.
this leaves 'lst' empty.

void MoveFirst(DLIterC<DataT> & at)
Move the single item 'at' to the beginning of this list.

void MoveLast(DLIterC<DataT> & at)
Move the single item 'at' to the end of this list.

bool operator ==(const DListC<DataT> & oth) const
Are lists identical ?
Test if lists have identical content.

bool operator !=(const DListC<DataT> & oth) const
Are lists different ?
Test if lists have different content.

DataT & First()
Get first element in list.
NB. List MUST be non-empty.

DataT & Last()
Get last element in list.
NB. List MUST be non-empty.

const DataT & First() const
Get first element in list.
NB. List MUST be non-empty.

const DataT & Last() const
Get last element in list.
NB. List MUST be non-empty.

bool Del(const DataT & x)
Remove first instance of 'x' found in list.
returns true if the item is found and removed, false otherwise.

bool Contains(const DataT & x)
Test if this list contains an element == to 'x'.

DataT & Nth(int n)
Find the nth element in the list.
0 is the first element, 2 the second etc. -1 is the last, -2 second from last.

const DataT & Nth(int n) const
Find the nth element in the list.
0 is the first element, 2 the second etc. -1 is the last, -2 second from last.

ostream & operator <<(ostream & strm,const DListC<DataT> & lst)

istream & operator >>(istream & strm,DListC<DataT> & lst)

BinOStreamC & operator <<(BinOStreamC & strm,const DListC<DataT> & lst)

BinIStreamC & operator >>(BinIStreamC & strm,DListC<DataT> & lst)

#include "Ravl/RefCounter.hh"
const RCHandleC<DListBodyC<DataT>> & operator =(const RCHandleC<DListBodyC<DataT>> & oth)
Assign handle.

RCHandleC<DListBodyC<DataT>> DeepCopy(UIntT levels = ((UIntT))) const
Do a deep copy of the object.

bool operator ==(const RCHandleC<DListBodyC<DataT>> & oth) const
Are handles to the same object ?

bool operator !=(const RCHandleC<DListBodyC<DataT>> & oth) const
Are handles to different objects ?

UIntT Hash() const
Default hash function.
This hashes on the address of the body.

bool IsValid() const
Test if this is a valid handle.

void Invalidate()
Invalidate this handle.
Unattaches the body from the handle.

bool IsHandleType(const DT &) const
Is handle of given type ?

void CheckHandleType(const DT & dummy) const
Check handle type. Throw an expception if not.

DListBodyC<DataT> & Body()
Access body of object.

const DListBodyC<DataT> & Body() const
Constant access to body of object.

UIntT References() const
Find the number of references to the body of this object.

ostream & operator <<(ostream & strm,const RCHandleC<DListBodyC<DataT>> & obj)

istream & operator >>(istream & strm,RCHandleC<DListBodyC<DataT>> & obj)


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