TOP --> libjdl

template class CJdlSorter

Heap sort template.

Author:
Joe Linoff

Version:
$Id: jdlsorter.h,v 1.4 1999/06/12 18:26:00 jdl Exp $

Source:
../../libjdl/src/jdlsorter.h:43

Constructors Index

CJdlSorter
[public] Constructor.
CJdlSorter
[public] Copy constructor.
~CJdlSorter
[public] Destructor.


Variables Index

m_List
[protected]
m_Size
[protected]
m_tmp
[protected]


Methods Index

Compare
[public]
Copy
[public] Copy operator.
HeapSort
[protected]
HeapSortSiftDown
[protected]
operator =
[public] Copy operator.
Sort
[public] Sort the specified list.


Constructors

CJdlSorter

public CJdlSorter ( List & list ,
                    int sizeofList ) ;

Constructor.

Create a container to sort the specified list. The size of the list is specified so that partial contents can be sorted.

Parameters:
list The list to be sorted.
sizeofList The number of elements in the list.

CJdlSorter

public CJdlSorter ( const CJdlSorter < List ,
                    Item > & x ) ;

Copy constructor.

CJdlSorter

public virtual ~ CJdlSorter ( ) ;

Destructor.

It can be overloaded to handle list specific clean up. If you do not overload it, the list will remain intact after the sort object is destroyed.


Variables

m_Size

protected int m_Size

m_List

protected List & m_List

m_tmp

protected Item m_tmp


Methods

HeapSort

protected void HeapSort ( ) ;

HeapSortSiftDown

protected void HeapSortSiftDown ( int ,
                                  int ) ;

Compare

public virtual int Compare ( Item & a ,
                             Item & b ) const ;

Parameters:
a item a.
b item b.

Return:
The result of the comparison.

Sort

public void Sort ( ) ;

Sort the specified list.

Copy

public void Copy ( const CJdlSorter < List ,
                   Item > & x ) ;

Copy operator.

operator =

public CJdlSorter < List , Item > & operator = ( const CJdlSorter & x ) ;

Copy operator.


This documentation was generated automatically by the ccdoc tool (version 0.7a).
Click here to submit a bug report or feature request.

Click here to return to the top of the page.