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