QP/C++ Real-Time Event Framework 8.1.5
Toggle main menu visibility
Loading...
Searching...
No Matches
qpcpp.hpp
Go to the documentation of this file.
1
//============================================================================
2
// QP/C++ Real-Time Event Framework (RTEF)
3
//
4
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
5
//
6
// Q u a n t u m L e a P s
7
// ------------------------
8
// Modern Embedded Software
9
//
10
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
11
//
12
// This software is dual-licensed under the terms of the open-source GNU
13
// General Public License (GPL) or under the terms of one of the closed-
14
// source Quantum Leaps commercial licenses.
15
//
16
// Redistributions in source code must retain this top-level comment block.
17
// Plagiarizing this software to sidestep the license obligations is illegal.
18
//
19
// NOTE:
20
// The GPL does NOT permit the incorporation of this code into proprietary
21
// programs. Please contact Quantum Leaps for commercial licensing options,
22
// which expressly supersede the GPL and are designed explicitly for
23
// closed-source distribution.
24
//
25
// Quantum Leaps contact information:
26
// <www.state-machine.com/licensing>
27
// <info@state-machine.com>
28
//============================================================================
29
#ifndef QPCPP_HPP_
30
#define QPCPP_HPP_
31
32
//============================================================================
33
#include "
qp_port.hpp
"
// QP port from the port directory
34
#include "
qsafe.h
"
// QP Functional Safety (FuSa) Subsystem
35
#ifdef Q_SPY
// software tracing enabled?
36
#include "
qs_port.hpp
"
// QS/C++ port from the port directory
37
#else
38
#include "qs_dummy.hpp"
// QS/C++ dummy (inactive) interface
39
#endif
40
41
#ifndef QP_API_VERSION
42
#define QP_API_VERSION 0
43
#endif
44
45
// QP API compatibility layer...
46
47
#ifdef Q_SIGNAL_SIZE
48
// Q_SIGNAL_SIZE must be 2 bytes (16-bit signal space)
49
Q_ASSERT_STATIC
(Q_SIGNAL_SIZE == 2U);
50
#endif
51
52
// version 8.1.0 -------------------------------------------------------------
53
#if (QP_API_VERSION < 810)
54
55
using
enum_t
= int;
56
57
#ifdef Q_SPY
58
59
namespace
QP
{
60
61
//! @deprecated instead use: QS_Groups
62
enum
QS_Groups_old
: std::int16_t {
63
QS_ALL_RECORDS
=
QS_GRP_ALL
,
64
QS_SM_RECORDS
=
QS_GRP_SM
,
65
QS_AO_RECORDS
=
QS_GRP_AO
,
66
QS_EQ_RECORDS
=
QS_GRP_EQ
,
67
QS_MP_RECORDS
=
QS_GRP_MP
,
68
QS_TE_RECORDS
=
QS_GRP_TE
,
69
QS_QF_RECORDS
=
QS_GRP_QF
,
70
QS_SC_RECORDS
=
QS_GRP_SC
,
71
QS_SEM_RECORDS
=
QS_GRP_SEM
,
72
QS_MTX_RECORDS
=
QS_GRP_MTX
,
73
QS_U0_RECORDS
=
QS_GRP_U0
,
74
QS_U1_RECORDS
=
QS_GRP_U1
,
75
QS_U2_RECORDS
=
QS_GRP_U2
,
76
QS_U3_RECORDS
=
QS_GRP_U3
,
77
QS_U4_RECORDS
=
QS_GRP_U4
,
78
QS_UA_RECORDS
=
QS_GRP_UA
,
79
};
80
81
// NOTE: deprecated QS::ObjKind_old provided in the QS class in qs.hpp
82
83
}
// namespace QP
84
85
#endif
// Q_SPY
86
87
// version 8.0.0 -------------------------------------------------------------
88
#if (QP_API_VERSION < 800)
89
90
//! @deprecated submachines no longer supported
91
#define QM_SM_STATE_DECL(subm_, state_) error "submachines no longer supported"
92
93
//! @deprecated submachines no longer supported
94
#define qm_super_sub(sm_state_) error "submachines no longer supported"
95
96
//! @deprecated submachines no longer supported
97
#define qm_tran_ep(tatbl_) error "submachines no longer supported"
98
99
//! @deprecated submachines no longer supported
100
#define qm_tran_xp(xp_, tatbl_) error "submachines no longer supported"
101
102
//! @deprecated submachines no longer supported
103
#define qm_sm_exit(sm_state_) error "submachines no longer supported"
104
105
#ifdef QEVT_DYN_CTOR
106
//! @deprecated please use #QEVT_PAR_INIT
107
#define QEVT_PAR_INIT
108
#endif
109
110
//! @deprecated plain 'char' is no longer forbidden in MISRA-C++:2023
111
using
char_t
= char;
112
113
//! @deprecated assertion failure handler, use custom error handler instead
114
//! Use Q_onError() instead.
115
#define Q_onAssert(module_, id_) Q_onError(module_, id_)
116
117
#ifdef Q_NASSERT
118
119
// #Q_UNSAFE now replaces the functionality of Q_NASSERT
120
#define Q_UNSAFE
121
122
//! @deprecated general purpose assertion with user-specified ID
123
//! number that **always** evaluates the `expr_` expression.
124
#define Q_ALLEGE_ID(id_, expr_) (static_cast<void>(expr_))
125
126
#elif defined Q_UNSAFE
127
128
//! @deprecated general purpose assertion with user-specified ID
129
//! number that **always** evaluates the `expr_` expression.
130
#define Q_ALLEGE_ID(id_, expr_) (static_cast<void>(expr_))
131
132
#else
// QP FuSa Subsystem enabled
133
134
//! @deprecated general purpose assertion with user-specified ID
135
//! number that **always** evaluates the `expr_` expression.
136
//! @note
137
//! The use of this macro is no longer recommended.
138
#define Q_ALLEGE_ID(id_, expr_) if (!(expr_)) { \
139
QF_CRIT_STAT \
140
QF_CRIT_ENTRY(); \
141
Q_onError(&Q_this_module_[0], (id_)); \
142
QF_CRIT_EXIT(); \
143
} else ((void)0)
144
145
#endif
146
147
//! @deprecated general-purpose assertion that **always** evaluates
148
//! the `expr_` expression.
149
//! @note The use of this macro is no longer recommended.
150
#define Q_ALLEGE(expr_) Q_ALLEGE_ID(__LINE__, (expr_))
151
152
//! Static (compile-time) assertion.
153
//! @deprecated
154
//! Use Q_ASSERT_STATIC() or better yet `static_assert()` instead.
155
#define Q_ASSERT_COMPILE(expr_) Q_ASSERT_STATIC(expr_)
156
157
#endif
// QP_API_VERSION < 800
158
#endif
// QP_API_VERSION < 810
159
160
#endif
// QPCPP_HPP_
QP
QP/C++ Framework namespace.
Definition
qequeue.hpp:36
QP::QS_GRP_SC
constexpr std::int_fast16_t QS_GRP_SC
Definition
qs.hpp:185
QP::QS_GRP_U4
constexpr std::int_fast16_t QS_GRP_U4
Definition
qs.hpp:192
QP::QS_GRP_QF
constexpr std::int_fast16_t QS_GRP_QF
Definition
qs.hpp:184
QP::QS_GRP_MP
constexpr std::int_fast16_t QS_GRP_MP
Definition
qs.hpp:182
QP::QS_GRP_SEM
constexpr std::int_fast16_t QS_GRP_SEM
Definition
qs.hpp:186
QP::QS_GRP_UA
constexpr std::int_fast16_t QS_GRP_UA
Definition
qs.hpp:193
QP::QS_GRP_U3
constexpr std::int_fast16_t QS_GRP_U3
Definition
qs.hpp:191
QP::QS_Groups_old
QS_Groups_old
Definition
qpcpp.hpp:62
QP::QS_MTX_RECORDS
@ QS_MTX_RECORDS
Definition
qpcpp.hpp:72
QP::QS_UA_RECORDS
@ QS_UA_RECORDS
Definition
qpcpp.hpp:78
QP::QS_SEM_RECORDS
@ QS_SEM_RECORDS
Definition
qpcpp.hpp:71
QP::QS_ALL_RECORDS
@ QS_ALL_RECORDS
Definition
qpcpp.hpp:63
QP::QS_U0_RECORDS
@ QS_U0_RECORDS
Definition
qpcpp.hpp:73
QP::QS_EQ_RECORDS
@ QS_EQ_RECORDS
Definition
qpcpp.hpp:66
QP::QS_SC_RECORDS
@ QS_SC_RECORDS
Definition
qpcpp.hpp:70
QP::QS_U2_RECORDS
@ QS_U2_RECORDS
Definition
qpcpp.hpp:75
QP::QS_SM_RECORDS
@ QS_SM_RECORDS
Definition
qpcpp.hpp:64
QP::QS_U4_RECORDS
@ QS_U4_RECORDS
Definition
qpcpp.hpp:77
QP::QS_U3_RECORDS
@ QS_U3_RECORDS
Definition
qpcpp.hpp:76
QP::QS_AO_RECORDS
@ QS_AO_RECORDS
Definition
qpcpp.hpp:65
QP::QS_TE_RECORDS
@ QS_TE_RECORDS
Definition
qpcpp.hpp:68
QP::QS_U1_RECORDS
@ QS_U1_RECORDS
Definition
qpcpp.hpp:74
QP::QS_MP_RECORDS
@ QS_MP_RECORDS
Definition
qpcpp.hpp:67
QP::QS_QF_RECORDS
@ QS_QF_RECORDS
Definition
qpcpp.hpp:69
QP::QS_GRP_TE
constexpr std::int_fast16_t QS_GRP_TE
Definition
qs.hpp:183
QP::QS_GRP_U0
constexpr std::int_fast16_t QS_GRP_U0
Definition
qs.hpp:188
QP::QS_GRP_EQ
constexpr std::int_fast16_t QS_GRP_EQ
Definition
qs.hpp:181
QP::QS_GRP_U1
constexpr std::int_fast16_t QS_GRP_U1
Definition
qs.hpp:189
QP::QS_GRP_U2
constexpr std::int_fast16_t QS_GRP_U2
Definition
qs.hpp:190
QP::QS_GRP_ALL
constexpr std::int_fast16_t QS_GRP_ALL
Definition
qs.hpp:178
QP::QS_GRP_SM
constexpr std::int_fast16_t QS_GRP_SM
Definition
qs.hpp:179
QP::QS_GRP_AO
constexpr std::int_fast16_t QS_GRP_AO
Definition
qs.hpp:180
QP::QS_GRP_MTX
constexpr std::int_fast16_t QS_GRP_MTX
Definition
qs.hpp:187
qp_port.hpp
Sample QP/C++ port.
enum_t
int enum_t
Definition
qpcpp.hpp:55
char_t
char char_t
Definition
qpcpp.hpp:111
qs_port.hpp
Sample QS/C++ port.
qsafe.h
QP Functional Safety (FuSa) Subsystem.
Q_ASSERT_STATIC
#define Q_ASSERT_STATIC(expr_)
Static (compile-time) assertion.
Definition
qsafe.h:114
qpcpp
include
qpcpp.hpp
©
Quantum Leaps
|
LinkedIn
|
YouTube
|
GitHub
| created with
Spexygen
©
Quantum Leaps
|
LinkedIn
|
YouTube
|
GitHub
| created with
Spexygen