Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::StdComparer< E > Class Template Reference

Standard comparer (valid as a static comparer). More...

#include <ogdf/basic/comparer.h>

Static Public Member Functions

static bool equal (const E &x, const E &y)
 
static bool geq (const E &x, const E &y)
 
static bool greater (const E &x, const E &y)
 
static bool leq (const E &x, const E &y)
 
static bool less (const E &x, const E &y)
 

Detailed Description

template<typename E>
class ogdf::StdComparer< E >

Standard comparer (valid as a static comparer).

Standard comparers are used by some sorting and searching methods. The implementation of the generic class only provides dummies that always throw a NoStdComparerException.

The compare operations are static, hence the StdComparer cannot only be used as a comparer object, but also as a static comparer when required.

You need to specialize this class for types you want to use with sorting and searching methods like quicksort and binary search. There already exist specializations for several standard types. If your type already provides compare operators, you can use the macro OGDF_STD_COMPARER to automatically generate the specialization based on these operators.

Definition at line 40 of file comparer.h.

Member Function Documentation

◆ equal()

template<typename E >
static bool ogdf::StdComparer< E >::equal ( const E &  x,
const E &  y 
)
inlinestatic

Definition at line 73 of file comparer.h.

◆ geq()

template<typename E >
static bool ogdf::StdComparer< E >::geq ( const E &  x,
const E &  y 
)
inlinestatic

Definition at line 71 of file comparer.h.

◆ greater()

template<typename E >
static bool ogdf::StdComparer< E >::greater ( const E &  x,
const E &  y 
)
inlinestatic

Definition at line 69 of file comparer.h.

◆ leq()

template<typename E >
static bool ogdf::StdComparer< E >::leq ( const E &  x,
const E &  y 
)
inlinestatic

Definition at line 67 of file comparer.h.

◆ less()

template<typename E >
static bool ogdf::StdComparer< E >::less ( const E &  x,
const E &  y 
)
inlinestatic

Definition at line 65 of file comparer.h.


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