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 
11 template <class valuetype>
13  public:
16  singlylinkedlistnode(valuetype value);
17 
22 
24  void setValue(valuetype value);
25 
27  valuetype getValue() const;
28 
32  int32_t compare(valuetype value) const;
33 
38  int32_t compare(singlylinkedlistnode<valuetype> *peer) const;
39 
43 
45  void print() const;
46 
47  #include <rudiments/private/singlylinkedlistnode.h>
48 };
49 
63 template < class valuetype >
65  public:
68 
74 
77  void prepend(valuetype value);
78 
82 
85  void append(valuetype value);
86 
90 
94  valuetype value);
95 
100 
108  singlylinkedlistnode<valuetype> *nodetomove);
109 
116 
124  bool remove(valuetype value);
125 
134  bool removeAndDelete(valuetype value);
135 
144  bool removeAndArrayDelete(valuetype value);
145 
153  bool removeAll(valuetype value);
154 
162  bool removeAllAndDelete(valuetype value);
163 
172  bool removeAllAndArrayDelete(valuetype value);
173 
183 
193  bool removeAndDelete(
195 
208 
210  uint64_t getLength() const;
211 
214 
217 
223 
226  singlylinkedlistnode<valuetype> *find(valuetype value);
227 
233  valuetype value);
234 
238  void insertionSort();
239 
244  void heapSort();
245 
249  void clear();
250 
254  void clearAndDelete();
255 
260  void clearAndArrayDelete();
261 
263  void print() const;
264 
267  void print(uint64_t count) const;
268 
269  #include <rudiments/private/singlylinkedlist.h>
270 };
271 
272 
273 #include <rudiments/private/singlylinkedlistinlines.h>
274 
275 #endif
singlylinkedlistnode< valuetype > * getNext()
singlylinkedlistnode(valuetype value)
bool removeAndArrayDelete(valuetype value)
singlylinkedlistnode< valuetype > * getNext(singlylinkedlistnode< valuetype > *node)
void append(valuetype value)
bool removeAndDelete(valuetype value)
bool removeAll(valuetype value)
int32_t compare(valuetype value) const
Definition: singlylinkedlist.h:64
singlylinkedlistnode< valuetype > * getFirst()
singlylinkedlistnode< valuetype > * find(valuetype value)
void setValue(valuetype value)
void prepend(valuetype value)
void moveAfter(singlylinkedlistnode< valuetype > *node, singlylinkedlistnode< valuetype > *nodetomove)
valuetype getValue() const
bool remove(valuetype value)
Definition: singlylinkedlist.h:12
void clearAndArrayDelete()
bool removeAllAndArrayDelete(valuetype value)
void detach(singlylinkedlistnode< valuetype > *node)
void insertAfter(singlylinkedlistnode< valuetype > *node, valuetype value)
void print() const
void print() const
bool removeAllAndDelete(valuetype value)
singlylinkedlistnode< valuetype > * getLast()
uint64_t getLength() const