singlylinkedlist.h
// Copyright (c) 2014 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 removeAll(valuetype value);
bool remove(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 print() const;
void print(uint64_t count) const;
#include <rudiments/private/singlylinkedlist.h>
};
#include <rudiments/private/singlylinkedlistinlines.h>
#endif
singlylinkedlistnode::getValue
valuetype getValue() const
singlylinkedlistnode::getNext
singlylinkedlistnode< valuetype > * getNext()
singlylinkedlistnode::singlylinkedlistnode
singlylinkedlistnode(valuetype value)
singlylinkedlistnode::print
void print() const
singlylinkedlist
Definition: singlylinkedlist.h:64
singlylinkedlistnode::setValue
void setValue(valuetype value)
singlylinkedlistnode::~singlylinkedlistnode
~singlylinkedlistnode()
singlylinkedlistnode
Definition: singlylinkedlist.h:12
singlylinkedlistnode::compare
int32_t compare(valuetype value) const