|
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
21 #ifndef ELM_DATA_TREEMAP_H
22 #define ELM_DATA_TREEMAP_H
24 #include <elm/data/TreeBag.h>
25 #include <elm/data/util.h>
30 template <
class K,
class T,
class C = Comparator<K>,
class E = Equiv<T>,
class A = DefaultAlloc >
44 inline bool contains(
const K &k)
const {
return tree.
find(key(k)) !=
nullptr; }
54 inline const T &
item(
void)
const {
return iter.item().snd; }
58 typename tree_t::Iter
iter;
64 inline const T&
get(
const K &key,
const T &
def)
const {
66 return val ? val->
snd :
def;
80 const K &
item(
void)
const {
return iter.item().fst; }
84 typename tree_t::Iter
iter;
98 typename tree_t::Iter
iter;
117 #endif // ELM_DATA_TREEMAP_H
const T & get(const K &key, const T &def) const
Definition: TreeMap.h:64
void remove(const Iter &iter)
Definition: TreeMap.h:107
void next(void)
Definition: TreeMap.h:53
const C & comparator() const
Definition: TreeBag.h:54
Definition: util_WAHVector.cpp:157
A & allocator()
Definition: TreeMap.h:40
void iter(const C &c, const F &f)
Definition: util.h:95
Iterable< I > subiter(const I &b, const I &e)
Definition: util.h:231
iter(word_t *current, t::uint32 size)
Definition: util_WAHVector.cpp:159
void put(const K &key, const T &value)
Definition: TreeMap.h:103
bool ended(void) const
Definition: TreeMap.h:92
int count(void) const
Definition: TreeMap.h:43
void add(const T &x)
Definition: TreeBag.h:121
Pair< T1, T2 > pair(const T1 &v1, const T2 &v2)
Definition: Pair.h:63
T2 snd
Definition: Pair.h:36
void remove(const T &x)
Definition: TreeBag.h:150
Iter begin() const
Definition: TreeBag.h:89
Iter end() const
Definition: TreeBag.h:90
Option< T > get(const K &key) const
Definition: TreeMap.h:68
static Equiv< T > def
Definition: equiv.h:37
bool ended(void) const
Definition: util_WAHVector.cpp:161
const value_t & item(void) const
Definition: TreeMap.h:94
Iterable< PairIter > pairs() const
Definition: TreeMap.h:100
void map(const C &c, const F &f, D &d)
Definition: util.h:89
bool ended(void) const
Definition: TreeMap.h:52
bool equals(const Iter &ii) const
Definition: TreeMap.h:55
Iter(const TreeMap &map)
Definition: TreeMap.h:51
bool contains(const K &k) const
Definition: TreeMap.h:44
TreeMap(const TreeMap< K, T, C > &map)
Definition: TreeMap.h:36
bool hasKey(const K &k) const
Definition: TreeMap.h:72
Iter begin() const
Definition: TreeMap.h:60
int count(void) const
Definition: TreeBag.h:59
void next(void)
Definition: TreeMap.h:93
bool equals(const PairIter &ii) const
Definition: TreeMap.h:95
const OptionalNone none
Definition: util_Option.cpp:154
void next(void)
Definition: TreeMap.h:79
bool isEmpty(void) const
Definition: TreeBag.h:61
bool contains(const T &x) const
Definition: TreeBag.h:60
A & allocator()
Definition: TreeBag.h:56
PairIter(const TreeMap &map)
Definition: TreeMap.h:91
void remove(const K &key)
Definition: TreeMap.h:105
Comparator< K > & comparator()
Definition: TreeMap.h:38
const Comparator< K > & comparator() const
Definition: TreeMap.h:37
E & equivalence()
Definition: TreeMap.h:39
void next(void)
Definition: util_WAHVector.cpp:162
TreeMap()
Definition: TreeMap.h:35
bool isEmpty(void) const
Definition: TreeMap.h:45
Iterable< KeyIter > keys() const
Definition: TreeMap.h:86
bool ended(void) const
Definition: TreeMap.h:78
const T & item(void) const
Definition: TreeMap.h:54
Iter end() const
Definition: TreeMap.h:61
bool equals(const KeyIter &ii) const
Definition: TreeMap.h:81
const K & item(void) const
Definition: TreeMap.h:80
const T * find(const T &x) const
Definition: TreeBag.h:186
KeyIter(const TreeMap &map)
Definition: TreeMap.h:77