Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

mpcl::util::strategy::ISortAlgorithm< TSequence > Class Template Reference

#include <sort_algorithm.hh>

Inheritance diagram for mpcl::util::strategy::ISortAlgorithm< TSequence >:

mpcl::util::strategy::TBubbleSortAlgorithm< TSequence > mpcl::util::strategy::TQuickSortAlgorithm< TSequence > List of all members.

Public Types

typedef TSequence::const_iterator const_iterator
 Constant iterator for sequences.

typedef TSequence::iterator iterator
 Iterator for sequences.

typedef TSequence::value_type value_type
 Value type for sequences.


Public Methods

virtual void execute (TSequence &rtSOURCE_SEQUENCE)=0

Protected Methods

void swap (value_type &rtFIRST_ITEM, value_type &rtSECOND_ITEM)

Detailed Description

template<typename TSequence>
class mpcl::util::strategy::ISortAlgorithm< TSequence >

Base sort algorithm.

Sort algorithms from STL are template functions, but these lets the client to extends these algorithms using OOP techniques.

Requires:

TSequence::const_iterator TSequence::begin() TSequence::end() TSequence::push_back() TSequence::value_type

Definition at line 57 of file sort_algorithm.hh.


Member Function Documentation

template<typename TSequence>
virtual void mpcl::util::strategy::ISortAlgorithm< TSequence >::execute TSequence &    rtSOURCE_SEQUENCE [pure virtual]
 

Applies the sort algorithm over the sequence of items rtSOURCE_SEQUENCE.

Parameters:
rtSOURCE_SEQUENCE  Source sequence.

Implemented in mpcl::util::strategy::TBubbleSortAlgorithm< TSequence >, and mpcl::util::strategy::TQuickSortAlgorithm< TSequence >.

template<typename TSequence>
void mpcl::util::strategy::ISortAlgorithm< TSequence >::swap value_type   rtFIRST_ITEM,
value_type   rtSECOND_ITEM
[inline, protected]
 

Swaps values of items rtFIRST_ITEM and rtSECOND_ITEM.

Parameters:
rtFIRST_ITEM  Target item.
rtSECOND_ITEM  Target item.

Definition at line 103 of file sort_algorithm.hh.

References mpcl::util::strategy::ISortAlgorithm< TSequence >::value_type.

Referenced by mpcl::util::strategy::TBubbleSortAlgorithm< TSequence >::execute(), and mpcl::util::strategy::TQuickSortAlgorithm< TSequence >::sort().


The documentation for this class was generated from the following file:
Generated on Mon Oct 13 02:35:27 2003 for MPCL by doxygen1.2.18