4#include <rudiments/stdio.h>
5#include <rudiments/private/nodeinlines.h>
7template <
class keytype,
class valuetype>
24template <
class keytype,
class valuetype>
30template <
class keytype,
class valuetype>
34 trackinsertionorder(true),
38 tree.setComparator(comp);
40#ifdef DARWIN_GCC_2952_HACKS
57template <
class keytype,
class valuetype>
67#ifdef DARWIN_GCC_2952_HACKS
76template <
class keytype,
class valuetype>
86#ifdef DARWIN_GCC_2952_HACKS
95template <
class keytype,
class valuetype>
107template <
class keytype,
class valuetype>
119template <
class keytype,
class valuetype>
123 trackinsertionorder=
a->getTrackInsertionOrder();
126 tree.setComparator(comp);
136 bool managekeys=this->getManageKeys();
137 bool managearraykeys=this->getManageArrayKeys();
138 bool managevalues=this->getManageValues();
139 bool managearrayvalues=this->getManageArrayValues();
144 managekeys,managearraykeys),
145 node_duplicate_value(
147 managevalues,managearrayvalues));
156template <
class keytype,
class valuetype>
161 trackinsertionorder=
a->getTrackInsertionOrder();
164 tree.setComparator(comp);
166 bool managekeys=this->getManageKeys();
167 bool managearraykeys=this->getManageArrayKeys();
168 bool managevalues=this->getManageValues();
169 bool managearrayvalues=this->getManageArrayValues();
175 managekeys,managearraykeys),
176 node_duplicate_value(&value,
177 managevalues,managearrayvalues));
185template <
class keytype,
class valuetype>
192template <
class keytype,
class valuetype>
195 bool trackinsertionorder) {
196 if (!tree.getCount()) {
197 this->trackinsertionorder=trackinsertionorder;
203template <
class keytype,
class valuetype>
206 return trackinsertionorder;
209template <
class keytype,
class valuetype>
218 if (trackinsertionorder) {
224template <
class keytype,
class valuetype>
237template <
class keytype,
class valuetype>
241 if (
keys && values) {
252template <
class keytype,
class valuetype>
257 if (
keys && values) {
260 for (uint64_t
i=0;
i<count;
i++) {
268template <
class keytype,
class valuetype>
273 if (
keys && values) {
276 for (uint64_t
i=0;
i<count;
i++) {
284template <
class keytype,
class valuetype>
289 if (
dict->trackinsertionorder) {
307template <
class keytype,
class valuetype>
319template <
class keytype,
class valuetype>
329template <
class keytype,
class valuetype>
340template <
class keytype,
class valuetype>
344 if (getKey(key,&
k)) {
350template <
class keytype,
class valuetype>
361template <
class keytype,
class valuetype>
366 if (trackinsertionorder) {
380template <
class keytype,
class valuetype>
383 return tree.getCount();
386template <
class keytype,
class valuetype>
391 if (trackinsertionorder) {
395 this->getManageKeys(),
396 this->getManageArrayKeys());
398 this->getManageValues(),
399 this->getManageArrayValues());
401 return tree.remove(
tnode);
406template <
class keytype,
class valuetype>
409 bool managekeys=this->getManageKeys();
410 bool managearraykeys=this->getManageArrayKeys();
411 bool managevalues=this->getManageValues();
412 bool managearrayvalues=this->getManageArrayValues();
416 managekeys,managearraykeys);
418 managevalues,managearrayvalues);
428template <
class keytype,
class valuetype>
433 return tree.find(&
fnode);
436template <
class keytype,
class valuetype>
445template <
class keytype,
class valuetype>
451template <
class keytype,
class valuetype>
457template <
class keytype,
class valuetype>
463template <
class keytype,
class valuetype>
469template <
class keytype,
class valuetype>
475template <
class keytype,
class valuetype>
481template <
class keytype,
class valuetype>
avltreenode(valuetype value)
Definition avltreeinlines.h:555
treenode< valuetype > * getNext()
Definition avltreeinlines.h:671
valuetype getValue()
Definition avltreeinlines.h:578
void setValue(valuetype value)
Definition avltreeinlines.h:572
collection & operator=(collection &c)
Definition collectioninlines.h:30
Definition comparator.h:11
virtual int32_t compare(char *value1, char *value2)
Definition comparatorinlines.h:61
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
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 dictionaryinlines.h:8
Definition dictionaryinlines.h:25
int32_t compare(object *value1, object *value2)
Definition dictionaryinlines.h:483
Definition listcollection.h:12
Definition treecollection.h:12