QP/C++ 8.1.1
Real-Time Event Framework
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_Static_assert(Q_SIGNAL_SIZE == 2U,
49 "Q_SIGNAL_SIZE must be 2 bytes (16-bit signal space)");
50#endif
51
52// version 8.1.0 -------------------------------------------------------------
53#if (QP_API_VERSION < 810)
54
55using enum_t = int;
56
57#ifdef Q_SPY
58
59namespace QP {
60
61//! @deprecated instead use: QS_Groups
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 QM_SM_STATE_DECL(), submachines no longer supported
91#define QM_SM_STATE_DECL(subm_, state_) error "submachines no longer supported"
92
93//! @deprecated qm_super_sub(), submachines no longer supported
94#define qm_super_sub(sm_state_) error "submachines no longer supported"
95
96//! @deprecated qm_tran_ep(), submachines no longer supported
97#define qm_tran_ep(tatbl_) error "submachines no longer supported"
98
99//! @deprecated qm_tran_xp(), submachines no longer supported
100#define qm_tran_xp(xp_, tatbl_) error "submachines no longer supported"
101
102//! @deprecated qm_sm_exit(), submachines no longer supported
103#define qm_sm_exit(sm_state_) error "submachines no longer supported"
104
105#ifdef QEVT_DYN_CTOR
106//! @deprecated QEVT_DYN_CTOR(), 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
111using char_t = char;
112
113//! @deprecated assertion failure handler
114//! Use Q_onError() instead.
115#define Q_onAssert(module_, id_) Q_onError(module_, id_)
116
117//! @deprecated #Q_NASSERT preprocessor switch to disable QP assertions
118#ifdef Q_NASSERT
119
120 // #Q_UNSAFE now replaces the functionality of Q_NASSERT
121 #define Q_UNSAFE
122
123 //! @deprecated general purpose assertion with user-specified ID
124 //! number that **always** evaluates the `expr_` expression.
125 #define Q_ALLEGE_ID(id_, expr_) (static_cast<void>(expr_))
126
127#elif defined Q_UNSAFE
128
129 //! @deprecated general purpose assertion with user-specified ID
130 //! number that **always** evaluates the `expr_` expression.
131 #define Q_ALLEGE_ID(id_, expr_) (static_cast<void>(expr_))
132
133#else // QP FuSa Subsystem enabled
134
135 //! @deprecated general purpose assertion with user-specified ID
136 //! number that **always** evaluates the `expr_` expression.
137 //! @note
138 //! The use of this macro is no longer recommended.
139 #define Q_ALLEGE_ID(id_, expr_) if (!(expr_)) { \
140 QF_CRIT_STAT \
141 QF_CRIT_ENTRY(); \
142 Q_onError(&Q_this_module_[0], (id_)); \
143 QF_CRIT_EXIT(); \
144 } else ((void)0)
145
146#endif
147
148//! @deprecated general purpose assertion without ID number
149//! that **always** evaluates the `expr_` expression.
150//! Instead of ID number, this macro is based on the standard
151//! `__LINE__` macro.
152//!
153//! @note The use of this macro is no longer recommended.
154#define Q_ALLEGE(expr_) Q_ALLEGE_ID(__LINE__, (expr_))
155
156//! Static (compile-time) assertion.
157//! @deprecated
158//! Use Q_ASSERT_STATIC() or better yet `static_assert()` instead.
159#define Q_ASSERT_COMPILE(expr_) Q_ASSERT_STATIC(expr_)
160
161#endif // QP_API_VERSION < 800
162#endif // QP_API_VERSION < 810
163
164#endif // QPCPP_HPP_
QP/C++ Framework namespace.
Definition qequeue.hpp:36
constexpr std::int_fast16_t QS_GRP_SC
Definition qs.hpp:185
constexpr std::int_fast16_t QS_GRP_U4
Definition qs.hpp:192
constexpr std::int_fast16_t QS_GRP_QF
Definition qs.hpp:184
constexpr std::int_fast16_t QS_GRP_MP
Definition qs.hpp:182
constexpr std::int_fast16_t QS_GRP_SEM
Definition qs.hpp:186
constexpr std::int_fast16_t QS_GRP_UA
Definition qs.hpp:193
constexpr std::int_fast16_t QS_GRP_U3
Definition qs.hpp:191
QS_Groups_old
Definition qpcpp.hpp:62
@ QS_MTX_RECORDS
Definition qpcpp.hpp:72
@ QS_UA_RECORDS
Definition qpcpp.hpp:78
@ QS_SEM_RECORDS
Definition qpcpp.hpp:71
@ QS_ALL_RECORDS
Definition qpcpp.hpp:63
@ QS_U0_RECORDS
Definition qpcpp.hpp:73
@ QS_EQ_RECORDS
Definition qpcpp.hpp:66
@ QS_SC_RECORDS
Definition qpcpp.hpp:70
@ QS_U2_RECORDS
Definition qpcpp.hpp:75
@ QS_SM_RECORDS
Definition qpcpp.hpp:64
@ QS_U4_RECORDS
Definition qpcpp.hpp:77
@ QS_U3_RECORDS
Definition qpcpp.hpp:76
@ QS_AO_RECORDS
Definition qpcpp.hpp:65
@ QS_TE_RECORDS
Definition qpcpp.hpp:68
@ QS_U1_RECORDS
Definition qpcpp.hpp:74
@ QS_MP_RECORDS
Definition qpcpp.hpp:67
@ QS_QF_RECORDS
Definition qpcpp.hpp:69
constexpr std::int_fast16_t QS_GRP_TE
Definition qs.hpp:183
constexpr std::int_fast16_t QS_GRP_U0
Definition qs.hpp:188
constexpr std::int_fast16_t QS_GRP_EQ
Definition qs.hpp:181
constexpr std::int_fast16_t QS_GRP_U1
Definition qs.hpp:189
constexpr std::int_fast16_t QS_GRP_U2
Definition qs.hpp:190
constexpr std::int_fast16_t QS_GRP_ALL
Definition qs.hpp:178
constexpr std::int_fast16_t QS_GRP_SM
Definition qs.hpp:179
constexpr std::int_fast16_t QS_GRP_AO
Definition qs.hpp:180
constexpr std::int_fast16_t QS_GRP_MTX
Definition qs.hpp:187
Sample QP/C++ port.
int enum_t
Definition qpcpp.hpp:55
char char_t
Definition qpcpp.hpp:111
Sample QS/C++ port.
QP Functional Safety (FuSa) Subsystem.