1 | // Copyright (C) 2019 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 | #ifndef QT3DLOGIC_LOGIC_HANDLER_H |
4 | #define QT3DLOGIC_LOGIC_HANDLER_H |
5 | |
6 | // |
7 | // W A R N I N G |
8 | // ------------- |
9 | // |
10 | // This file is not part of the Qt API. It exists for the convenience |
11 | // of other Qt classes. This header file may change from version to |
12 | // version without notice, or even be removed. |
13 | // |
14 | // We mean it. |
15 | // |
16 | |
17 | #include <Qt3DCore/qbackendnode.h> |
18 | #include <Qt3DCore/qnodeid.h> |
19 | #include <Qt3DCore/qaspectjob.h> |
20 | #include <private/qglobal_p.h> |
21 | |
22 | QT_BEGIN_NAMESPACE |
23 | |
24 | namespace Qt3DCore { |
25 | class QNode; |
26 | } |
27 | |
28 | namespace Qt3DLogic { |
29 | namespace Logic { |
30 | |
31 | class Manager; |
32 | |
33 | class Handler : public Qt3DCore::QBackendNode |
34 | { |
35 | public: |
36 | Handler(); |
37 | |
38 | void setManager(Manager *manager) { m_logicManager = manager; } |
39 | Manager *logicManager() const { return m_logicManager; } |
40 | |
41 | void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override; |
42 | |
43 | private: |
44 | Manager *m_logicManager; |
45 | }; |
46 | |
47 | |
48 | class HandlerFunctor : public Qt3DCore::QBackendNodeMapper |
49 | { |
50 | public: |
51 | explicit HandlerFunctor(Manager *handler); |
52 | |
53 | Qt3DCore::QBackendNode *create(Qt3DCore::QNodeId id) const override; |
54 | Qt3DCore::QBackendNode *get(Qt3DCore::QNodeId id) const override; |
55 | void destroy(Qt3DCore::QNodeId id) const override; |
56 | |
57 | private: |
58 | Manager *m_manager; |
59 | }; |
60 | |
61 | } // namespace Logic |
62 | } // namespace Qt3DLogic |
63 | |
64 | QT_END_NAMESPACE |
65 | |
66 | #endif // QT3DLOGIC_LOGIC_HANDLER_H |
67 | |