|
User Documentation |
|
Centre for Vision, Speech & Signal Processing |
Comments:
The BaseDListC class represents double-linked list of elements without
any contents. 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 double-linked list
of elements containing more data.
Implementation notes:
The head must be defined as a base class of the class BaseDListC to
make a cast from the head structure to the whole list structure
possible.
Parent Classes:
Derived Classes:
Typedefs:
- typedef IndexC ListIndexT;
-
The index of an item saved in a list.
- typedef SizeT ListSizeT;
-
The number of items stored in a list.
Methods:
- BaseDListC()
-
An empty list.
- BaseDListC(const BaseDListC & li)
-
Copy constructor. The physical copy of the list 'li' is created.
- BaseDListC Copy() const
-
Create a copy of this list.
- const BaseDListC & operator=(const BaseDListC & list)
-
- ~BaseDListC()
-
The destructor of the list, each list element is destroyed.
Status functions
----------------
- ListSizeT Size() const
-
Returns the length of a list. It does not check the counter overflow.
- BooleanT operator==(const BaseDListC & list) const
-
Returns TRUE if both lists represent the same list.
- BooleanT operator!=(const BaseDListC & list) const
-
Returns TRUE if both lists are independent.
- BooleanT IsEmpty() const
-
Returns TRUE if the list is empty.
Access to the elements
----------------------
- const DChainC & First() const
-
Returns the first element of the constant list.
- DChainC & First()
-
Returns the first element of the list.
- const DChainC & Last() const
-
Returns the last element of the constant list.
- DChainC & Last()
-
Returns the last element of the constant list.
- const DChainC & operator[](ListIndexT i) const
-
Returns the (i+1)-th element of the constant list. The first element has
index 0.
- DChainC & operator[](ListIndexT i)
-
Returns the (i+1)-th element of the list. The first element has
index 0.
Elementary changes in the list
------------------------------
- BaseDListC & LinkFirst(DChainC * elm)
-
Links in the new element at the beginning of the list.
Returns the reference to the changed list.
- BaseDListC & LinkLast(DChainC * elm)
-
Links in the new element at the end of the list.
Returns the pointer to the list.
- DChainC * UnlinkFirst()
-
Removes the first element from the list.
Returns that removed element.
- DChainC * UnlinkLast()
-
Removes the last element from the list.
Returns that removed element.
- BaseDListC & MakeFirst(DChainC & elm)
-
Moves the head of the list to be the predeccessor of the element 'elm'.
The element 'elm' must belong to this list.
Returns the reference to the list.
- BaseDListC & MakeLast(DChainC & elm)
-
Moves the head of the list to be the successor of the element 'elm'.
The element 'elm' must belong to this list.
Returns the reference to the list.
- BaseDListC & MoveFirst(DChainC & elm)
-
Moves the list element 'elm' 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.
- BaseDListC & MoveLast(DChainC & elm)
-
Moves the list element, which 'elm' 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.
- BaseDListC & MakeFirst(BaseConstDLIterC & elm)
-
Moves the head of the list to be the predeccessor of the element 'elm'.
The element 'elm' must belong to this list.
Returns the reference to the list.
- BaseDListC & MakeLast(BaseConstDLIterC & elm)
-
Moves the head of the list to be the successor of the element 'elm'.
The element 'elm' must belong to this list.
Returns the reference to the list.
- BaseDListC & MoveFirst(BaseConstDLIterC & elm)
-
Moves the list element 'elm' 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.
- BaseDListC & MoveLast(BaseConstDLIterC & elm)
-
Moves the list element, which 'elm' 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
------------------------
- BaseDListC & MoveFirst(BaseDListC & list)
-
Moves the whole 'list' to the beginning of this list. The 'list'
will be empty after the operation. Returns this list.
- BaseDListC & MoveLast(BaseDListC & list)
-
Moves the whole 'list' to the end of this list. The 'list'
will be empty after the operation. Returns this list.
- const BaseDListC & operator+=(BaseDListC & list)
-
Concatenation. The operator moves the whole 'list to the end
of this list. The 'list' will be empty after the operation.
Returns this list.
- BaseDListC & Reverse()
-
Reverses the list. Returns the list.
- BaseDListC Tail(DChainC & elm)
-
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 'elm'.
- BaseDListC Head(DChainC & elm)
-
Splits the list into two parts. This list will contain the second part
of the original list including the element 'elm'.
The function returns the list containing the beginning of the original
list.
- BaseDListC Tail(BaseConstDLIterC & elm)
-
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 'elm'.
- BaseDListC Head(BaseConstDLIterC & elm)
-
Splits the list into two parts. This list will contain the second part
of the original list including the element 'elm'.
The function returns the list containing the beginning of the original
list.
- void ConsistencyCheck(ListSizeT stopSize = 30000) const
-
Checks the list if all links are valid. If the counter of elements
during the checking overflows the number 'stopSize', the function
exits with error.
- BaseConstDLIterC Iter() const
-
Creates an iterator of the list. The iterator will point to the
first element if there is any.
|
Programmer:Radek Marik, Documentation by CxxDoc: Tue Mar 20 10:48:08 2001
|