NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
Sorter Class Referenceabstract

Abstract parent class to implement the sorting functionality (using Quicksort) on a more generic level. More...

#include <sorter.hpp>

Inheritance diagram for Sorter:
Collaboration diagram for Sorter:

Public Member Functions

virtual ~Sorter ()
 
bool qSort (int *nIndex, int nElements, int nColumn, long long int nLeft, long long int nRight, int nSign)
 This public member function is the interface to the quicksort algorithm, which itself is implemented as a private member function of this class. More...
 
bool sortSubList (int *nIndex, int nElements, ColumnKeys *KeyList, long long int i1, long long int i2, long long int j1, int nSign, long long int nColumns)
 This public member function handles the hierarchical sorting process of many columns together. The ColumnKeys object contains the necessary information needed for the hierarchical sorting. More...
 
ColumnKeysevaluateKeyList (std::string &sKeyList, long long int nColumnCount)
 This public member function creates a ColumnKeys object from a string containing the hierarchical sorting order for the current sorting process. More...
 

Protected Member Functions

virtual int compare (int i, int j, int col)=0
 
virtual bool isValue (int line, int col)=0
 

Private Member Functions

bool qSortImplementation (int *nIndex, int nElements, int nColumn, long long int nLeft, long long int nRight, int nSign)
 This private member function is the actual implementation of the quicksort algorithm. More...
 

Detailed Description

Abstract parent class to implement the sorting functionality (using Quicksort) on a more generic level.

Definition at line 30 of file sorter.hpp.

Constructor & Destructor Documentation

◆ ~Sorter()

virtual Sorter::~Sorter ( )
inlinevirtual

Definition at line 42 of file sorter.hpp.

Member Function Documentation

◆ compare()

virtual int Sorter::compare ( int  i,
int  j,
int  col 
)
protectedpure virtual

◆ evaluateKeyList()

ColumnKeys * Sorter::evaluateKeyList ( std::string &  sKeyList,
long long int  nColumnCount 
)

This public member function creates a ColumnKeys object from a string containing the hierarchical sorting order for the current sorting process.

Parameters
sKeyListstring&
nColumnCountlong longint
Returns
ColumnKeys*

Definition at line 252 of file sorter.cpp.

References evaluateKeyList(), getMatchingParenthesis(), ColumnKeys::nKey, StrToInt(), and ColumnKeys::subkeys.

Referenced by evaluateKeyList(), Memory::sortElements(), and StringInternalMemory::sortElements().

Here is the call graph for this function:

◆ isValue()

virtual bool Sorter::isValue ( int  line,
int  col 
)
protectedpure virtual

Implemented in NumeRe::Cluster, Memory, and StringInternalMemory.

Referenced by qSort().

◆ qSort()

bool Sorter::qSort ( int *  nIndex,
int  nElements,
int  nColumn,
long long int  nLeft,
long long int  nRight,
int  nSign 
)

This public member function is the interface to the quicksort algorithm, which itself is implemented as a private member function of this class.

Parameters
nIndexint*
nElementsint
nColumnint
nLeftlong longint
nRightlong longint
nSignint
Returns
bool

Definition at line 40 of file sorter.cpp.

References isValue(), and qSortImplementation().

Referenced by Memory::sortElements(), NumeRe::Cluster::sortElements(), StringInternalMemory::sortElements(), and sortSubList().

Here is the call graph for this function:

◆ qSortImplementation()

bool Sorter::qSortImplementation ( int *  nIndex,
int  nElements,
int  nColumn,
long long int  nLeft,
long long int  nRight,
int  nSign 
)
private

This private member function is the actual implementation of the quicksort algorithm.

Parameters
nIndexint*
nElementsint
nColumnint
nLeftlong longint
nRightlong longint
nSignint
Returns
bool

Definition at line 93 of file sorter.cpp.

References compare(), and qSortImplementation().

Referenced by qSort(), and qSortImplementation().

Here is the call graph for this function:

◆ sortSubList()

bool Sorter::sortSubList ( int *  nIndex,
int  nElements,
ColumnKeys KeyList,
long long int  i1,
long long int  i2,
long long int  j1,
int  nSign,
long long int  nColumns 
)

This public member function handles the hierarchical sorting process of many columns together. The ColumnKeys object contains the necessary information needed for the hierarchical sorting.

Parameters
nIndexint*
nElementsint
KeyListColumnKeys*
i1long longint
i2long longint
j1long longint
nSignint
nColumnslong longint
Returns
bool

Definition at line 196 of file sorter.cpp.

References compare(), ColumnKeys::nKey, qSort(), sortSubList(), and ColumnKeys::subkeys.

Referenced by Memory::sortElements(), StringInternalMemory::sortElements(), and sortSubList().

Here is the call graph for this function:

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