Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:07:34

0001 // Copyright (C) 2020 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QQUEUE_H
0005 #define QQUEUE_H
0006 
0007 #include <QtCore/qlist.h>
0008 
0009 QT_BEGIN_NAMESPACE
0010 
0011 
0012 template <class T>
0013 class QQueue : public QList<T>
0014 {
0015 public:
0016     // compiler-generated special member functions are fine!
0017     inline void swap(QQueue<T> &other) noexcept { QList<T>::swap(other); } // prevent QList<->QQueue swaps
0018     inline void enqueue(const T &t) { QList<T>::append(t); }
0019     inline T dequeue() { return QList<T>::takeFirst(); }
0020     inline T &head() { return QList<T>::first(); }
0021     inline const T &head() const { return QList<T>::first(); }
0022 };
0023 
0024 QT_END_NAMESPACE
0025 
0026 #endif // QQUEUE_H