Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqueue.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QQUEUE_H
5#define QQUEUE_H
6
7#include <QtCore/qlist.h>
8
10
11
12template <class T>
13class QQueue : public QList<T>
14{
15public:
16 // compiler-generated special member functions are fine!
17 inline void swap(QQueue<T> &other) noexcept { QList<T>::swap(other); } // prevent QList<->QQueue swaps
18 inline void enqueue(const T &t) { QList<T>::append(t); }
19 inline T dequeue() { return QList<T>::takeFirst(); }
20 inline T &head() { return QList<T>::first(); }
21 inline const T &head() const { return QList<T>::first(); }
22};
23
25
26#endif // QQUEUE_H
Definition qlist.h:75
T & first()
Definition qlist.h:645
value_type takeFirst()
Definition qlist.h:566
void swap(QList &other) noexcept
Definition qlist.h:337
void append(parameter_type t)
Definition qlist.h:458
\inmodule QtCore
Definition qqueue.h:14
const T & head() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qqueue.h:21
void enqueue(const T &t)
Adds value t to the tail of the queue.
Definition qqueue.h:18
T & head()
Returns a reference to the queue's head item.
Definition qqueue.h:20
T dequeue()
Removes the head item in the queue and returns it.
Definition qqueue.h:19
void swap(QQueue< T > &other) noexcept
Definition qqueue.h:17
Combined button and popup list for selecting options.
GLdouble GLdouble t
Definition qopenglext.h:243
QSharedPointer< T > other(t)
[5]