4#ifndef QINTRUSIVELIST_P_H
5#define QINTRUSIVELIST_P_H
18#include <QtCore/private/qglobal_p.h>
29 if (_prev) *_prev = _next;
30 if (_next) _next->_prev = _prev;
35 bool isInList()
const {
return _prev !=
nullptr; }
38 template<
class N, QIntrusiveListNode N::*member>
45template<
class N, QIntrusiveListNode N::*member>
52 iterator_impl() =
default;
55 O operator*()
const {
return _value; }
56 O operator->()
const {
return _value; }
57 bool operator==(
const iterator_impl &
other)
const {
return other._value == _value; }
58 bool operator!=(
const iterator_impl &
other)
const {
return other._value != _value; }
59 iterator_impl &operator++()
78 N *old = this->_value;
92 bool isEmpty()
const {
return __first ==
nullptr; }
99 nnode->_next = __first;
100 if (nnode->_next) nnode->_next->_prev = &nnode->_next;
102 nnode->_prev = &__first;
115 if (nodeToN(nnode) ==
n)
117 nnode = nnode->_next;
122 const N *
first()
const {
return __first ? nodeToN(__first) :
nullptr; }
123 N *
first() {
return __first ? nodeToN(__first) :
nullptr; }
129 return nextnode ? nodeToN(nextnode) :
nullptr;
147#if defined(Q_CC_CLANG) && Q_CC_CLANG >= 1300
150 return (N *)((
char *)node - ((
char *)&(((N *)
nullptr)->*member) - (
char *)
nullptr));
void remove()
If in a list, remove this node otherwise do nothing.
bool isInList() const
Returns true if this node is in a list, false otherwise.
~QIntrusiveListNode()
Destroy the QIntrusiveListNode.
iterator & erase()
Remove the current object from the list, and return an iterator to the next element.
The QIntrusiveList class is a template class that provides a list of objects using static storage.
static O next(O current)
Returns the next object after current, or null if current is the last object.
void insert(N *n)
Insert object into the list.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the list.
void remove(N *n)
Remove object from the list.
~QIntrusiveList()
Destroy the list.
iterator_impl< const N * > const_iterator
const N * first() const
Returns the first entry in this list, or null if the list is empty.
iterator begin()
Returns an STL-style interator pointing to the first item in the list.
const_iterator ConstIterator
bool contains(const N *n) const
Returns true if the list contains object; otherwise returns false.
const_iterator begin() const
const_iterator end() const
Combined button and popup list for selecting options.
#define QT_WARNING_DISABLE_CLANG(text)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]