Debian Codegraph @

Source/Utilities/Container/CQtList.h

raw
1 /*
2 * Copyright (C) 2013-2015, 2019 by the Konclude Developer Team.
3 *
4 * This file is part of the reasoning system Konclude.
5 * For details and support, see <http://konclude.com/>.
6 *
7 * Konclude is free software: you can redistribute it and/or modify
8 * it under the terms of version 3 of the GNU Lesser General Public
9 * License (LGPLv3) as published by the Free Software Foundation.
10 *
11 * Konclude is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU (Lesser) General Public License for more details.
15 *
16 * You should have received a copy of the GNU (Lesser) General Public
17 * License along with Konclude. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 #ifndef KONCLUDE_UTILITIES_CONTAINER_CQTLIST_H
22 #define KONCLUDE_UTILITIES_CONTAINER_CQTLIST_H
23
24 // Namespace includes
25 #include "ContainerSettings.h"
26
27 #ifdef KONCLUDE_EMPLOY_QT_LIST_CONTAINER
28
29 // Library includes
30 #include <QList>
31
32 // Other includes
33 #include "Context/CContext.h"
34
35 // Logger includes
36 #include "Logger/CLogger.h"
37
38
39 namespace Konclude {
40
41 using namespace Context;
42
43 namespace Utilities {
44
45 namespace Container {
46
47
48 /*!
49 *
50 * \class CQtList
51 * \author Andreas Steigmiller
52 * \version 0.1
53 * \brief TODO
54 *
55 */
56 template<class T>
57 class CQtList : public QList<T> {
58 // public methods
59 public:
60 inline CQtList() : QList<T>() {}
61 inline CQtList(CContext* context) : QList<T>() {}
62 inline CQtList(const CQtList<T> &l) : QList<T>(l) {}
63 inline CQtList(const CQtList<T> &l, CContext* context) : QList<T>(l) {}
64 inline CQtList(const QList<T> &l) : QList<T>(l) {}
65 inline CQtList(const QList<T> &l, CContext* context) : QList<T>(l) {}
66
67 inline CQtList(const T &t) : QList<T>() { append(t); }
68 inline CQtList(const T &t, CContext* context) : QList<T>() { append(t); }
69
70
71 inline CQtList<T>* init(CContext* context = nullptr) {
72 QList<T>::clear();
73 return this;
74 }
75
76 inline CQtList<T>* init(const CQtList<T>& other, CContext* context = nullptr) {
77 this->operator =(other);
78 return this;
79 }
80
81 inline CQtList<T>* init(const CQtList<T>* other, CContext* context = nullptr) {
82 if (other) {
83 this->operator =(*other);
84 } else {
85 QList<T>::clear();
86 }
87 return this;
88 }
89
90
91 // protected methods
92 protected:
93
94 // protected variables
95 protected:
96
97 // private methods
98 private:
99
100 // private variables
101 private:
102 };
103
104 }; // end namespace Container
105
106 }; // end namespace Utilities
107
108 }; // end namespace Konclude
109
110 #include "CQtList.cpp"
111
112 #endif // KONCLUDE_EMPLOY_QT_LIST_CONTAINER
113
114 #endif // KONCLUDE_UTILITIES_CONTAINER_CQTLIST_H