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
4#ifndef QQUEUE_H
5#define QQUEUE_H
6
7#include <QtCore/qlist.h>
8
9QT_BEGIN_NAMESPACE
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
The QLocalServer class provides a local socket based server.
QT_REQUIRE_CONFIG(animation)
QT_REQUIRE_CONFIG(localserver)