Rudiments
dictionary.h
1// Copyright (c) 1999-2018 David Muse
2// See the COPYING file for more information.
3
4#ifndef RUDIMENTS_DICTIONARY_H
5#define RUDIMENTS_DICTIONARY_H
6
7#include <rudiments/private/dictionaryincludes.h>
8
11template <class keytype, class valuetype>
12class dictionary : public dictionarycollection<keytype,valuetype> {
13 public:
15 dictionary();
16
27 dictionary(bool trackinsertionorder);
28
32
36
41
46
57
77 bool setTrackInsertionOrder(bool trackinsertionorder);
78
90
94 void setValue(keytype key, valuetype value);
95
101 void setValues(keytype *keys, valuetype *values);
102
108 void setValues(keytype const *keys, valuetype const *values);
109
115 void setValues(keytype *keys, valuetype *values,
116 uint64_t count);
117
123 void setValues(keytype const *keys, valuetype const *values,
124 uint64_t count);
125
131
135 bool getValue(keytype key, valuetype *value);
136
141 valuetype getValue(keytype key);
142
146 bool getKey(keytype key, keytype *k);
147
152 keytype getKey(keytype key);
153
156
158 uint64_t getCount();
159
171 bool remove(keytype key);
172
188 bool clear();
189
190 #include <rudiments/private/dictionary.h>
191};
192
193#include <rudiments/private/dictionaryinlines.h>
194
195#endif
Definition dictionary.h:12
dictionary< keytype, valuetype > & operator=(dictionary< keytype, valuetype > &a)
Definition dictionaryinlines.h:98
bool getTrackInsertionOrder()
Definition dictionaryinlines.h:205
bool setTrackInsertionOrder(bool trackinsertionorder)
Definition dictionaryinlines.h:194
dictionary(bool trackinsertionorder)
bool clear()
Definition dictionaryinlines.h:408
bool getValue(keytype key, valuetype *value)
Definition dictionaryinlines.h:309
uint64_t getCount()
Definition dictionaryinlines.h:382
linkedlist< keytype > * getKeys()
Definition dictionaryinlines.h:363
bool getKey(keytype key, keytype *k)
Definition dictionaryinlines.h:331
void setValue(keytype key, valuetype value)
Definition dictionaryinlines.h:211
void setValues(keytype *keys, valuetype *values)
Definition dictionaryinlines.h:226
~dictionary()
Definition dictionaryinlines.h:187
bool remove(keytype key)
Definition dictionaryinlines.h:388
dictionary()
Definition dictionaryinlines.h:32
Definition dictionarycollection.h:13
Definition linkedlist.h:47