Qore Programming Language
0.8.11
|
templated class for a double-ended singly-linked list that can be safely read from multiple threads without locking as long as writes are locked More...
Public Member Functions | |
DLLLOCAL iterator | begin () |
returns an iterator pointing to the first element of the list | |
DLLLOCAL const_iterator | begin () const |
returns an iterator pointing to the first element of the list | |
DLLLOCAL void | clear () |
empties the list | |
DLLLOCAL bool | empty () const |
returns true if the list is empty | |
DLLLOCAL iterator | end () |
returns an iterator pointing one element from the end of the list | |
DLLLOCAL const_iterator | end () const |
returns an iterator pointing one element from the end of the list | |
DLLLOCAL void | erase (iterator i) |
deletes the list element given by the iterator argument More... | |
DLLLOCAL void | erase_to_end (iterator i) |
deletes the list element after the iterator argument and all other elements to the end of the list More... | |
DLLLOCAL iterator | find (T data) |
returns an iterator either pointing to the element given if present in the list or pointing to one element from the end of the list if not | |
DLLLOCAL const_iterator | find (T data) const |
returns an iterator either pointing to the element given if present in the list or pointing to one element from the end of the list if not | |
DLLLOCAL iterator | last () |
returns an iterator pointing to the last element in the list | |
DLLLOCAL const_iterator | last () const |
returns an iterator pointing to the last element in the list | |
DLLLOCAL bool | plural () const |
returns true if the list contains more than one element (constant time) | |
DLLLOCAL void | pop_front () |
removes an element from the beginning of the list | |
DLLLOCAL void | populate (self_t &other) |
concatenates all elements of this list to the end of the list passed | |
DLLLOCAL void | populate (self_t *other) |
concatenates all elements of this list to the end of the list passed | |
DLLLOCAL void | push_back (T data) |
adds an element to the end of the list (constant time) | |
DLLLOCAL void | push_front (T data) |
adds an element to the beginning of the list (constant time) | |
DLLLOCAL bool | singular () const |
returns true if the list contains only one element (constant time) | |
templated class for a double-ended singly-linked list that can be safely read from multiple threads without locking as long as writes are locked
Reading in multiple threads is safe as long as writes (appends at the end or beginning) are locked. Implements a singly-linked list with constant-time inserts at the beginning and end that can be read in a multi-threaded context without locking. Writes must be performed in a lock; however this class does not provide any locking; locking must be provided and performed externally to the class. Provides an STL-like interface.
|
inline |
deletes the list element given by the iterator argument
only constant time for the first element in the list, otherwise is O(n), linear with the length of the list
|
inline |
deletes the list element after the iterator argument and all other elements to the end of the list
O(n) where n=length of list after the element given