5#ifndef QSSGINVASIVELINKEDLIST_H
6#define QSSGINVASIVELINKEDLIST_H
19#include <QtQuick3DUtils/private/qtquick3dutilsglobal_p.h>
24#define QSSG_VERIFY_NODE(X) if (!(X)) qCritical("Node links are not null!");
26#define QSSG_VERIFY_NODE(X) Q_UNUSED((X));
34 static void set(T &, T *) {}
35 static T *
get(
const T &) {
return nullptr; }
38template <
typename T, T *T::*n>
41 static inline T *
get(T &
o) {
return o.*
n; }
42 static inline const T *
get(
const T &
o) {
return o.*
n; }
46template <
typename T, T *T::*p>
49 static inline T *
get(T &
o) {
return o.*
p; }
50 static inline const T *
get(
const T &
o) {
return o.*
p; }
51 static inline void set(T &
o, T *prev) {
o.*
p = prev; }
55template<
typename T,
typename HeadOp,
typename TailOp>
58 inline T *
tail(T *inObj) {
return inObj ? TailOp::get(inObj) :
nullptr; }
59 inline T *
head(T *inObj) {
return inObj ? HeadOp::get(inObj) :
nullptr; }
60 inline const T *
tail(
const T *inObj) {
return inObj ? TailOp::get(inObj) :
nullptr; }
61 inline const T *
head(
const T *inObj) {
return inObj ? HeadOp::get(inObj) :
nullptr; }
65 T *theHead = HeadOp::get(inObj);
66 T *theTail = TailOp::get(inObj);
68 TailOp::set(*theHead, theTail);
70 HeadOp::set(*theTail, theHead);
71 HeadOp::set(inObj,
nullptr);
72 TailOp::set(inObj,
nullptr);
77 T *theHead = &inPosition;
78 T *theTail = TailOp::get(inPosition);
84 T *theHead = HeadOp::get(inPosition);
85 T *theTail = &inPosition;
97 TailOp::set(*inHead, &inObj);
99 HeadOp::set(*inTail, &inObj);
100 HeadOp::set(inObj, inHead);
101 TailOp::set(inObj, inTail);
105template<
typename T,
typename TailOp>
133template<
typename T, T *T::*Next>
163 T *lastObj =
nullptr;
222template<
typename T, T *T::*Previous, T *T::*Next>
QSet< QString >::iterator it
Combined button and popup list for selecting options.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter * iter
#define QSSG_VERIFY_NODE(X)
void insert_before(T &inPosition, T &inObj)
const T * head(const T *inObj)
const T * tail(const T *inObj)
void insert_after(T &inPosition, T &inObj)
void insert_unsafe(T *inHead, T *inTail, T &inObj)
QSSGLinkedListIterator< T, HeadOp > reverse_iterator
const_reverse_iterator rbegin() const
const_iterator begin() const
void push_front(T &inObj)
const_iterator end() const
void clear()
clear will set the head and tail of the list to null.
void removeAll()
removeAll removes all nodes and re-sets their head and tail to null.
reverse_iterator rbegin()
const_reverse_iterator rend() const
QSSGLinkedListIterator< T, TailOp > iterator
void push_front(T &inObj)
void clear()
clear will set the head of the list to null.
QSSGLinkedListIterator< T, TailOp > iterator
const_iterator begin() const
const_iterator end() const
void removeAll()
removeAll removes all nodes and re-sets their tail to null.
bool operator==(const Iterator &inIter) const
QSSGLinkedListIterator(T *inObj=nullptr)
bool operator!=(const Iterator &inIter) const
static void set(T &o, T *next)
static const T * get(const T &o)
static const T * get(const T &o)
static void set(T &o, T *prev)
static void set(T &, T *)
static T * get(const T &)