Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::concept::PartialComparator< T > Class Template Reference

#include </home/casse/otawa/elm/src/concepts.h>

Static Public Member Functions

static bool equals (const T &v1, const T &v2)
 
static bool greaterThan (const T &v1, const T &v2)
 
static bool lessThan (const T &v1, const T &v2)
 
static int compare (const T &v1, const T &v2)
 

Static Public Attributes

static const int EQUAL = 0x001
 
static const int LESS = 0x010
 
static const int GREATER = 0x100
 
static const int UNCOMP = 0x000
 

Detailed Description

template<class T>
class elm::concept::PartialComparator< T >

This concept is implemented by objects matching a partial order.

Parameters
TType of compared items.

Member Function Documentation

template<class T >
static int elm::concept::PartialComparator< T >::compare ( const T &  v1,
const T &  v2 
)
static

Perform a soft comparison: any value may be compared.

Parameters
v1Value 1 to compare.
v2Value 2 to compare.
Returns
A bit field composed by EQUAL, LESS, GREATER.
template<class T >
static bool elm::concept::PartialComparator< T >::equals ( const T &  v1,
const T &  v2 
)
static

Test for equality.

Parameters
v1Value 1 to compare.
v2Value 2 to compare.
Returns
True if both values are equals, false else.
template<class T >
static bool elm::concept::PartialComparator< T >::greaterThan ( const T &  v1,
const T &  v2 
)
static

Test for greatness.

Parameters
v1Value 1 to compare.
v2Value 2 to compare.
Returns
True if v1 is greater than v2, false else.
template<class T >
static bool elm::concept::PartialComparator< T >::lessThan ( const T &  v1,
const T &  v2 
)
static

Test for lessness.

Parameters
v1Value 1 to compare.
v2Value 2 to compare.
Returns
True if v1 is less than v2, false else.

Member Data Documentation

template<class T >
const int elm::concept::PartialComparator< T >::EQUAL = 0x001
static

The bit 0 asserts equality relation.

template<class T >
const int elm::concept::PartialComparator< T >::GREATER = 0x100
static

The bit 2 asserts the superioritiy relation.

template<class T >
const int elm::concept::PartialComparator< T >::LESS = 0x010
static

The bit 1 asserts the inferiority relation.

template<class T >
const int elm::concept::PartialComparator< T >::UNCOMP = 0x000
static

All bits to zero shows that both values are uncomparable.


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