Remove "All rights reserved" line from license headers.
[profile/ivi/qtdeclarative.git] / src / declarative / qml / v8 / qscripttools_p.h
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the QtScript module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL-ONLY$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser
11 ** General Public License version 2.1 as published by the Free Software
12 ** Foundation and appearing in the file LICENSE.LGPL included in the
13 ** packaging of this file.  Please review the following information to
14 ** ensure the GNU Lesser General Public License version 2.1 requirements
15 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
16 **
17 ** If you have questions regarding the use of this file, please contact
18 ** us via http://www.qt-project.org/.
19 **
20 ** $QT_END_LICENSE$
21 **
22 ****************************************************************************/
23
24 //
25 //  W A R N I N G
26 //  -------------
27 //
28 // This file is not part of the Qt API.  It exists purely as an
29 // implementation detail.  This header file may change from version to
30 // version without notice, or even be removed.
31 //
32 // We mean it.
33 //
34
35
36 #ifndef QSCRIPTTOOLS_P_H
37 #define QSCRIPTTOOLS_P_H
38
39 #include <private/qintrusivelist_p.h>
40
41 QT_BEGIN_NAMESPACE
42
43 template<class N, QIntrusiveListNode N::*member>
44 class QScriptIntrusiveList : public QIntrusiveList<N, member>
45 {
46 public:
47     inline void insert(N *n);
48     inline void remove(N *n);
49 };
50
51 template<class N, QIntrusiveListNode N::*member>
52 void QScriptIntrusiveList<N, member>::insert(N *n)
53 {
54     Q_ASSERT_X(!this->contains(n), Q_FUNC_INFO, "Can't insert a value which is in the list already");
55     Q_ASSERT_X(!(n->*member).isInList(), Q_FUNC_INFO, "Can't insert a value which is in another list");
56     QIntrusiveList<N, member>::insert(n);
57 }
58
59 template<class N, QIntrusiveListNode N::*member>
60 void QScriptIntrusiveList<N, member>::remove(N *n)
61 {
62     Q_ASSERT_X(this->contains(n), Q_FUNC_INFO, "Can't remove a value which is not in the list");
63     QIntrusiveList<N, member>::remove(n);
64 }
65
66 QT_END_NAMESPACE
67
68 #endif //QSCRIPTTOOLS_P_H