LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::sortExpensive< T, TValue > Class Template Reference

Sorts elements in a list that are computationally expensive to compare. More...

#include <ltiSortExpensive.h>

Inheritance diagram for lti::sortExpensive< T, TValue >:
Inheritance graph
[legend]
Collaboration diagram for lti::sortExpensive< T, TValue >:
Collaboration graph
[legend]

List of all members.

Classes

class  sortHelper
 Helper class for sorting. More...

Public Member Functions

 sortExpensive ()
 sortExpensive (const sortExpensive &other)
virtual ~sortExpensive ()
void apply (std::list< T > &aList, void *callbackPtr, TValue(*computeValue)(void *callbackPtr, const T &))
virtual const char * getTypeName () const

Detailed Description

template<class T, class TValue>
class lti::sortExpensive< T, TValue >

Sorts elements in a list that are computationally expensive to compare.

You need to provide a pointer to a class member function that performs the expensive computation (e.g. area computation). This class sorts the list while performing the expensive computation exactly once for each element.


Constructor & Destructor Documentation

template<class T , class TValue >
lti::sortExpensive< T, TValue >::sortExpensive (  ) 

Constructor.

template<class T , class TValue >
lti::sortExpensive< T, TValue >::sortExpensive ( const sortExpensive< T, TValue > &  other  ) 

Copy constructor (same as sortExpensive() - no memory.

)

template<class T , class TValue >
virtual lti::sortExpensive< T, TValue >::~sortExpensive (  )  [virtual]

Destructor.


Member Function Documentation

template<class T , class TValue >
void lti::sortExpensive< T, TValue >::apply ( std::list< T > &  aList,
void *  callbackPtr,
TValue(*)(void *callbackPtr, const T &)  computeValue 
)

Sort the elements in the given list.

Requires a function pointer that computes a double value for an object of type T. The function is assumed to be a class member function, therefore a pointer to an instance of that class (callbackPtr) is required (see www.function-pointer.org). See ltiObjectsFromMask for a usage example.

template<class T , class TValue >
virtual const char* lti::sortExpensive< T, TValue >::getTypeName (  )  const [virtual]

returns the name of this type

Reimplemented from lti::object.


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

Generated on Sat Apr 10 15:28:45 2010 for LTI-Lib by Doxygen 1.6.1