KDStateMachineEditor API Documentation 2.1
Loading...
Searching...
No Matches
debuginterface_types.h
Go to the documentation of this file.
1/*
2 This file is part of the KDAB State Machine Editor Library.
3
4 SPDX-FileCopyrightText: 2015 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: Kevin Funk <kevin.funk@kdab.com>
6
7 SPDX-License-Identifier: LGPL-2.1-only OR LicenseRef-KDAB-KDStateMachineEditor
8
9 Licensees holding valid commercial KDAB State Machine Editor Library
10 licenses may use this file in accordance with the KDAB State Machine Editor
11 Library License Agreement provided with the Software.
12
13 Contact info@kdab.com if any conditions of this licensing are not clear to you.
14*/
15
16#ifndef KDSME_DEBUGINTERFACE_TYPES_H
17#define KDSME_DEBUGINTERFACE_TYPES_H
18
19#include <QDataStream>
20#include <QList>
21#include <QMetaType>
22
23QT_BEGIN_NAMESPACE
24class QAbstractTransition;
25class QAbstractState;
26QT_END_NAMESPACE
27
28namespace KDSME {
29namespace DebugInterface {
30
31// note: typedef bring major pain, on the client side i.e. it would always look for
32// signal/slots with the base type (or actually, the first type which was registered
33// to the meta type system)...
35{
36 operator quint64() const
37 {
38 return id;
39 }
40 quint64 id;
41};
42
43inline QDataStream &operator<<(QDataStream &out, TransitionId value)
44{
45 out << value.id;
46 return out;
47}
48
49inline QDataStream &operator>>(QDataStream &in, TransitionId &value)
50{
51 in >> value.id;
52 return in;
53}
54
55struct StateId
56{
57 operator quint64() const
58 {
59 return id;
60 }
61 quint64 id;
62};
63
64inline QDataStream &operator<<(QDataStream &out, StateId value)
65{
66 out << value.id;
67 return out;
68}
69
70inline QDataStream &operator>>(QDataStream &in, StateId &value)
71{
72 in >> value.id;
73 return in;
74}
75
84
85inline QDataStream &operator<<(QDataStream &out, StateType value)
86{
87 out << int(value);
88 return out;
89}
90
91inline QDataStream &operator>>(QDataStream &in, StateType &value)
92{
93 int val;
94 in >> val;
95 value = static_cast<StateType>(val);
96 return in;
97}
98
99typedef QList<StateId> StateMachineConfiguration;
100
101inline void registerTypes() // krazy:exclude=inline
102{
103#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
104 qRegisterMetaTypeStreamOperators<StateId>();
105 qRegisterMetaTypeStreamOperators<StateMachineConfiguration>();
106 qRegisterMetaTypeStreamOperators<TransitionId>();
107 qRegisterMetaTypeStreamOperators<StateType>();
108#endif
109}
110
111}
112}
113
114Q_DECLARE_METATYPE(KDSME::DebugInterface::StateId)
115Q_DECLARE_METATYPE(KDSME::DebugInterface::TransitionId)
117Q_DECLARE_METATYPE(KDSME::DebugInterface::StateType)
118
119#endif
QList< StateId > StateMachineConfiguration
QDataStream & operator>>(QDataStream &in, TransitionId &value)
QDataStream & operator<<(QDataStream &out, TransitionId value)

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDStateMachineEditor
Create Qt State Machine metacode using a graphical user interface
https://github.com/KDAB/KDStateMachineEditor
Generated on Tue Jul 15 2025 15:21:47 for KDStateMachineEditor API Documentation by doxygen 1.9.8