Rudiments
singlylinkedlist.h
1// Copyright (c) 1999-2018 David Muse
2// See the COPYING file for more information.
3
4#ifndef RUDIMENTS_SINGLYLINKEDLIST_H
5#define RUDIMENTS_SINGLYLINKEDLIST_H
6
7#include <rudiments/private/singlylinkedlistincludes.h>
8
11template <class valuetype>
12class singlylinkedlistnode : public listnode<valuetype> {
13 public:
17
20
22 void setValue(valuetype value);
23
26
29
32
36
37 #include <rudiments/private/singlylinkedlistnode.h>
38};
39
53template <class valuetype>
54class singlylinkedlist : public listcollection<valuetype> {
55 public:
58
62
66
71
76
84
87 void prepend(valuetype value);
88
92
95 void append(valuetype value);
96
100
104
109
118
125
137 bool remove(valuetype value);
138
150 bool removeAll(valuetype value);
151
165
168
171
174
180
184
189 valuetype value);
190
204 void sortInexpensively();
205
220 void sortQuickly();
221
230 bool clear();
231
232 #include <rudiments/private/singlylinkedlist.h>
233};
234
235
236#include <rudiments/private/singlylinkedlistinlines.h>
237
238#endif
Definition avltree.h:11
Definition listcollection.h:37
Definition listcollection.h:12
Definition singlylinkedlist.h:54
uint64_t getCount()
Definition singlylinkedlistinlines.h:352
listnode< valuetype > * getFirst()
Definition singlylinkedlistinlines.h:358
void detach(listnode< valuetype > *node)
Definition singlylinkedlistinlines.h:194
singlylinkedlist< valuetype > & operator=(singlylinkedlist< valuetype > &a)
Definition singlylinkedlistinlines.h:47
void prepend(valuetype value)
Definition singlylinkedlistinlines.h:94
void sortInexpensively()
Definition singlylinkedlistinlines.h:398
singlylinkedlist()
Definition singlylinkedlistinlines.h:9
listnode< valuetype > * getNext(listnode< valuetype > *node)
Definition singlylinkedlistinlines.h:370
bool clear()
Definition singlylinkedlistinlines.h:621
void append(valuetype value)
Definition singlylinkedlistinlines.h:115
void insertAfter(listnode< valuetype > *node, valuetype value)
Definition singlylinkedlistinlines.h:136
listnode< valuetype > * getLast()
Definition singlylinkedlistinlines.h:364
void moveAfter(listnode< valuetype > *node, listnode< valuetype > *nodetomove)
Definition singlylinkedlistinlines.h:160
bool removeAll(valuetype value)
Definition singlylinkedlistinlines.h:259
void sortQuickly()
Definition singlylinkedlistinlines.h:482
bool remove(valuetype value)
Definition singlylinkedlistinlines.h:221
listnode< valuetype > * find(valuetype value)
Definition singlylinkedlistinlines.h:377
~singlylinkedlist()
Definition singlylinkedlistinlines.h:88
Definition singlylinkedlist.h:12
valuetype getValue()
Definition singlylinkedlistinlines.h:660
valuetype & getReference()
Definition singlylinkedlistinlines.h:666
listnode< valuetype > * getNext()
Definition singlylinkedlistinlines.h:678
singlylinkedlistnode(valuetype value)
Definition singlylinkedlistinlines.h:641
listnode< valuetype > * getPrevious()
Definition singlylinkedlistinlines.h:672
void setValue(valuetype value)
Definition singlylinkedlistinlines.h:654
~singlylinkedlistnode()
Definition singlylinkedlistinlines.h:649