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_QASPECTJOBMANAGER_P_H
5#define QT3DCORE_QASPECTJOBMANAGER_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 <Qt3DCore/qaspectjob.h>
19
20#include <Qt3DCore/private/qabstractaspectjobmanager_p.h>
21#include <Qt3DCore/private/qt3dcore_global_p.h>
22
23QT_BEGIN_NAMESPACE
24
25namespace Qt3DCore {
26
27class QThreadPooler;
28class DependencyHandler;
29class QAspectManager;
30
31class Q_3DCORE_PRIVATE_EXPORT QAspectJobManager : public QAbstractAspectJobManager
32{
33 Q_OBJECT
34public:
35 explicit QAspectJobManager(QAspectManager *parent = nullptr);
36 ~QAspectJobManager();
37
38 void initialize() override;
39
40 void enqueueJobs(const std::vector<QAspectJobPtr> &jobQueue) override;
41
42 int waitForAllJobs() override;
43
44 void waitForPerThreadFunction(JobFunction func, void *arg) override;
45 static int idealThreadCount();
46
47private:
48 QThreadPooler *m_threadPooler;
49 QAspectManager *m_aspectManager;
50};
51
52} // namespace Qt3DCore
53
54QT_END_NAMESPACE
55
56#endif // QT3DCORE_QASPECTJOBMANAGER_P_H
57

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