#ifndef __GESORT_H
#define __GESORT_H

#include "ge_math.h"

class GeSortAndSearch
{
	private:
		void Bsort(void *start, LONG count, LONG msize);
		void Wsort(void *start, LONG count, LONG msize);
		void Lsort(void *start, LONG count, LONG msize);

		inline void Bswap(CHAR *a,CHAR *b, LONG i);
		inline void Wswap(WORD *a,WORD *b, LONG i);
		inline void Lswap(LONG *a,LONG *b, LONG i);
		
	protected:
		virtual LONG Compare(void *a,void *b)=0;
		// if(a==b) return 0;
		// if(a<b) return -1;
		// if(a>b) return 1;
		
	public:
		void Sort(void *start,LONG count,LONG msize);
		void *Search(void *Key,void *Start,LONG count,LONG msize);
};


#endif