QP/C++  8.0.0
Real-Time Embedded Framework
Loading...
Searching...
No Matches
qp_pkg.hpp
Go to the documentation of this file.
1//$file${include::qp_pkg.hpp} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
2//
3// Model: qpcpp.qm
4// File: ${include::qp_pkg.hpp}
5//
6// This code has been generated by QM 7.0.0 <www.state-machine.com/qm>.
7// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
8//
9// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
10//
11// Q u a n t u m L e a P s
12// ------------------------
13// Modern Embedded Software
14//
15// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
16//
17// The QP/C++ software is dual-licensed under the terms of the open-source
18// GNU General Public License (GPL) or under the terms of one of the closed-
19// source Quantum Leaps commercial licenses.
20//
21// Redistributions in source code must retain this top-level comment block.
22// Plagiarizing this software to sidestep the license obligations is illegal.
23//
24// NOTE:
25// The GPL does NOT permit the incorporation of this code into proprietary
26// programs. Please contact Quantum Leaps for commercial licensing options,
27// which expressly supersede the GPL and are designed explicitly for
28// closed-source distribution.
29//
30// Quantum Leaps contact information:
31// <www.state-machine.com/licensing>
32// <info@state-machine.com>
33//
34//$endhead${include::qp_pkg.hpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35#ifndef QP_PKG_HPP_
36#define QP_PKG_HPP_
37
38//$declare${QF::QF-pkg} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
39namespace QP {
40namespace QF {
41
42//${QF::QF-pkg::Attr} ........................................................
43class Attr {
44public:
45
46#if (QF_MAX_EPOOL > 0U)
48#endif // (QF_MAX_EPOOL > 0U)
49
50#if (QF_MAX_EPOOL > 0U)
51 std::uint_fast8_t maxPool_;
52#endif // (QF_MAX_EPOOL > 0U)
53
54#if (QF_MAX_EPOOL == 0U)
55 std::uint8_t dummy;
56#endif // (QF_MAX_EPOOL == 0U)
57}; // class Attr
58
59//${QF::QF-pkg::priv_} .......................................................
60extern QF::Attr priv_;
61
62//${QF::QF-pkg::bzero_} ......................................................
63void bzero_(
64 void * const start,
65 std::uint_fast16_t const len) noexcept;
66
67} // namespace QF
68} // namespace QP
69//$enddecl${QF::QF-pkg} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
70
71#define QF_CONST_CAST_(type_, ptr_) const_cast<type_>(ptr_)
72#define Q_PTR2UINT_CAST_(ptr_) (reinterpret_cast<std::uintptr_t>(ptr_))
73#define QF_PTR_RANGE_(x_, min_, max_) (((min_) <= (x_)) && ((x_) <= (max_)))
74
75namespace QP {
76
77// Bitmasks are for the QTimeEvt::flags attribute
78constexpr std::uint8_t QTE_FLAG_IS_LINKED {1U << 7U};
79constexpr std::uint8_t QTE_FLAG_WAS_DISARMED {1U << 6U};
80
81inline void QEvt_refCtr_inc_(QEvt const * const e) noexcept {
82 std::uint8_t rc = e->refCtr_ + 1U;
83 (QF_CONST_CAST_(QEvt*, e))->refCtr_ = rc; // cast away 'const'
84#ifndef Q_UNSAFE
85 (QF_CONST_CAST_(QEvt*, e))->evtTag_ = (e->evtTag_ & 0xF0U) | ((~rc) & 0x0FU);
86#endif
87}
88
89inline void QEvt_refCtr_dec_(QEvt const * const e) noexcept {
90 std::uint8_t rc = e->refCtr_ - 1U;
91 (QF_CONST_CAST_(QEvt*, e))->refCtr_ = rc; // cast away 'const'
92#ifndef Q_UNSAFE
93 (QF_CONST_CAST_(QEvt*, e))->evtTag_ = (e->evtTag_ & 0xF0U) | ((~rc) & 0x0FU);
94#endif
95}
96
97} // namespace QP
98
99#endif // QP_PKG_HPP_
Event class.
Definition qp.hpp:131
Private attributes of the QF framework.
Definition qp_pkg.hpp:43
QF_EPOOL_TYPE_ ePool_[QF_MAX_EPOOL]
Array of event pools sized for the maximum allowed number of pools.
Definition qp_pkg.hpp:47
std::uint_fast8_t maxPool_
Number of event pools managed by the QF Framework.
Definition qp_pkg.hpp:51
QF Active Object Framework namespace.
void bzero_(void *const start, std::uint_fast16_t const len) noexcept
Definition qf_act.cpp:72
QF::Attr priv_
Definition qf_act.cpp:69
QP/C++ framework.
Definition qequeue.hpp:42
constexpr std::uint8_t QTE_FLAG_WAS_DISARMED
Definition qp_pkg.hpp:79
void QEvt_refCtr_inc_(QEvt const *const e) noexcept
Definition qp_pkg.hpp:81
void QEvt_refCtr_dec_(QEvt const *const e) noexcept
Decrement the refCtr of a const event (requires casting const away)
Definition qp_pkg.hpp:89
constexpr std::uint8_t QTE_FLAG_IS_LINKED
Definition qp_pkg.hpp:78
#define QF_EPOOL_TYPE_
Definition qk.hpp:168
#define QF_MAX_EPOOL
Maximum # event pools in the system (0..15)
#define QF_CONST_CAST_(type_, ptr_)
Definition qp_pkg.hpp:71