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

  PUBLIC
DListBodyC::DListBodyC(void)
DListBodyC::~DListBodyC(void)
DListBodyC::Copy(void) const
DListBodyC::Empty(void)
DListBodyC::InsFirst(const DataT &)
DListBodyC::InsLast(const DataT &)
DListBodyC::PopFirst(void)
DListBodyC::PopLast(void)
DListBodyC::operator +=(const DataT &)
DListBodyC::operator +=(const DListC &)
DListBodyC::MoveFirst(DListC &)
DListBodyC::MoveLast(DListC &)
DListBodyC::MoveFirst(DLIterC &)
DListBodyC::MoveLast(DLIterC &)
DListBodyC::operator ==(const DListBodyC &) const
DListBodyC::operator !=(const DListBodyC &) const
DListBodyC::Contains(const DataT &)
DListBodyC::MergeSortHelpCmp(DLinkC *,DLinkC *,void *)
DListBodyC::MergeSort(bool (*cmp)(const DataT & l1,const DataT & l2) )
DListBodyC::First(void)
DListBodyC::Last(void)
DListBodyC::First(void) const
DListBodyC::Last(void) const
DListBodyC::Del(const DataT &)
DListBodyC::Delete(DLinkC &)
DListBodyC::FirstLink(void)
DListBodyC::LastLink(void)
DListBodyC::FirstLink(void) const
DListBodyC::LastLink(void) const
DListBodyC::Head(void)
DListBodyC::Head(void) const
DListBodyC::Nth(int)
DListBodyC::Nth(int) const
DListBodyC::operator <<(ostream &,const DListBodyC &)
DListBodyC::operator <<(BinOStreamC &,const DListBodyC &)
DLinkHeadC::IsEmpty(void) const
DLinkHeadC::Size(void) const
DLinkHeadC::Reverse(void)
DLinkHeadC::MergeSort(MergeSortInterCmpT,void *)
DLinkHeadC::Head(void)
DLinkHeadC::Head(void) const
DLinkHeadC::InsFirst(DLinkC &)
DLinkHeadC::InsLast(DLinkC &)
DLinkHeadC::MoveFirst(DLinkHeadC &)
DLinkHeadC::MoveLast(DLinkHeadC &)
DLinkHeadC::MoveFirst(DLinkC &)
DLinkHeadC::MoveLast(DLinkC &)
DLinkHeadC::MergeSortInternal(DLinkC **,UIntT,MergeSortInterCmpT,void *)
RCBodyC::References(void) const
RCBodyC::Copy(void) const
RCBodyC::DeepCopy(UIntT) const
RCBodyC::IncRefCounter(void)
RCBodyC::DecRefCounter(void)

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

Comments:
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.

Parent Classes: Typedefs:
typedef bool (*MergeSortCmpT)(const DataT & l1,const DataT & l2) ;
Comparison function for merge sort.

Methods:
DListBodyC()
Default constructor.

~DListBodyC()
Destructor.

RCBodyC & Copy() const
Make copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

void Empty()
Empty the list of all contents

void InsFirst(const DataT & dat)
Insert element into the begining of the list.

void InsLast(const DataT & dat)
Insert element into the end of the list.

DataT PopFirst()
Pop item off beginning of this list.

DataT PopLast()
Pop item off end of list.

void operator +=(const DataT & dat)
Add 'dat' to end of this list.

void 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 front 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 front of this list.
Leaves iterator pointing to the previous element.

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

bool operator ==(const DListBodyC<DataT> & oth) const
Test if lists are identical.
assumes '==' is defined for 'DataT'

bool operator !=(const DListBodyC<DataT> & oth) const
Test if lists are different.
assumes '==' is defined for 'DataT'

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

static bool MergeSortHelpCmp(DLinkC * l1,DLinkC * l2,void * dat)
Comparison helper function.

void MergeSort(bool (*cmp)(const DataT & l1,const DataT & l2) )
Merge sort the list with comparison function 'cmp'.

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

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

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

const DataT & Last() const
Get last element in list.
Note, 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.

static void Delete(DLinkC & elm)
Unlink and delete an element from the list.
The delete will unkink the node automaticly.

DLinkDataC<DataT> & FirstLink()
Get first link in list.

DLinkDataC<DataT> & LastLink()
Get the last ilink in the list.

const DLinkDataC<DataT> & FirstLink() const
Get first link in list.

const DLinkDataC<DataT> & LastLink() const
Get the last ilink in the list.

DLinkC & Head()
Get head of list.

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

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 DListBodyC<DataT> & lst)

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

#include "Ravl/DLink.hh"
bool IsEmpty() const
Is list empty ?

UIntT Size() const
Count the number of elements in the list.
This is of order N, where N is the number of elements in the list.

void Reverse()
Reverse the order of the list.
This is of order N, where N is the number of elements in the list.

void MergeSort(MergeSortInterCmpT ms,void * pass = 0)
Merge sort the list using given comparison function.

DLinkC & Head()
Get head of list.

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

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

void InsLast(DLinkC & dat)
Push element onto the begining of the list.

void MoveFirst(DLinkHeadC & lst)
Move the entire contents of 'lst' to the front of this one.
this leaves 'lst' empty.

void MoveLast(DLinkHeadC & lst)
Move the entire contents of 'lst' to the back of this one.
this leaves 'lst' empty.

void MoveFirst(DLinkC & at)
Move the item 'at' to the front of this list

void MoveLast(DLinkC & at)
Move the item 'at' to the back of this list

DLinkC ** MergeSortInternal(DLinkC ** chead,UIntT n,MergeSortInterCmpT ms,void * pass)
Merge sort the list using given comparison function.

#include "Ravl/RefCounter.hh"
UIntT References() const
Access count of handles open to this object.

RCBodyC & Copy() const
Make copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

RCBodyC & DeepCopy(UIntT levels = ((UIntT))) const
Make a deep copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

void IncRefCounter()
Increment reference counter.

bool DecRefCounter()
Decrement reference counter.


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