Public Types | Static Public Member Functions | Protected Member Functions

zeus::TListSort< T > Class Template Reference

#include <ListSort.hpp>

List of all members.

Public Types

typedef Int(* FnCompareObjects )(const T &rObj1, const T &rObj2)

Static Public Member Functions

static bool sort (TSingleLinkedList< T > &rList)
 Sort a single linked list. Also works for managed lists.
static bool sort (TArrayList< T > &rList)
 Sort an arraylist.
static Int insertSorted (TSingleLinkedList< T > &rList, const T &rItem)
 Insert sorted into a single linked list. Also works for managed lists.
static Int insertSorted (TArrayList< T > &rList, const T &rItem)
 Insert sorted into an array list.
static bool sortCustom (TSingleLinkedList< T > &rList, FnCompareObjects pFnCompare)
 Custom sort method for a single linked list. Also works for managed lists.
static bool sortCustom (TArrayList< T > &rList, FnCompareObjects pFnCompare)
 Custom sort method for an array list.

Protected Member Functions

 TListSort ()
virtual ~TListSort ()

Detailed Description

template<class T>
class zeus::TListSort< T >

This class is used to sort single linked lists and array lists


Member Typedef Documentation

template<class T >
typedef Int(* zeus::TListSort< T >::FnCompareObjects)(const T &rObj1, const T &rObj2)

Function pointer definition to custom comparison of 2 objects. Return -1 for rObj1 < rObj2, 0 for rObj1 == rObj2 and 1 for rObj1 > rObj2.


Constructor & Destructor Documentation

template<class T >
zeus::TListSort< T >::TListSort (  ) [inline, protected]
template<class T >
virtual zeus::TListSort< T >::~TListSort (  ) [inline, protected, virtual]

Member Function Documentation

template<class T >
Int zeus::TListSort< T >::insertSorted ( TSingleLinkedList< T > &  rList,
const T &  rItem 
) [static]

Insert sorted into a single linked list. Also works for managed lists.

inserts an item into a list regarding the sorting

template<class T >
Int zeus::TListSort< T >::insertSorted ( TArrayList< T > &  rList,
const T &  rItem 
) [static]

Insert sorted into an array list.

inserts an item into a list regarding the sorting

template<class T >
bool zeus::TListSort< T >::sort ( TArrayList< T > &  rList ) [static]

Sort an arraylist.

sorts an array list

Parameters:
rList[IN]: The list.
Returns:
: The sorting has lead to a modification in the order of the elements.
template<class T >
bool zeus::TListSort< T >::sort ( TSingleLinkedList< T > &  rList ) [static]

Sort a single linked list. Also works for managed lists.

sorts a single linked list

Parameters:
rList[IN]: The list.
Returns:
: The sorting has lead to a modification in the order of the elements.
template<class T >
bool zeus::TListSort< T >::sortCustom ( TArrayList< T > &  rList,
FnCompareObjects  pFnCompare 
) [static]

Custom sort method for an array list.

Custom sorting of an array list.

Parameters:
rList[IN]: The list.
pFnCompare[IN]: Comparison function.
Returns:
: The sorting has lead to a modification in the order of the elements.
template<class T >
bool zeus::TListSort< T >::sortCustom ( TSingleLinkedList< T > &  rList,
FnCompareObjects  pFnCompare 
) [static]

Custom sort method for a single linked list. Also works for managed lists.

Custom sorting of a single linked list.

Parameters:
rList[IN]: The list.
pFnCompare[IN]: Comparison function.
Returns:
: The sorting has lead to a modification in the order of the elements.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


Written by Benjamin Hadorn http://www.xatlantis.ch.
Last change made on Sun Jan 22 2012 15:28:39