28 lines
523 B
C++
28 lines
523 B
C++
#ifndef _QUICKSORT_HPP_
|
|
#define _QUICKSORT_HPP_
|
|
|
|
#ifdef _EXPAND_QSORT_TEMPLATES_
|
|
#pragma option -Jgd
|
|
#endif
|
|
|
|
class SortOptions
|
|
{
|
|
public:
|
|
enum SortOrder{Ascending,Descending};
|
|
};
|
|
|
|
template <class T>
|
|
class QuickSort
|
|
{
|
|
public:
|
|
QuickSort(void);
|
|
~QuickSort();
|
|
void sortItems(T HUGE *lpItemList,long itemCount,SortOptions::SortOrder sortOrder=SortOptions::Ascending);
|
|
private:
|
|
void quickSort(long left,long right);
|
|
void quickSortDescending(long left,long right);
|
|
T HUGE *mlpItemList;
|
|
};
|
|
#include <mdiwin/qsort.tpp>
|
|
#endif
|