|
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
21 #ifndef ELM_DATA_MANAGER_H_
22 #define ELM_DATA_MANAGER_H_
24 #include <elm/alloc/DefaultAllocator.h>
25 #include <elm/compare.h>
27 #include <elm/equiv.h>
28 #include <elm/types.h>
33 template <
class T,
class E = Equiv<T>,
class A = DefaultAllocator>
41 inline bool equals(
const T& v1,
const T& v2)
const {
return eq.isEqual(v1, v2); }
52 template <
class T,
class C = Comparator<T>,
class E = Equiv<T>,
class A = DefaultAllocator>
62 inline int compare(
const T& v1,
const T& v2)
const {
return cmp.doCompare(v1, v2); }
63 inline bool equals(
const T& v1,
const T& v2)
const {
return eq.isEqual(v1, v2); }
76 template <
class K,
class H = HashKey<K>,
class A = DefaultAllocator>
85 inline bool isEqual(
const K& k1,
const K& k2)
const {
return hash.isEqual(k1, k2); }
87 template <
class T>
inline void *
allocate() {
return alloc.allocate(
sizeof(T)); }
99 template <
class T,
class A = IdAdapter<T>,
class C = Comparator<T>,
class TC = Comparator<T>,
class A = DefaultAllocator>
100 class KeyCompareManager {
static EquivManager< T, E, A > & def()
Definition: Manager.h:45
Printable< T, M > p(const T &data, const M &man)
Definition: Output.h:302
void * allocate(elm::t::size size) const
Definition: Manager.h:64
HashManager(void)
Definition: Manager.h:82
H hash
Definition: Manager.h:92
void free(void *p)
Definition: Manager.h:88
void * allocate()
Definition: Manager.h:87
bool equals(const T &v1, const T &v2) const
Definition: Manager.h:41
E equiv_t
Definition: Manager.h:36
CompareManager(const C &c=single< C >(), const E &e=single< E >(), A &a=DefaultAllocator::DEFAULT)
Definition: Manager.h:59
E & eq
Definition: Manager.h:47
int compare(const T &v1, const T &v2) const
Definition: Manager.h:62
HashManager(const H &h, A &a=DefaultAllocator::DEFAULT)
Definition: Manager.h:83
bool equals(const T &v1, const T &v2) const
Definition: Manager.h:63
void free(t::ptr p) const
Definition: Manager.h:43
static HashManager< K, H, A > & def()
Definition: Manager.h:90
t::hash computeHash(const K &k) const
Definition: Manager.h:86
A alloc_t
Definition: Manager.h:80
uint64 size
Definition: arch.h:35
Definition: DefaultAllocator.h:39
static DefaultAllocator DEFAULT
Definition: DefaultAllocator.h:41
void free(elm::t::ptr p) const
Definition: Manager.h:65
A & alloc
Definition: Manager.h:48
A & alloc
Definition: Manager.h:71
bool isEqual(const K &k1, const K &k2) const
Definition: Manager.h:85
static CompareManager< T, C, E, A > & def()
Definition: Manager.h:67
A alloc_t
Definition: Manager.h:37
const C & cmp
Definition: Manager.h:69
H hash_t
Definition: Manager.h:79
T t
Definition: Manager.h:55
t::intptr hash
Definition: hash.h:34
const E & eq
Definition: Manager.h:70
A & alloc
Definition: Manager.h:93
A alloc_t
Definition: Manager.h:57
EquivManager(E &e=single< E >(), A &a=A::DEFAULT)
Definition: Manager.h:39
E equiv_t
Definition: Manager.h:56
void * allocate(t::size size) const
Definition: Manager.h:42