Rudiments
treecollection.h
1// Copyright (c) 1999-2018 David Muse
2// See the COPYING file for more information.
3
4#ifndef RUDIMENTS_TREECOLLECTION_H
5#define RUDIMENTS_TREECOLLECTION_H
6
7#include <rudiments/nodecollection.h>
8
11template <class valuetype>
12class treenode : public nodecollectionnode<valuetype> {
13 public:
15 virtual void setValue(valuetype value)=0;
16
18 virtual valuetype getValue()=0;
19
21 virtual valuetype &getReference()=0;
22
26
30
34
37
40
45
50
51 #include <rudiments/private/treenode.h>
52};
53
56template <class valuetype>
57class treecollection : public nodecollection<valuetype> {
58 public:
61
65
67 virtual const char *getType();
68
71 virtual void insert(valuetype value)=0;
72
75 virtual void insert(valuetype *value, uint64_t count);
76
80
84
95 virtual bool remove(valuetype value)=0;
96
107 virtual bool removeAll(valuetype value)=0;
108
121
124
128
132
138
144
148
152 virtual treenode<valuetype>
154 valuetype value)=0;
155
158 virtual ssize_t write();
159
161 virtual ssize_t write(output *out);
162
165 virtual ssize_t writeJson();
166
173 virtual ssize_t writeJson(bool indent);
174
177 virtual ssize_t writeJson(output *out);
178
185 virtual ssize_t writeJson(output *out, bool indent);
186
189 virtual ssize_t writeXml();
190
197 virtual ssize_t writeXml(bool indent);
198
201 virtual ssize_t writeXml(output *out);
202
209 virtual ssize_t writeXml(output *out, bool indent);
210
211 #include <rudiments/private/treecollection.h>
212};
213
214#include <rudiments/private/treecollectioninlines.h>
215
216#endif
Definition avltree.h:11
Definition nodecollection.h:31
Definition nodecollection.h:12
Definition output.h:11
Definition treecollection.h:57
treecollection()
Definition treecollectioninlines.h:6
virtual treenode< valuetype > * getPrevious(treenode< valuetype > *node)=0
virtual treenode< valuetype > * find(valuetype value)=0
virtual bool remove(valuetype value)=0
virtual bool removeAll(valuetype value)=0
virtual ssize_t writeXml()
Definition treecollectioninlines.h:69
virtual void insert(valuetype value)=0
virtual treenode< valuetype > * find(treenode< valuetype > *startnode, valuetype value)=0
virtual ssize_t writeJson()
Definition treecollectioninlines.h:44
virtual treenode< valuetype > * getTop()=0
virtual treenode< valuetype > * detach(treenode< valuetype > *node)=0
virtual void insert(treenode< valuetype > *node)=0
virtual bool remove(treenode< valuetype > *node)=0
virtual treenode< valuetype > * getNext(treenode< valuetype > *node)=0
virtual treenode< valuetype > * getFirst()=0
virtual treenode< valuetype > * getLast()=0
virtual ssize_t write()
Definition treecollectioninlines.h:31
virtual const char * getType()
Definition treecollectioninlines.h:17
Definition treecollection.h:12
virtual valuetype & getReference()=0
virtual treenode< valuetype > * getPrevious()=0
virtual uint8_t getRightHeight()=0
virtual treenode< valuetype > * getLeftChild()=0
virtual void setValue(valuetype value)=0
virtual valuetype getValue()=0
virtual treenode< valuetype > * getParent()=0
virtual treenode< valuetype > * getNext()=0
virtual uint8_t getLeftHeight()=0
virtual treenode< valuetype > * getRightChild()=0