#include <List.hpp>
Inherits Raul::Deletable.
Public Member Functions | |
void | push_back (Node *elem) |
Add an element to the list. | |
void | push_back (T &elem) |
Add an element to the list. | |
void | append (List< T > &list) |
Append a list to this list. | |
void | clear () |
Clear the list, deleting all Nodes contained (but NOT their contents!). | |
unsigned | size () const |
Valid only in the write thread. | |
bool | empty () |
Valid for any thread. | |
Node * | erase (const iterator iter) |
Remove an element from the list using an iterator. | |
iterator | find (const T &val) |
Find an element in the list. | |
iterator | begin () |
const_iterator | begin () const |
const iterator | end () const |
Classes | |
class | const_iterator |
Realtime safe const iterator for a List. More... | |
class | iterator |
Realtime safe iterator for a List. More... | |
class | Node |
A node in a List. More... |
Elements can be added safely while another thread is reading the list. Like a typical ringbuffer, this is single-reader single-writer threadsafe only. See documentation for specific functions for specifics.
void Raul::List< T >::push_back | ( | Node * | elem | ) |
Add an element to the list.
Thread safe (may be called while another thread is reading the list). Realtime safe.
void Raul::List< T >::push_back | ( | T & | elem | ) |
void Raul::List< T >::append | ( | List< T > & | list | ) |
Append a list to this list.
This operation is fast ( O(1) ). The appended list is not safe to use concurrently with this call.
The appended list will be empty after this call.
Thread safe (may be called while another thread is reading the list). Realtime safe.
void Raul::List< T >::clear | ( | ) |
Clear the list, deleting all Nodes contained (but NOT their contents!).
Not realtime safe.
List< T >::Node * Raul::List< T >::erase | ( | const iterator | iter | ) |
List< T >::iterator Raul::List< T >::find | ( | const T & | val | ) |
Find an element in the list.
This will only return the first element found. If there are duplicated, another call to find() will return the next, etc.