seal::SortingAlgorithm< T > Class Template Reference

#include <sort.h>

Inheritance diagram for seal::SortingAlgorithm< T >:

seal::BubbleSort< T > seal::MergeSort< T >

List of all members.

Public Member Functions

 SortingAlgorithm (void)
virtual ~SortingAlgorithm ()
virtual void operator() (RandomAccess< T > &array, int from, int to, SortOrder order=ASCENDING)
virtual void sort (RandomAccess< T > &array, int from, int to, SortOrder order=ASCENDING)=0


Detailed Description

template<typename T>
class seal::SortingAlgorithm< T >

This is an abstract base class for algorithm classes which encapsulate sorting algorithms. Elements of any data structure which implements the RandomAccess interface (that is, elements of any data structure which is derived from the abstract base class RandomAccess) can be sorted using the sorting algorithms encapsulated in the derived concrete classes.

Constructor & Destructor Documentation

template<typename T>
seal::SortingAlgorithm< T >::SortingAlgorithm ( void   )  [inline]

Default constructor.

template<typename T>
virtual seal::SortingAlgorithm< T >::~SortingAlgorithm (  )  [inline, virtual]

Virtual destructor.


Member Function Documentation

template<typename T>
virtual void seal::SortingAlgorithm< T >::operator() ( RandomAccess< T > &  array,
int  from,
int  to,
SortOrder  order = ASCENDING 
) [inline, virtual]

The operator which performs the actual sorting of the elements in the derived concrete classes.

Parameters:
array The data structure whose elements will be sorted.
from The elements starting from this index in the data structure will be sorted in the order requested.
to The elements upto this index in the data structure will be sorted in the order requested.
order The order in which the elements will be sorted.

Reimplemented in seal::BubbleSort< T >, and seal::MergeSort< T >.

template<typename T>
virtual void seal::SortingAlgorithm< T >::sort ( RandomAccess< T > &  array,
int  from,
int  to,
SortOrder  order = ASCENDING 
) [pure virtual]

Virtual function which performs the actual sorting of the elements in the derived concrete classes.

Parameters:
array The data structure whose elements will be sorted.
from The elements starting from this index in the data structure will be sorted in the order requested.
to The elements upto this index in the data structure will be sorted in the order requested.
order The order in which the elements will be sorted.

Implemented in seal::BubbleSort< T >, and seal::MergeSort< T >.


The documentation for this class was generated from the following file:

Generated on Sat May 16 21:35:21 2009 for SEAL by  doxygen 1.5.5