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

#include <elm/data/Manager.h>

Public Types

typedef T t
 
typedef E equiv_t
 
typedef A alloc_t
 

Public Member Functions

 CompareManager (const C &c=single< C >(), const E &e=single< E >(), A &a=DefaultAllocator::DEFAULT)
 
int compare (const T &v1, const T &v2) const
 
bool equals (const T &v1, const T &v2) const
 
voidallocate (elm::t::size size) const
 
void free (elm::t::ptr p) const
 

Static Public Member Functions

static CompareManager< T, C, E, A > & def ()
 

Public Attributes

const C & cmp
 
const E & eq
 
A & alloc
 

Detailed Description

template<class T, class C = Comparator<T>, class E = Equiv<T>, class A = DefaultAllocator>
class elm::CompareManager< T, C, E, A >

This class is used to control the work of container classes (see Data Structures) supporting lookup and sorting based on comparisons. It embeds two control objects:

  • cmp of type C – used to test for order,
  • alloc – for memory allocation.

It is easily customized by changing the type parameters and by passing objects to the constructor.

Parameters
TType of managed data.
CComparator class (default to Comparator<T>).
AAllocation class (default to DefaultAllocator).

Member Typedef Documentation

◆ alloc_t

typedef A alloc_t

◆ equiv_t

typedef E equiv_t

◆ t

typedef T t

Constructor & Destructor Documentation

◆ CompareManager()

CompareManager ( const C &  c = single<C>(),
const E &  e = single<E>(),
A &  a = DefaultAllocator::DEFAULT 
)
inline

Member Function Documentation

◆ allocate()

void* allocate ( elm::t::size  size) const
inline

◆ compare()

int compare ( const T &  v1,
const T &  v2 
) const
inline

◆ def()

static CompareManager<T, C, E, A>& def ( )
inlinestatic

◆ equals()

bool equals ( const T &  v1,
const T &  v2 
) const
inline

◆ free()

void free ( elm::t::ptr  p) const
inline

Member Data Documentation

◆ alloc

◆ cmp

const C& cmp

◆ eq

const E& eq

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