Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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// Qt-Security score:significant reason:default
4
5#ifndef QQUEUE_H
6#define QQUEUE_H
7
8#include <QtCore/qlist.h>
9
10QT_BEGIN_NAMESPACE
11
12
13template <class T>
14class QQueue : public QList<T>
15{
16public:
17 // compiler-generated special member functions are fine!
18 inline void swap(QQueue<T> &other) noexcept { QList<T>::swap(other); } // prevent QList<->QQueue swaps
19 inline void enqueue(const T &t) { QList<T>::append(t); }
20 inline void enqueue(T &&t) { QList<T>::append(std::move(t)); }
21 inline T dequeue() { return QList<T>::takeFirst(); }
22 inline T &head() { return QList<T>::first(); }
23 inline const T &head() const { return QList<T>::first(); }
24};
25
27
28#endif // QQUEUE_H
The QLocalServer class provides a local socket based server.
QT_REQUIRE_CONFIG(animation)
QT_REQUIRE_CONFIG(localserver)