Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
PartialComparator< T > Class Template Reference

#include </home/casse/Dev/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

◆ compare()

static int 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.

◆ equals()

static bool 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.

◆ greaterThan()

static bool 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.

◆ lessThan()

static bool 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

◆ EQUAL

const int EQUAL = 0x001
static

The bit 0 asserts equality relation.

◆ GREATER

const int GREATER = 0x100
static

The bit 2 asserts the superioritiy relation.

◆ LESS

const int LESS = 0x010
static

The bit 1 asserts the inferiority relation.

◆ UNCOMP

const int UNCOMP = 0x000
static

All bits to zero shows that both values are uncomparable.


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