linkedlist.h
// Copyright (c) 2003 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 removeAll(valuetype value);
bool remove(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 print() const;
void print(uint64_t count) const;
#include <rudiments/private/linkedlist.h>
};
#include <rudiments/private/linkedlistinlines.h>
#endif
linkedlistnode::setValue
void setValue(valuetype value)
linkedlist
Definition: linkedlist.h:60
linkedlistnode::~linkedlistnode
~linkedlistnode()
linkedlistnode::getValue
valuetype getValue() const
linkedlistnode::linkedlistnode
linkedlistnode(valuetype value)
linkedlistnode::getPrevious
linkedlistnode< valuetype > * getPrevious()
linkedlistnode
Definition: linkedlist.h:11
linkedlistnode::compare
int32_t compare(valuetype value) const
linkedlistnode::print
void print() const
linkedlistnode::getNext
linkedlistnode< valuetype > * getNext()