singlylinkedlist.h
// Copyright (c) 1999-2018 David Muse
// See the COPYING file for more information.
#ifndef RUDIMENTS_SINGLYLINKEDLIST_H
#define RUDIMENTS_SINGLYLINKEDLIST_H
#include <rudiments/private/singlylinkedlistincludes.h>
template <class valuetype>
class singlylinkedlistnode {
public:
singlylinkedlistnode(valuetype value);
~singlylinkedlistnode();
void setValue(valuetype value);
valuetype getValue() const;
int32_t compare(valuetype value) const;
int32_t compare(singlylinkedlistnode<valuetype> *peer) const;
singlylinkedlistnode<valuetype> *getNext();
void print() const;
#include <rudiments/private/singlylinkedlistnode.h>
};
template < class valuetype >
class singlylinkedlist {
public:
singlylinkedlist();
~singlylinkedlist();
void prepend(valuetype value);
void prepend(singlylinkedlistnode<valuetype> *node);
void append(valuetype value);
void append(singlylinkedlistnode<valuetype> *node);
void insertAfter(singlylinkedlistnode<valuetype> *node,
valuetype value);
void insertAfter(singlylinkedlistnode<valuetype> *node,
singlylinkedlistnode<valuetype> *newnode);
void moveAfter(singlylinkedlistnode<valuetype> *node,
singlylinkedlistnode<valuetype> *nodetomove);
void detach(singlylinkedlistnode<valuetype> *node);
bool remove(valuetype value);
bool removeAndDelete(valuetype value);
bool removeAndArrayDelete(valuetype value);
bool removeAll(valuetype value);
bool removeAllAndDelete(valuetype value);
bool removeAllAndArrayDelete(valuetype value);
bool remove(singlylinkedlistnode<valuetype> *node);
bool removeAndDelete(
singlylinkedlistnode<valuetype> *node);
bool removeAndArrayDelete(
singlylinkedlistnode<valuetype> *node);
uint64_t getLength() const;
singlylinkedlistnode<valuetype> *getFirst();
singlylinkedlistnode<valuetype> *getLast();
singlylinkedlistnode<valuetype> *getNext(
singlylinkedlistnode<valuetype> *node);
singlylinkedlistnode<valuetype> *find(valuetype value);
singlylinkedlistnode<valuetype>
*find(singlylinkedlistnode<valuetype> *startnode,
valuetype value);
void insertionSort();
void heapSort();
void clear();
void clearAndDelete();
void clearAndArrayDelete();
void print() const;
void print(uint64_t count) const;
#include <rudiments/private/singlylinkedlist.h>
};
#include <rudiments/private/singlylinkedlistinlines.h>
#endif
singlylinkedlist
Definition: singlylinkedlist.h:64
singlylinkedlist::getLength
uint64_t getLength() const
singlylinkedlist::insertionSort
void insertionSort()
singlylinkedlist::getFirst
singlylinkedlistnode< valuetype > * getFirst()
singlylinkedlist::detach
void detach(singlylinkedlistnode< valuetype > *node)
singlylinkedlist::remove
bool remove(singlylinkedlistnode< valuetype > *node)
singlylinkedlist::find
singlylinkedlistnode< valuetype > * find(singlylinkedlistnode< valuetype > *startnode, valuetype value)
singlylinkedlist::removeAllAndArrayDelete
bool removeAllAndArrayDelete(valuetype value)
singlylinkedlist::prepend
void prepend(valuetype value)
singlylinkedlist::singlylinkedlist
singlylinkedlist()
singlylinkedlist::removeAndArrayDelete
bool removeAndArrayDelete(valuetype value)
singlylinkedlist::moveAfter
void moveAfter(singlylinkedlistnode< valuetype > *node, singlylinkedlistnode< valuetype > *nodetomove)
singlylinkedlist::getLast
singlylinkedlistnode< valuetype > * getLast()
singlylinkedlist::append
void append(valuetype value)
singlylinkedlist::insertAfter
void insertAfter(singlylinkedlistnode< valuetype > *node, valuetype value)
singlylinkedlist::find
singlylinkedlistnode< valuetype > * find(valuetype value)
singlylinkedlist::append
void append(singlylinkedlistnode< valuetype > *node)
singlylinkedlist::clear
void clear()
singlylinkedlist::removeAndArrayDelete
bool removeAndArrayDelete(singlylinkedlistnode< valuetype > *node)
singlylinkedlist::print
void print() const
singlylinkedlist::print
void print(uint64_t count) const
singlylinkedlist::heapSort
void heapSort()
singlylinkedlist::clearAndArrayDelete
void clearAndArrayDelete()
singlylinkedlist::removeAll
bool removeAll(valuetype value)
singlylinkedlist::prepend
void prepend(singlylinkedlistnode< valuetype > *node)
singlylinkedlist::insertAfter
void insertAfter(singlylinkedlistnode< valuetype > *node, singlylinkedlistnode< valuetype > *newnode)
singlylinkedlist::removeAndDelete
bool removeAndDelete(valuetype value)
singlylinkedlist::remove
bool remove(valuetype value)
singlylinkedlist::clearAndDelete
void clearAndDelete()
singlylinkedlist::~singlylinkedlist
~singlylinkedlist()
singlylinkedlist::removeAndDelete
bool removeAndDelete(singlylinkedlistnode< valuetype > *node)
singlylinkedlist::removeAllAndDelete
bool removeAllAndDelete(valuetype value)
singlylinkedlist::getNext
singlylinkedlistnode< valuetype > * getNext(singlylinkedlistnode< valuetype > *node)
singlylinkedlistnode
Definition: singlylinkedlist.h:12
singlylinkedlistnode::compare
int32_t compare(singlylinkedlistnode< valuetype > *peer) const
singlylinkedlistnode::getValue
valuetype getValue() const
singlylinkedlistnode::compare
int32_t compare(valuetype value) const
singlylinkedlistnode::singlylinkedlistnode
singlylinkedlistnode(valuetype value)
singlylinkedlistnode::print
void print() const
singlylinkedlistnode::getNext
singlylinkedlistnode< valuetype > * getNext()
singlylinkedlistnode::setValue
void setValue(valuetype value)
singlylinkedlistnode::~singlylinkedlistnode
~singlylinkedlistnode()