fm::comparator< T > Class Template Reference

A utility to sort arrays. More...

#include <FMSort.h>

Inheritance diagram for fm::comparator< T >:

fm::icomparator< T > List of all members.

Public Member Functions

virtual ~comparator ()
 Destructor.
virtual bool compare (const T &a, const T &b)
 Compares two elements in ascending order, using operator<.
void sort (T *data, size_t count)
 Sorts the given array using the quick sort algorithm.

Detailed Description

template<class T>
class fm::comparator< T >

A utility to sort arrays.


Member Function Documentation

template<class T>
virtual bool fm::comparator< T >::compare const T &  a,
const T &  b
[inline, virtual]
 

Compares two elements in ascending order, using operator<.

Override this function to define your custom comparator.

Parameters:
a The first element.
b The second element.
Returns:
True if a is smaller than b, false otherwise.

Reimplemented in fm::icomparator< T >, and fm::pcomparator< T >.

template<class T>
void fm::comparator< T >::sort T *  data,
size_t  count
[inline]
 

Sorts the given array using the quick sort algorithm.

Parameters:
data The data array to sort.
count The number of elements in the array.


The documentation for this class was generated from the following file:
Generated on Thu Feb 14 16:58:42 2008 for FCollada by  doxygen 1.4.6-NO