Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

Comparator< T > Class Template Reference
[Miscellaneous]

Generic Comparator Class. More...

#include <comparator.h>

List of all members.

Public Member Functions

Constructors and Destructors
 Comparator () throw ()
 Default constructor.
virtual ~Comparator () throw ()
 Destructor.
Predicates
virtual bool isEqual (const T &a, const T &b) const throw ()
 Test if two values are equal.
bool isNotEqual (const T &a, const T &b) const throw ()
 Test if two values are unequal.
virtual bool isLess (const T &a, const T &b) const throw ()
 Test if a is less then b.
bool isLessOrEqual (const T &a, const T &b) const throw ()
 Test if a is less or equal.
bool isGreaterOrEqual (const T &a, const T &b) const throw ()
 Test if a is greater or equal.
bool isGreater (const T &a, const T &b) const throw ()
 Test if a is greater then b.
int operator() (const T &a, const T &b) const throw ()
 Compare two values.


Detailed Description

template<typename T>
class Comparator< T >

Generic Comparator Class.

It is used as a baseclass, providing a common interface.


Member Function Documentation

template<class T>
bool Comparator< T >::isEqual const T &  a,
const T &  b
const throw () [virtual]
 

Test if two values are equal.

template<class T>
bool Comparator< T >::isGreater const T &  a,
const T &  b
const throw ()
 

Test if a is greater then b.

template<class T>
bool Comparator< T >::isGreaterOrEqual const T &  a,
const T &  b
const throw ()
 

Test if a is greater or equal.

template<class T>
bool Comparator< T >::isLess const T &  a,
const T &  b
const throw () [virtual]
 

Test if a is less then b.

template<class T>
bool Comparator< T >::isLessOrEqual const T &  a,
const T &  b
const throw ()
 

Test if a is less or equal.

template<class T>
bool Comparator< T >::isNotEqual const T &  a,
const T &  b
const throw ()
 

Test if two values are unequal.

template<class T>
int Comparator< T >::operator() const T &  a,
const T &  b
const throw ()
 

Compare two values.

-1 is returned if a < b.

0 is returned if a == b.
1 is returned if a > b.