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 
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 
195 
208 
210  uint64_t getLength() const;
211 
214 
217 
223 
227 
233  valuetype value);
234 
239 
244  void heapSort();
245 
249  void clear();
250 
255 
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
Definition: singlylinkedlist.h:64
uint64_t getLength() const
singlylinkedlistnode< valuetype > * getFirst()
void detach(singlylinkedlistnode< valuetype > *node)
bool remove(singlylinkedlistnode< valuetype > *node)
singlylinkedlistnode< valuetype > * find(singlylinkedlistnode< valuetype > *startnode, valuetype value)
bool removeAllAndArrayDelete(valuetype value)
void prepend(valuetype value)
bool removeAndArrayDelete(valuetype value)
void moveAfter(singlylinkedlistnode< valuetype > *node, singlylinkedlistnode< valuetype > *nodetomove)
singlylinkedlistnode< valuetype > * getLast()
void append(valuetype value)
void insertAfter(singlylinkedlistnode< valuetype > *node, valuetype value)
singlylinkedlistnode< valuetype > * find(valuetype value)
void append(singlylinkedlistnode< valuetype > *node)
bool removeAndArrayDelete(singlylinkedlistnode< valuetype > *node)
void print() const
void print(uint64_t count) const
void clearAndArrayDelete()
bool removeAll(valuetype value)
void prepend(singlylinkedlistnode< valuetype > *node)
void insertAfter(singlylinkedlistnode< valuetype > *node, singlylinkedlistnode< valuetype > *newnode)
bool removeAndDelete(valuetype value)
bool remove(valuetype value)
bool removeAndDelete(singlylinkedlistnode< valuetype > *node)
bool removeAllAndDelete(valuetype value)
singlylinkedlistnode< valuetype > * getNext(singlylinkedlistnode< valuetype > *node)
Definition: singlylinkedlist.h:12
int32_t compare(singlylinkedlistnode< valuetype > *peer) const
valuetype getValue() const
int32_t compare(valuetype value) const
singlylinkedlistnode(valuetype value)
void print() const
singlylinkedlistnode< valuetype > * getNext()
void setValue(valuetype value)