linkedlist.h
// Copyright (c) 1999-2018 David Muse
// See the COPYING file for more information.
#ifndef RUDIMENTS_LINKEDLIST_H
#define RUDIMENTS_LINKEDLIST_H
#include <rudiments/private/linkedlistincludes.h>
template <class valuetype>
class linkedlistnode {
public:
linkedlistnode(valuetype value);
~linkedlistnode();
void setValue(valuetype value);
valuetype getValue() const;
int32_t compare(valuetype value) const;
int32_t compare(linkedlistnode<valuetype> *peer) const;
linkedlistnode<valuetype> *getPrevious();
linkedlistnode<valuetype> *getNext();
void print() const;
#include <rudiments/private/linkedlistnode.h>
};
template < class valuetype >
class linkedlist {
public:
linkedlist();
~linkedlist();
void prepend(valuetype value);
void prepend(linkedlistnode<valuetype> *node);
void append(valuetype value);
void append(linkedlistnode<valuetype> *node);
void insertBefore(linkedlistnode<valuetype> *node,
valuetype value);
void insertBefore(linkedlistnode<valuetype> *node,
linkedlistnode<valuetype> *newnode);
void insertAfter(linkedlistnode<valuetype> *node,
valuetype value);
void insertAfter(linkedlistnode<valuetype> *node,
linkedlistnode<valuetype> *newnode);
void moveBefore(linkedlistnode<valuetype> *node,
linkedlistnode<valuetype> *nodetomove);
void moveAfter(linkedlistnode<valuetype> *node,
linkedlistnode<valuetype> *nodetomove);
void detach(linkedlistnode<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(linkedlistnode<valuetype> *node);
bool removeAndDelete(linkedlistnode<valuetype> *node);
bool removeAndArrayDelete(linkedlistnode<valuetype> *node);
uint64_t getLength() const;
linkedlistnode<valuetype> *getFirst();
linkedlistnode<valuetype> *getLast();
linkedlistnode<valuetype> *getPrevious(
linkedlistnode<valuetype> *node);
linkedlistnode<valuetype> *getNext(
linkedlistnode<valuetype> *node);
linkedlistnode<valuetype> *find(valuetype value);
linkedlistnode<valuetype>
*find(linkedlistnode<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/linkedlist.h>
};
#include <rudiments/private/linkedlistinlines.h>
#endif
linkedlist
Definition: linkedlist.h:60
linkedlist::insertionSort
void insertionSort()
linkedlist::removeAll
bool removeAll(valuetype value)
linkedlist::getLength
uint64_t getLength() const
linkedlist::find
linkedlistnode< valuetype > * find(linkedlistnode< valuetype > *startnode, valuetype value)
linkedlist::removeAllAndArrayDelete
bool removeAllAndArrayDelete(valuetype value)
linkedlist::moveBefore
void moveBefore(linkedlistnode< valuetype > *node, linkedlistnode< valuetype > *nodetomove)
linkedlist::remove
bool remove(linkedlistnode< valuetype > *node)
linkedlist::getPrevious
linkedlistnode< valuetype > * getPrevious(linkedlistnode< valuetype > *node)
linkedlist::moveAfter
void moveAfter(linkedlistnode< valuetype > *node, linkedlistnode< valuetype > *nodetomove)
linkedlist::clear
void clear()
linkedlist::getFirst
linkedlistnode< valuetype > * getFirst()
linkedlist::removeAndArrayDelete
bool removeAndArrayDelete(valuetype value)
linkedlist::print
void print(uint64_t count) const
linkedlist::insertAfter
void insertAfter(linkedlistnode< valuetype > *node, valuetype value)
linkedlist::getNext
linkedlistnode< valuetype > * getNext(linkedlistnode< valuetype > *node)
linkedlist::insertBefore
void insertBefore(linkedlistnode< valuetype > *node, valuetype value)
linkedlist::append
void append(valuetype value)
linkedlist::clearAndDelete
void clearAndDelete()
linkedlist::prepend
void prepend(valuetype value)
linkedlist::find
linkedlistnode< valuetype > * find(valuetype value)
linkedlist::clearAndArrayDelete
void clearAndArrayDelete()
linkedlist::detach
void detach(linkedlistnode< valuetype > *node)
linkedlist::insertBefore
void insertBefore(linkedlistnode< valuetype > *node, linkedlistnode< valuetype > *newnode)
linkedlist::print
void print() const
linkedlist::removeAndArrayDelete
bool removeAndArrayDelete(linkedlistnode< valuetype > *node)
linkedlist::insertAfter
void insertAfter(linkedlistnode< valuetype > *node, linkedlistnode< valuetype > *newnode)
linkedlist::prepend
void prepend(linkedlistnode< valuetype > *node)
linkedlist::removeAllAndDelete
bool removeAllAndDelete(valuetype value)
linkedlist::linkedlist
linkedlist()
linkedlist::~linkedlist
~linkedlist()
linkedlist::getLast
linkedlistnode< valuetype > * getLast()
linkedlist::removeAndDelete
bool removeAndDelete(linkedlistnode< valuetype > *node)
linkedlist::append
void append(linkedlistnode< valuetype > *node)
linkedlist::remove
bool remove(valuetype value)
linkedlist::removeAndDelete
bool removeAndDelete(valuetype value)
linkedlist::heapSort
void heapSort()
linkedlistnode
Definition: linkedlist.h:11
linkedlistnode::getPrevious
linkedlistnode< valuetype > * getPrevious()
linkedlistnode::print
void print() const
linkedlistnode::getValue
valuetype getValue() const
linkedlistnode::setValue
void setValue(valuetype value)
linkedlistnode::compare
int32_t compare(linkedlistnode< valuetype > *peer) const
linkedlistnode::getNext
linkedlistnode< valuetype > * getNext()
linkedlistnode::compare
int32_t compare(valuetype value) const
linkedlistnode::~linkedlistnode
~linkedlistnode()
linkedlistnode::linkedlistnode
linkedlistnode(valuetype value)