18#ifndef __LIB_LIBSTD_LIST_H
19#define __LIB_LIBSTD_LIST_H
87 for (
Node *node = lst.
m_head; node; node = node->next)
350 while (num++ < position)
365 virtual const T &
at(
Size position)
const
371 while (num++ < position)
Represents an item on the List.
Node * prev
Previous node.
Simple linked list template class.
void prepend(T t)
Insert an item at the start of the list.
void append(T t)
Insert an item at the end of the list.
const T first() const
Get the first value as constant.
virtual ~List()
Class destructor.
Node * m_tail
Tail of the list.
Size count() const
Get the number of items on the list.
T first()
Get the first value in the list.
virtual int remove(T t)
Remove all items which are equal to the given item.
const T last() const
Get the last value on the list as constant.
const Node * tail() const
Get the last Node on the List (read-only).
bool operator==(const List< T > &lst) const
Comparison operator.
virtual const T * get(Size position) const
Get a pointer to the item at the given position.
virtual int remove(Node *node)
Removes the given node from the list.
virtual void clear()
Clears the entire List.
Size m_count
Number of items currently in the List.
List(const List< T > &lst)
Copy constructor.
T last()
Get the last value on the list.
const Node * head() const
Get the first Node on the List (read-only).
virtual const T & at(Size position) const
Get a reference to the item at the given position.
List & operator<<(T t)
Append operator.
Node * head()
Get the first Node on the list.
virtual bool contains(const T t) const
Check whether an element is on the List.
virtual bool isEmpty() const
Check if the List is empty.
Node * m_head
Head of the List.
Size size() const
Get the size of the list.
Node * tail()
Get the last Node on the list.
bool operator!=(const List< T > &lst) const
Inequality operator.
Sequences are containers that provide indexed based storage of items.
unsigned int Size
Any sane size indicator cannot go negative.