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
22QT_BEGIN_NAMESPACE
23
24namespace Qt3DCore {
25class QNode;
26}
27
28namespace Qt3DLogic {
29namespace Logic {
30
31class Manager;
32
33class Handler : public Qt3DCore::QBackendNode
34{
35public:
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
43private:
44 Manager *m_logicManager;
45};
46
47
48class HandlerFunctor : public Qt3DCore::QBackendNodeMapper
49{
50public:
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
57private:
58 Manager *m_manager;
59};
60
61} // namespace Logic
62} // namespace Qt3DLogic
63
64QT_END_NAMESPACE
65
66#endif // QT3DLOGIC_LOGIC_HANDLER_H
67

source code of qt3d/src/logic/handler_p.h