Rudiments
dictionarycollection.h
1// Copyright (c) 1999-2018 David Muse
2// See the COPYING file for more information.
3
4#ifndef RUDIMENTS_DICTIONARYCOLLECTION_H
5#define RUDIMENTS_DICTIONARYCOLLECTION_H
6
7#include <rudiments/collection.h>
8#include <rudiments/linkedlist.h>
9
12template<class keytype, class valuetype>
14 public:
16 virtual const char *getType();
17
28 virtual bool getTrackInsertionOrder()=0;
29
33 virtual void setValue(keytype key, valuetype value)=0;
34
40 virtual void setValues(keytype *key, valuetype *value)=0;
41
47 virtual void setValues(keytype const *key,
48 valuetype const *value)=0;
49
55 virtual void setValues(keytype *key,
56 valuetype *value,
57 uint64_t count)=0;
58
64 virtual void setValues(keytype const *key,
65 valuetype const *value,
66 uint64_t count)=0;
67
71 virtual bool getValue(keytype key, valuetype *value)=0;
72
77 virtual valuetype getValue(keytype key)=0;
78
82 virtual bool getKey(keytype key, keytype *k)=0;
83
88 virtual keytype getKey(keytype key)=0;
89
92
96 virtual bool remove(keytype key)=0;
97
100 virtual ssize_t write();
101
104 virtual ssize_t write(output *out);
105
108 virtual ssize_t writeJson();
109
116 virtual ssize_t writeJson(bool indent);
117
120 virtual ssize_t writeJson(output *out);
121
128 virtual ssize_t writeJson(output *out, bool indent);
129};
130
131#include <rudiments/private/dictionarycollectioninlines.h>
132
133#endif
Definition collection.h:11
Definition dictionarycollection.h:13
virtual void setValues(keytype *key, valuetype *value, uint64_t count)=0
virtual bool getTrackInsertionOrder()=0
virtual valuetype getValue(keytype key)=0
virtual void setValues(keytype const *key, valuetype const *value, uint64_t count)=0
virtual bool getKey(keytype key, keytype *k)=0
virtual void setValues(keytype *key, valuetype *value)=0
virtual bool remove(keytype key)=0
virtual ssize_t writeJson()
Definition dictionarycollectioninlines.h:26
virtual bool getValue(keytype key, valuetype *value)=0
virtual void setValue(keytype key, valuetype value)=0
virtual ssize_t write()
Definition dictionarycollectioninlines.h:14
virtual linkedlist< keytype > * getKeys()=0
virtual void setValues(keytype const *key, valuetype const *value)=0
virtual keytype getKey(keytype key)=0
virtual const char * getType()
Definition dictionarycollectioninlines.h:8
Definition linkedlist.h:47
Definition output.h:11