|
Developer Documentation |
|
Centre for Vision, Speech & Signal Processing |
Comments:
The IntrDListC class represents intrusive double-linked list of elements
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.
The class serves as a base class for more complex dynamic structures
as graphs.
Implementation notes:
The class BaseDListC must be defined as a base class of the class
IntrDListC to make a cast from the head structure to the whole
list structure possible.
Parent Classes:
Derived Classes:
Methods:
- IntrDListC()
-
An empty list.
- const IntrDListC<LDataC> & List() const
-
Self identification.
- IntrDListC<LDataC> & List()
-
- ~IntrDListC()
-
The destructor of the list, each list element is destroyed.
---------- Access to the elements -----------------------------
- const LDataC & First() const
-
Returns the first element of the constant list.
- LDataC & First()
-
Returns the first element of the list.
- const LDataC & Last() const
-
Returns the last element of the constant list.
- LDataC & Last()
-
Returns the last element of the constant list.
- const LDataC & operator[](IndexT i) const
-
Returns the i-th element of the constant list. The first element has
the index 0.
- LDataC & operator[](IndexT i)
-
Returns the i-th element of the list. The first element has
the index 0.
---------- Elementary changes in the list -------------
- LDataC * LinkFirst(LDataC * elm)
-
Links in the new element at the beginning of the list.
Returns the pointer to the new element.
- LDataC * LinkLast(LDataC * elm)
-
Links in the new element at the end of the list.
Returns the pointer to the new element.
- LDataC * UnlinkFirst()
-
Removes the first element from the list.
Returns that removed element.
- LDataC * UnlinkLast()
-
Removes the last element from the list.
Returns that removed element.
- IntrDListC<LDataC> & MakeFirst(BaseIntrConstDLIterC<LDataC> & ptr)
-
Moves the head of the list to be the predeccessor of the element
pointed to be 'ptr'.
The iterator 'ptr' must belong to this list.
Returns the reference to the list.
- IntrDListC<LDataC> & MakeLast(BaseIntrConstDLIterC<LDataC> & ptr)
-
Moves the head of the list to be the successor of the element
pointed to by 'ptr'.
The iterator 'ptr' must belong to this list.
Returns the reference to the list.
- IntrDListC<LDataC> & MoveFirst(BaseIntrConstDLIterC<LDataC> & ptr)
-
Moves the list element pointed to by 'ptr' into the list
as the first element. The pointed list element need not to be
the element of this list, but it cannot be the head of any list.
Returns this list.
- IntrDListC<LDataC> & MoveLast(BaseIntrConstDLIterC<LDataC> & ptr)
-
Moves the list element, which 'ptr' points to, into the list
as the last element. The pointed list element need not to be
the element of this list, but it cannot be the head of any list.
Returns this list.
---------- Transformations of lists -----------------------------
- IntrDListC<LDataC> & MoveFirst(IntrDListC<LDataC> & list)
-
Moves the whole 'list' to the beginning of this list. The 'list'
will be empty after the operation. Returns this list.
- IntrDListC<LDataC> & MoveLast(IntrDListC<LDataC> & list)
-
Moves the whole 'list' to the end of this list. The 'list'
will be empty after the operation. Returns this list.
- IntrDListC<LDataC> & Reverse()
-
Reverses the list. Returns the list.
- IntrDListC<LDataC> Tail(BaseIntrConstDLIterC<LDataC> & ptr)
-
Splits the list into two parts. This list will contain the beginning
of the original list. The function returns the second part
of the original list including the element 'ptr'.
- IntrDListC<LDataC> Head(BaseIntrConstDLIterC<LDataC> & ptr)
-
Splits the list into two parts. This list will contain the second part
of the original list including the element 'ptr'.
The function returns the list containing the beginning of the original
list.
- IntrDListC<LDataC> & Empty()
-
The list is disconnected from all elements.
See the BaseDListC class for description of following functions.
- void MergeSort(ScopePath (*)(FuncArgList) LessOrEqFunc)
-
int (*Compare)(const LDataC & el1, const LDataC & el2)
Sorts the list according to order defined by the function 'Compare'.
- BaseIntrConstDLIterC<LDataC> Iter() const
-
Creates the iterator which will be set to the first element of this
list.
- IntrDListC(const IntrDListC<LDataC> & li)
-
These constructors cannot be used.
VCPP Complains about multipal copy constructors.
- IntrDListC(IntrDListC<LDataC> & li)
-
These constructors cannot be used.
- const IntrDListC<LDataC> & operator=(const IntrDListC<LDataC> & l)
-
Assigment cannot be used.
- IntrDListC(IntrDListC<LDataC> & li,BaseIntrConstDLIterC<LDataC> & ptr)
-
Constructor. The tail list is passed.
- IntrDListC(BaseIntrConstDLIterC<LDataC> & ptr,IntrDListC<LDataC> & li)
-
Constructor. The head list is passed.
- ostream & operator<<(ostream & s,const IntrDListC<LDataC> & list)
-
- DataC * LinkFirst(DataC * data)
-
- DataC * LinkLast(DataC * data)
-
- IntrDListC<DataC> & MakeFirst(BaseIntrConstDLIterC<DataC> & ptr)
-
- IntrDListC<DataC> & MakeLast(BaseIntrConstDLIterC<DataC> & ptr)
-
- IntrDListC<DataC> & MoveFirst(BaseIntrConstDLIterC<DataC> & ptr)
-
- IntrDListC<DataC> & MoveLast(BaseIntrConstDLIterC<DataC> & ptr)
-
- IntrDListC<DataC> & MoveFirst(IntrDListC<DataC> & list)
-
- IntrDListC<DataC> & MoveLast(IntrDListC<DataC> & list)
-
- IntrDListC<DataC> Tail(BaseIntrConstDLIterC<DataC> & ptr)
-
- IntrDListC<DataC> Head(BaseIntrConstDLIterC<DataC> & ptr)
-
|
Programmer:Radek Marik, Documentation by CxxDoc: Tue Mar 20 10:49:27 2001
|