1 | // Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). |
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 QT3DCORE_QASPECTJOB_P_H |
5 | #define QT3DCORE_QASPECTJOB_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists for the convenience |
12 | // of other Qt classes. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <QtCore/QWeakPointer> |
19 | |
20 | #include <Qt3DCore/private/qt3dcore_global_p.h> |
21 | #include <Qt3DCore/private/qsysteminformationservice_p_p.h> |
22 | #include <Qt3DCore/qt3dcore-config.h> |
23 | |
24 | QT_BEGIN_NAMESPACE |
25 | |
26 | namespace Qt3DCore { |
27 | |
28 | class QAspectJob; |
29 | class QAspectManager; |
30 | |
31 | class Q_3DCORE_PRIVATE_EXPORT QAspectJobPrivate |
32 | { |
33 | public: |
34 | QAspectJobPrivate(); |
35 | virtual ~QAspectJobPrivate(); |
36 | |
37 | static QAspectJobPrivate *get(QAspectJob *job); |
38 | |
39 | virtual bool isRequired() const; |
40 | virtual void postFrame(QAspectManager *aspectManager); |
41 | |
42 | void clearDependencies() { m_dependencies.clear(); } |
43 | |
44 | std::vector<QWeakPointer<QAspectJob> > m_dependencies; |
45 | JobId m_jobId; |
46 | QString m_jobName; |
47 | }; |
48 | } // Qt3D |
49 | |
50 | #define SET_JOB_RUN_STAT_TYPE(job, type, instance) \ |
51 | { \ |
52 | auto djob = Qt3DCore::QAspectJobPrivate::get(job); \ |
53 | auto &jobId = djob->m_jobId; \ |
54 | jobId.typeAndInstance[0] = type; \ |
55 | jobId.typeAndInstance[1] = instance; \ |
56 | djob->m_jobName = QLatin1String(#type); \ |
57 | } |
58 | |
59 | #define SET_JOB_RUN_STAT_TYPE_AND_NAME(job, type, name, instance) \ |
60 | { \ |
61 | auto djob = Qt3DCore::QAspectJobPrivate::get(job); \ |
62 | auto &jobId = djob->m_jobId; \ |
63 | jobId.typeAndInstance[0] = type; \ |
64 | jobId.typeAndInstance[1] = instance; \ |
65 | djob->m_jobName = QLatin1String(name); \ |
66 | } |
67 | |
68 | QT_END_NAMESPACE |
69 | |
70 | #endif // QT3DCORE_QASPECTJOB_P_H |
71 | |