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_H
5#define QT3DCORE_QASPECTJOB_H
6
7#include <Qt3DCore/qt3dcore_global.h>
8#include <QtCore/QSharedPointer>
9
10QT_BEGIN_NAMESPACE
11
12namespace Qt3DCore {
13
14class QAspectJobPrivate;
15class QAspectEngine;
16
17class Q_3DCORESHARED_EXPORT QAspectJob
18{
19public:
20 QAspectJob();
21 virtual ~QAspectJob();
22
23 void addDependency(QWeakPointer<QAspectJob> dependency);
24 void removeDependency(QWeakPointer<QAspectJob> dependency);
25
26 const std::vector<QWeakPointer<QAspectJob>> &dependencies() const;
27
28 virtual void run() = 0;
29 virtual void postFrame(QAspectEngine *aspectEngine);
30 virtual bool isRequired();
31
32protected:
33 explicit QAspectJob(QAspectJobPrivate &dd);
34 QAspectJobPrivate *d_ptr;
35
36private:
37 Q_DISABLE_COPY(QAspectJob)
38 Q_DECLARE_PRIVATE(QAspectJob)
39};
40
41typedef QSharedPointer<QAspectJob> QAspectJobPtr;
42
43} // namespace Qt3DCore
44
45QT_END_NAMESPACE
46
47#endif // QT3DCORE_QASPECTJOB_H
48

source code of qt3d/src/core/jobs/qaspectjob.h