Definition at line 78 of file qlinkedlist.h.
#include <qlinkedlist.h>
Classes |
|
| class | const_iterator |
| class | iterator |
Public Types |
|
| typedef iterator | Iterator |
| typedef const_iterator | ConstIterator |
| typedef int | size_type |
| typedef T | value_type |
| typedef value_type * | pointer |
| typedef const value_type * | const_pointer |
| typedef value_type & | reference |
| typedef const value_type & | const_reference |
| typedef qptrdiff | difference_type |
Public Member Functions |
|
| QLinkedList () | |
| QLinkedList (const QLinkedList< T > &l) | |
| ~QLinkedList () | |
| QLinkedList< T > & | operator= (const QLinkedList< T > &) |
| bool | operator== (const QLinkedList< T > &l) const |
| bool | operator!= (const QLinkedList< T > &l) const |
| int | size () const |
| void | detach () |
| bool | isDetached () const |
| void | setSharable (bool sharable) |
| bool | isSharedWith (const QLinkedList< T > &other) const |
| bool | isEmpty () const |
| void | clear () |
| void | append (const T &) |
| void | prepend (const T &) |
| T | takeFirst () |
| T | takeLast () |
| int | removeAll (const T &t) |
| bool | removeOne (const T &t) |
| bool | contains (const T &t) const |
| int | count (const T &t) const |
| iterator | begin () |
| const_iterator | begin () const |
| const_iterator | constBegin () const |
| iterator | end () |
| const_iterator | end () const |
| const_iterator | constEnd () const |
| iterator | insert (iterator before, const T &t) |
| iterator | erase (iterator pos) |
| iterator | erase (iterator first, iterator last) |
| int | count () const |
| T & | first () |
| const T & | first () const |
| T & | last () |
| const T & | last () const |
| void | removeFirst () |
| void | removeLast () |
| bool | startsWith (const T &t) const |
| bool | endsWith (const T &t) const |
| void | push_back (const T &t) |
| void | push_front (const T &t) |
| T & | front () |
| const T & | front () const |
| T & | back () |
| const T & | back () const |
| void | pop_front () |
| void | pop_back () |
| bool | empty () const |
| std::list< T > | toStdList () const |
| QLinkedList< T > & | operator+= (const QLinkedList< T > &l) |
| QLinkedList< T > | operator+ (const QLinkedList< T > &l) const |
| QLinkedList< T > & | operator+= (const T &t) |
| QLinkedList< T > & | operator<< (const T &t) |
| QLinkedList< T > & | operator<< (const QLinkedList< T > &l) |
Static Public Member Functions |
|
| static QLinkedList< T > | fromStdList (const std::list< T > &list) |
Friends |
|
| class | iterator |
| class | const_iterator |
Definition at line 188 of file qlinkedlist.h.
| typedef const_iterator ConstIterator |
Definition at line 189 of file qlinkedlist.h.
| typedef int size_type |
Definition at line 210 of file qlinkedlist.h.
| typedef T value_type |
Definition at line 211 of file qlinkedlist.h.
| typedef value_type* pointer |
Definition at line 212 of file qlinkedlist.h.
| typedef const value_type* const_pointer |
Definition at line 213 of file qlinkedlist.h.
| typedef value_type& reference |
Definition at line 214 of file qlinkedlist.h.
| typedef const value_type& const_reference |
Definition at line 215 of file qlinkedlist.h.
| typedef qptrdiff difference_type |
Definition at line 216 of file qlinkedlist.h.
| QLinkedList | ( | ) | [inline] |
Definition at line 84 of file qlinkedlist.h.
: d(&QLinkedListData::shared_null) { d->ref.ref(); }
| QLinkedList | ( | const QLinkedList< T > & | l | ) | [inline] |
| ~QLinkedList | ( | ) | [inline] |
| QLinkedList< T > & operator= | ( | const QLinkedList< T > & | l | ) |
| bool operator== | ( | const QLinkedList< T > & | l | ) | const |
| bool operator!= | ( | const QLinkedList< T > & | l | ) | const [inline] |
Definition at line 89 of file qlinkedlist.h.
{ return !(*this == l); }
| int size | ( | ) | const [inline] |
| void detach | ( | ) | [inline] |
Definition at line 92 of file qlinkedlist.h.
| bool isDetached | ( | ) | const [inline] |
| void setSharable | ( | bool | sharable | ) | [inline] |
Definition at line 95 of file qlinkedlist.h.
| bool isSharedWith | ( | const QLinkedList< T > & | other | ) | const [inline] |
| bool isEmpty | ( | ) | const [inline] |
| void clear | ( | ) |
Definition at line 306 of file qlinkedlist.h.
{
*this = QLinkedList<T>();
}
| void append | ( | const T & | t | ) |
Definition at line 345 of file qlinkedlist.h.
| void prepend | ( | const T & | t | ) |
Definition at line 357 of file qlinkedlist.h.
| T takeFirst | ( | ) | [inline] |
Definition at line 404 of file qlinkedlist.h.
{
T t = first();
removeFirst();
return t;
}
| T takeLast | ( | ) | [inline] |
Definition at line 412 of file qlinkedlist.h.
{
T t = last();
removeLast();
return t;
}
| int removeAll | ( | const T & | t | ) |
Definition at line 369 of file qlinkedlist.h.
| bool removeOne | ( | const T & | t | ) |
Definition at line 392 of file qlinkedlist.h.
| bool contains | ( | const T & | t | ) | const |
Definition at line 420 of file qlinkedlist.h.
| int count | ( | const T & | t | ) | const |
Definition at line 430 of file qlinkedlist.h.
| iterator begin | ( | ) | [inline] |
| const_iterator begin | ( | ) | const [inline] |
| const_iterator constBegin | ( | ) | const [inline] |
| iterator end | ( | ) | [inline] |
| const_iterator end | ( | ) | const [inline] |
| const_iterator constEnd | ( | ) | const [inline] |
| QLinkedList< T >::iterator insert | ( | iterator | before, |
| const T & | t | ||
| ) |
Definition at line 442 of file qlinkedlist.h.
| QLinkedList< T >::iterator erase | ( | iterator | pos | ) |
Definition at line 465 of file qlinkedlist.h.
| int count | ( | ) | const [inline] |
| T& first | ( | ) | [inline] |
Definition at line 191 of file qlinkedlist.h.
| const T& first | ( | ) | const [inline] |
Definition at line 192 of file qlinkedlist.h.
| T& last | ( | ) | [inline] |
Definition at line 193 of file qlinkedlist.h.
| const T& last | ( | ) | const [inline] |
Definition at line 194 of file qlinkedlist.h.
| void removeFirst | ( | ) | [inline] |
Definition at line 195 of file qlinkedlist.h.
| void removeLast | ( | ) | [inline] |
Definition at line 196 of file qlinkedlist.h.
| bool startsWith | ( | const T & | t | ) | const [inline] |
Definition at line 197 of file qlinkedlist.h.
| bool endsWith | ( | const T & | t | ) | const [inline] |
Definition at line 198 of file qlinkedlist.h.
| void push_back | ( | const T & | t | ) | [inline] |
| void push_front | ( | const T & | t | ) | [inline] |
| T& front | ( | ) | [inline] |
| const T& front | ( | ) | const [inline] |
| T& back | ( | ) | [inline] |
| const T& back | ( | ) | const [inline] |
| void pop_front | ( | ) | [inline] |
| void pop_back | ( | ) | [inline] |
| bool empty | ( | ) | const [inline] |
| static QLinkedList<T> fromStdList | ( | const std::list< T > & | list | ) | [inline, static] |
Definition at line 219 of file qlinkedlist.h.
{ QLinkedList<T> tmp; qCopy(list.begin(), list.end(), std::back_inserter(tmp)); return tmp; }
| std::list<T> toStdList | ( | ) | const [inline] |
Definition at line 221 of file qlinkedlist.h.
{ std::list<T> tmp; qCopy(constBegin(), constEnd(), std::back_inserter(tmp)); return tmp; }
| QLinkedList< T > & operator+= | ( | const QLinkedList< T > & | l | ) |
Definition at line 481 of file qlinkedlist.h.
{
detach();
int n = l.d->size;
d->size += n;
Node *original = l.e->n;
while (n--) {
QT_TRY {
Node *copy = new Node(original->t);
original = original->n;
copy->n = e;
copy->p = e->p;
copy->p->n = copy;
e->p = copy;
} QT_CATCH(...) {
// restore the original list
while (n++<d->size)
removeLast();
QT_RETHROW;
}
}
return *this;
}
| QLinkedList< T > operator+ | ( | const QLinkedList< T > & | l | ) | const |
Definition at line 506 of file qlinkedlist.h.
{
QLinkedList<T> n = *this;
n += l;
return n;
}
| QLinkedList<T>& operator+= | ( | const T & | t | ) | [inline] |
Definition at line 243 of file qlinkedlist.h.
{ append(t); return *this; }
| QLinkedList<T>& operator<< | ( | const T & | t | ) | [inline] |
Definition at line 244 of file qlinkedlist.h.
{ append(t); return *this; }
| QLinkedList<T>& operator<< | ( | const QLinkedList< T > & | l | ) | [inline] |
Definition at line 245 of file qlinkedlist.h.
{ *this += l; return *this; }
friend class iterator
[friend] |
Definition at line 144 of file qlinkedlist.h.
friend class const_iterator
[friend] |
Definition at line 174 of file qlinkedlist.h.
Definition at line 81 of file qlinkedlist.h.
| QLinkedListNode<T>* e |
Definition at line 81 of file qlinkedlist.h.