User Documentation |
RAVL, Recognition And Vision Library |
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.
- 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)
-
- 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.
- 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:02 2002
|