QP/C++  7.4.0-rc.1
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 6.1.1 <www.state-machine.com/qm>.
7// DO NOT EDIT THIS FILE MANUALLY. All your changes will be lost.
8//
9// This code is covered by the following QP license:
10// License # : LicenseRef-QL-dual
11// Issued to : Any user of the QP/C++ real-time embedded framework
12// Framework(s) : qpcpp
13// Support ends : 2024-12-31
14// License scope:
15//
16// Copyright (C) 2005 Quantum Leaps, LLC <state-machine.com>.
17//
18// Q u a n t u m L e a P s
19// ------------------------
20// Modern Embedded Software
21//
22// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-QL-commercial
23//
24// This software is dual-licensed under the terms of the open source GNU
25// General Public License version 3 (or any later version), or alternatively,
26// under the terms of one of the closed source Quantum Leaps commercial
27// licenses.
28//
29// The terms of the open source GNU General Public License version 3
30// can be found at: <www.gnu.org/licenses/gpl-3.0>
31//
32// The terms of the closed source Quantum Leaps commercial licenses
33// can be found at: <www.state-machine.com/licensing>
34//
35// Redistributions in source code must retain this top-level comment block.
36// Plagiarizing this software to sidestep the license obligations is illegal.
37//
38// Contact information:
39// <www.state-machine.com/licensing>
40// <info@state-machine.com>
41//
42//$endhead${include::qp_pkg.hpp} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43#ifndef QP_PKG_HPP_
44#define QP_PKG_HPP_
45
46//$declare${QF::QF-pkg} vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
47namespace QP {
48namespace QF {
49
50//${QF::QF-pkg::Attr} ........................................................
51class Attr {
52public:
53
54#if (QF_MAX_EPOOL > 0U)
56#endif // (QF_MAX_EPOOL > 0U)
57
58#if (QF_MAX_EPOOL > 0U)
59 std::uint_fast8_t maxPool_;
60#endif // (QF_MAX_EPOOL > 0U)
61
62#if (QF_MAX_EPOOL == 0U)
63 std::uint8_t dummy;
64#endif // (QF_MAX_EPOOL == 0U)
65}; // class Attr
66
67//${QF::QF-pkg::priv_} .......................................................
68extern QF::Attr priv_;
69
70//${QF::QF-pkg::bzero_} ......................................................
71void bzero_(
72 void * const start,
73 std::uint_fast16_t const len) noexcept;
74
75} // namespace QF
76} // namespace QP
77//$enddecl${QF::QF-pkg} ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78
79#define QF_CONST_CAST_(type_, ptr_) const_cast<type_>(ptr_)
80#define QF_PTR_RANGE_(x_, min_, max_) (((min_) <= (x_)) && ((x_) <= (max_)))
81#define Q_UINTPTR_CAST_(ptr_) (reinterpret_cast<std::uintptr_t>(ptr_))
82#define Q_ACTION_CAST(act_) (reinterpret_cast<QP::QActionHandler>(act_))
83
84namespace QP {
85
86// Bitmasks are for the QTimeEvt::refCtr_ attribute (inherited from QEvt).
87// In QTimeEvt this attribute is NOT used for reference counting.
88constexpr std::uint8_t TE_IS_LINKED = 1U << 7U; // flag
89constexpr std::uint8_t TE_WAS_DISARMED = 1U << 6U; // flag
90constexpr std::uint8_t TE_TICK_RATE = 0x0FU; // bitmask
91
92inline void QEvt_refCtr_inc_(QEvt const * const e) noexcept {
93 (QF_CONST_CAST_(QEvt*, e))->refCtr_ = e->refCtr_ + 1U;
94}
95
96inline void QEvt_refCtr_dec_(QEvt const * const e) noexcept {
97 (QF_CONST_CAST_(QEvt*, e))->refCtr_ = e->refCtr_ - 1U;
98}
99
100} // namespace QP
101
102#endif // QP_PKG_HPP_
Event class.
Definition qp.hpp:137
Private attributes of the QF framework.
Definition qp_pkg.hpp:51
QF_EPOOL_TYPE_ ePool_[QF_MAX_EPOOL]
Array of event pools sized for the maximum allowed number of pools.
Definition qp_pkg.hpp:55
std::uint_fast8_t maxPool_
Number of event pools managed by the QF Framework.
Definition qp_pkg.hpp:59
void bzero_(void *const start, std::uint_fast16_t const len) noexcept
Definition qf_act.cpp:81
QF::Attr priv_
Definition qf_act.cpp:78
QP/C++ framework.
Definition qequeue.hpp:50
constexpr std::uint8_t TE_IS_LINKED
Definition qp_pkg.hpp:88
void QEvt_refCtr_inc_(QEvt const *const e) noexcept
Definition qp_pkg.hpp:92
constexpr std::uint8_t TE_WAS_DISARMED
Definition qp_pkg.hpp:89
void QEvt_refCtr_dec_(QEvt const *const e) noexcept
Decrement the refCtr of a const event (requires casting const away)
Definition qp_pkg.hpp:96
constexpr std::uint8_t TE_TICK_RATE
Definition qp_pkg.hpp:90
#define QF_EPOOL_TYPE_
Definition qk.hpp:177
#define QF_MAX_EPOOL
Maximum # event pools in the system (0..15)
#define QF_CONST_CAST_(type_, ptr_)
Definition qp_pkg.hpp:79