QP/C++ 8.1.2
Real-Time Event Framework
Loading...
Searching...
No Matches
qv.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 QV_HPP_
30#define QV_HPP_
31
32//============================================================================
33namespace QP {
34
35//----------------------------------------------------------------------------
36class QV {
37public:
39 std::uint8_t schedCeil;
40
41
42 QV() noexcept;
43 static void schedDisable(std::uint8_t const ceiling) noexcept;
44 static void schedEnable() noexcept;
45 static void onIdle();
46
47 static QV priv_;
48
49}; // class QV
50
51} // namespace QP
52
53//============================================================================
54// interface used only for internal implementation, but not in applications
55
56#ifdef QP_IMPL
57//! @cond INTERNAL
58
59// scheduler locking for QV (not needed)...
60#define QF_SCHED_STAT_
61#define QF_SCHED_LOCK_(dummy) (static_cast<void>(0))
62#define QF_SCHED_UNLOCK_() (static_cast<void>(0))
63
64// QActive event queue customization for QV...
65#define QACTIVE_EQUEUE_WAIT_(me_) (static_cast<void>(0))
66#define QACTIVE_EQUEUE_SIGNAL_(me_) \
67 (QV::priv_.readySet.insert((me_)->m_prio))
68
69// QMPool operations
70#define QF_EPOOL_TYPE_ QMPool
71#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_) \
72 (p_).init((poolSto_), (poolSize_), (evtSize_))
73#define QF_EPOOL_EVENT_SIZE_(p_) ((p_).getBlockSize())
74#define QF_EPOOL_GET_(p_, e_, m_, qsId_) \
75 ((e_) = static_cast<QEvt *>((p_).get((m_), (qsId_))))
76#define QF_EPOOL_PUT_(p_, e_, qsId_) ((p_).put((e_), (qsId_)))
77#define QF_EPOOL_USE_(ePool_) ((ePool_)->getUse())
78#define QF_EPOOL_FREE_(ePool_) ((ePool_)->getFree())
79#define QF_EPOOL_MIN_(ePool_) ((ePool_)->getMin())
80
81//! @endcond
82#endif // QP_IMPL
83
84#endif // QV_HPP_
Set of Active Objects of up to QF_MAX_ACTIVE elements.
Definition qp.hpp:447
std::uint8_t schedCeil
Definition qv.hpp:39
static QV priv_
Definition qv.hpp:47
QV() noexcept
Definition qv.cpp:56
QPSet readySet
Set of active-objects/threads that are ready to run in the QV kernel.
Definition qv.hpp:38
static void schedDisable(std::uint8_t const ceiling) noexcept
Definition qv.cpp:62
static void schedEnable() noexcept
Definition qv.cpp:81
static void onIdle()
QP/C++ Framework namespace.
Definition qequeue.hpp:36