Skip to content

Commit

Permalink
8.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum-leaps committed Feb 25, 2025
1 parent 0811544 commit 46560cf
Show file tree
Hide file tree
Showing 98 changed files with 610 additions and 552 deletions.
52 changes: 32 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ git clone https://github.com/QuantumLeaps/qpcpp --recurse-submodules --depth 1
Alternatively, you can also download one of the stable
[QP/C++ Releases][QP-Rel].

# About QP/C++ Real-Time Embedded Framework
QP/C++ real-time embedded framework (RTEF) is a lightweight implementation of
the [Active Object (a.k.a. Actor) model of computation][AOmod] specifically
tailored for deeply embedded real-time systems, such as microcontrollers (MCUs).
# About QP/C++ Real-Time Event Framework
QP/C++ real-time event framework (RTEF) is a lightweight implementation of
the asynchronous, event-driven [Active Object (a.k.a. Actor) model of computation][AOmod]
specifically designed for real-time embedded systems, such as microcontrollers (MCUs).
QP/C++ is both a software infrastructure for building applications consisting
of Active Objects (Actors) and a runtime environment for executing the Active
Objects in a deterministic, real-time fashion. Additionally, QP/C++ Framework
Expand All @@ -35,19 +35,27 @@ QP editions:
|QP Edition | Language | API | Safety Functions |Certification Artifacts| Licensing
|:----------|:-----------:|:-----------------|:-------------------|:----------------|:---------
| QP/C | C (C11) |same as SafeQP/C |Selected Assertions |Req/Arch/Design | [dual][Lic]
| SafeQP/C | C (C11) |same as QP/C |All Safety Functions|Certification Kit| [commercial][Com]
| QP/C++ | C++ (C++17) |same as SafeQP/C++|Selected Assertions |Req/Arch/Design | [dual][Lic]
| SafeQP/C++| C++ (C++17) |same as QP/C++ |All Safety Functions|Certification Kit| [commercial][Com]

[The documentation](#documentation) of all QP editions includes the
[Requirements][SRS], [Architecture][SAS], and [Design Specifications][SDS],
which are the best source of information about the underlying concepts,
functionality, architecture, and design of the QP Frameworks and the QP
Applications based on the frameworks.

> **NOTE:** The **SafeQP** frameworks additionally contain **Safety Functions**
required to achieve the higher safety integrity levels and come with much more
extensive [Certification Kits][Cert].
| SafeQP/C | C (C11) |same as QP/C |All Safety Functions|Extensive<br>Certification Kit| [commercial][Com]
| SafeQP/C++| C++ (C++17) |same as QP/C++ |All Safety Functions|Extensive<br>Certification Kit| [commercial][Com]

The **SafeQP/C** and **SafeQP/C++** frameworks were originally derived from QP/C and QP/C++,
respectively, but were extensively reengineered for the safety market using compliant
Software Safety Lifecycle (SSL). In this process, the QP framework functional model has been
subjected to a full Hazard and Risk Analysis, which identified all areas of weakness within
the functional model and API. These findings led to creation of Safety Requirements and risk
mitigation by Safety Functions, which were subsequently implemented, verified, and validated.
The SafeQP frameworks are accompanied by the "SafeQP Certification Kits", which provide
developers with ready-to-use artifacts, enabling them to save time, mitigate risk, and reduce
costs during application certification for safety-critical devices in the industrial, medical,
aerospace, and automotive industries. Please [contact Quantum Leaps](#contact-information)
for more information about the SafeQP frameworks and the "Certification Kits".

> **NOTE:** The SafeQP/C++ edition remain fully API- and functionally compatible with the
corresponding standard QP/C++ framework. This ensures existing QP/C Applications can transition
seamlessly to SafeQP/C++ without requiring any modifications. SafeQP/C edition retain QP/C++
Frameworks' hallmark features, including a small memory footprint, excellent efficiency,
and hard real-time functionality.


# Getting Started with QP/C++
Expand All @@ -61,14 +69,14 @@ that you get all components, tools and examples ready to go.
- ["QP/C++ Tutorial"][Tut]
describes a series of progressively advanced QP/C++ example applications.

- [Video: "Getting Started with QP Real-Time Embedded Frameworks"][Video]
- [Video: "Getting Started with QP Real-Time Event Frameworks"][Video]
provides instructions on how to download, install, and get started with QP.

- [AppNote: "Getting Started with QP Real-Time Embedded Frameworks"][AN]
- [AppNote: "Getting Started with QP Real-Time Event Frameworks"][AN]
contains also a tutorial, in which you build a simple "Blinky" application.

# Licensing
The QP/C++ real-time embedded framework is licensed under the
The QP/C++ real-time event framework is licensed under the
[dual licensing model](https://www.state-machine.com/licensing), with
the following licensing options:

Expand All @@ -89,6 +97,10 @@ proprietary status of their code.
all QP frameworks can be licensed commercially, in which case you don't use
any open source license and you do not violate your policy.

> NOTE: The **SafeQP** frameworks and the accompanying "Certification Kits"
are licensed commercially only.


## Files Removed from the QP/C++ Open Source GPL Distribution
Due to the widespread non-compliance with the GPL, as well as infringement on the
[dual-licensing model of QP frameworks][Lic], the following QP/C++ components
Expand All @@ -114,7 +126,7 @@ To view the offline documentation, open the file [html/index.html](html/index.ht
in your web browser.


# How to Get Help?
# Contact Information
- [Free Support Forum](https://sourceforge.net/p/qpc/discussion/668726)
- [Bug Reports](https://sourceforge.net/p/qpc/bugs/)
- [Feature Requests](https://sourceforge.net/p/qpc/feature-requests/)
Expand Down
2 changes: 1 addition & 1 deletion examples
Submodule examples updated 253 files
3 changes: 1 addition & 2 deletions include/qequeue.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//============================================================================
// QP/C++ Real-Time Embedded Framework (RTEF)
// Version 8.0.2
// QP/C++ Real-Time Event Framework (RTEF)
//
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
//
Expand Down
3 changes: 1 addition & 2 deletions include/qk.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//============================================================================
// QP/C++ Real-Time Embedded Framework (RTEF)
// Version 8.0.2
// QP/C++ Real-Time Event Framework (RTEF)
//
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
//
Expand Down
12 changes: 1 addition & 11 deletions include/qmpool.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//============================================================================
// QP/C++ Real-Time Embedded Framework (RTEF)
// Version 8.0.2
// QP/C++ Real-Time Event Framework (RTEF)
//
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
//
Expand Down Expand Up @@ -76,11 +75,6 @@ class QMPool {
QMPoolCtr volatile m_nFree;
QMPoolCtr m_nMin;

#ifndef Q_UNSAFE
std::uintptr_t m_freeHead_dis;
QMPoolCtr m_nFree_dis;
#endif // ndef Q_UNSAFE

public:
QMPool()
: m_start(nullptr),
Expand All @@ -90,10 +84,6 @@ class QMPool {
m_nTot(0U),
m_nFree(0U),
m_nMin(0U)
#ifndef Q_UNSAFE
,m_freeHead_dis(static_cast<std::uintptr_t>(~0U)),
m_nFree_dis(static_cast<QEQueueCtr>(~0U))
#endif
{}
void init(
void * const poolSto,
Expand Down
104 changes: 43 additions & 61 deletions include/qp.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//============================================================================
// QP/C++ Real-Time Embedded Framework (RTEF)
// Version 8.0.2
// QP/C++ Real-Time Event Framework (RTEF)
//
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
//
Expand Down Expand Up @@ -31,10 +30,10 @@
#define QP_HPP_

//============================================================================
#define QP_VERSION_STR "8.0.2"
#define QP_VERSION 802U
// <VER>=802 <DATE>=250120
#define QP_RELEASE 0x6AEAB45DU
#define QP_VERSION_STR "8.0.3"
#define QP_VERSION 803U
// <VER>=803 <DATE>=250317
#define QP_RELEASE 0x6ACCA50CU

//============================================================================
// default configuration settings
Expand Down Expand Up @@ -180,45 +179,39 @@ constexpr enum_t Q_USER_SIG {4};

//============================================================================
class QAsm {
protected:
public:
QAsmAttr m_state;
QAsmAttr m_temp;

public:
// All possible return values from state-handlers
// NOTE: The ordering is important for algorithmic correctness.
static constexpr QState Q_RET_SUPER {0U};
static constexpr QState Q_RET_UNHANDLED {1U};

//! All possible return values from state-handlers
//! NOTE: The ordering is important for algorithmic correctness.
enum QStateRet : QState {
// unhandled and need to "bubble up"
Q_RET_SUPER, //!< event passed to superstate to handle
Q_RET_UNHANDLED, //!< event unhandled due to a guard
// handled and do not need to "bubble up"
static constexpr QState Q_RET_HANDLED {2U};
static constexpr QState Q_RET_IGNORED {3U};

// handled and do not need to "bubble up"
Q_RET_HANDLED, //!< event handled (internal transition)
Q_RET_IGNORED, //!< event silently ignored (bubbled up to top)
// entry/exit
static constexpr QState Q_RET_ENTRY {4U};
static constexpr QState Q_RET_EXIT {5U};

// entry/exit
Q_RET_ENTRY, //!< state entry action executed
Q_RET_EXIT, //!< state exit action executed
// no side effects
static constexpr QState Q_RET_NULL {6U};

// no side effects
Q_RET_NULL, //!< return value without any effect
// transitions need to execute transition-action table in QP::QMsm
static constexpr QState Q_RET_TRAN {7U};
static constexpr QState Q_RET_TRAN_INIT {8U};

// transitions need to execute transition-action table in QP::QMsm
Q_RET_TRAN, //!< regular transition
Q_RET_TRAN_INIT, //!< initial transition in a state
// transitions that additionally clobber QHsm.m_state
static constexpr QState Q_RET_TRAN_HIST {9U};

// transitions that additionally clobber QHsm.m_state
Q_RET_TRAN_HIST, //!< transition to history of a given state
};

//! Reserved signals by the QP-framework.
enum ReservedSig : QSignal {
Q_EMPTY_SIG, //!< signal to execute the default case
Q_ENTRY_SIG, //!< signal for entry actions
Q_EXIT_SIG, //!< signal for exit actions
Q_INIT_SIG //!< signal for nested initial transitions
};
// Reserved signals by the QP-framework
static constexpr QSignal Q_EMPTY_SIG {0U};
static constexpr QSignal Q_ENTRY_SIG {1U};
static constexpr QSignal Q_EXIT_SIG {2U};
static constexpr QSignal Q_INIT_SIG {3U};

protected:
explicit QAsm() noexcept
Expand All @@ -242,8 +235,8 @@ class QAsm {
virtual void dispatch(
QEvt const * const e,
std::uint_fast8_t const qsId) = 0;
virtual bool isIn(QStateHandler const state) noexcept {
static_cast<void>(state);
virtual bool isIn(QStateHandler const stateHndl) noexcept {
Q_UNUSED_PAR(stateHndl);
return false;
}
QStateHandler state() const noexcept {
Expand Down Expand Up @@ -342,8 +335,8 @@ class QHsm : public QP::QAsm {
void dispatch(
QEvt const * const e,
std::uint_fast8_t const qsId) override;
bool isIn(QStateHandler const state) noexcept override;
QStateHandler childState(QStateHandler const parent) noexcept;
bool isIn(QStateHandler const stateHndl) noexcept override;
QStateHandler childState(QStateHandler const parentHndl) noexcept;

#ifdef Q_SPY
QStateHandler getStateHandler() noexcept override {
Expand Down Expand Up @@ -387,8 +380,9 @@ class QMsm : public QP::QAsm {
return m_state.obj->stateHandler;
}
#endif // def Q_SPY
bool isIn(QStateHandler const state) noexcept override;
QMState const * childStateObj(QMState const * const parent) const noexcept;
bool isIn(QStateHandler const stateHndl) noexcept override;
QMState const * childStateObj(QMState const * const parentHndl)
const noexcept;

private:
QState execTatbl_(
Expand Down Expand Up @@ -565,24 +559,12 @@ class QSubscrList {
}; // class QSubscrList

//============================================================================
class QPtrDis {
private:
std::uintptr_t m_ptr_dis;

// friends...
friend class QTimeEvt;
friend class QXThread;

public:
QPtrDis(void const * const ptr = nullptr) noexcept;
}; // class QPtrDis

class QEQueue; // forward declaration


//============================================================================
class QActive : public QP::QAsm {
protected:
private:
std::uint8_t m_prio;
std::uint8_t m_pthre;

Expand Down Expand Up @@ -640,11 +622,11 @@ class QActive : public QP::QAsm {
{
reinterpret_cast<QHsm *>(this)->QHsm::dispatch(e, qsId);
}
bool isIn(QStateHandler const state) noexcept override {
return reinterpret_cast<QHsm *>(this)->QHsm::isIn(state);
bool isIn(QStateHandler const stateHndl) noexcept override {
return reinterpret_cast<QHsm *>(this)->QHsm::isIn(stateHndl);
}
QStateHandler childState(QStateHandler const parent) noexcept {
return reinterpret_cast<QHsm *>(this)->QHsm::childState(parent);
QStateHandler childState(QStateHandler const parentHandler) noexcept {
return reinterpret_cast<QHsm *>(this)->QHsm::childState(parentHandler);
}
void setAttr(
std::uint32_t attr1,
Expand Down Expand Up @@ -755,7 +737,7 @@ class QActive : public QP::QAsm {
//============================================================================
class QMActive : public QP::QActive {
protected:
QMActive(QStateHandler const initial) noexcept;
explicit QMActive(QStateHandler const initial) noexcept;

public:
void init(
Expand All @@ -773,8 +755,8 @@ class QMActive : public QP::QActive {
{
reinterpret_cast<QMsm *>(this)->QMsm::dispatch(e, qsId);
}
bool isIn(QStateHandler const state) noexcept override {
return reinterpret_cast<QMsm *>(this)->QMsm::isIn(state);
bool isIn(QStateHandler const stateHndl) noexcept override {
return reinterpret_cast<QMsm *>(this)->QMsm::isIn(stateHndl);
}

#ifdef Q_SPY
Expand Down
3 changes: 1 addition & 2 deletions include/qp_pkg.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//============================================================================
// QP/C++ Real-Time Embedded Framework (RTEF)
// Version 8.0.2
// QP/C++ Real-Time Event Framework (RTEF)
//
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
//
Expand Down
3 changes: 1 addition & 2 deletions include/qpcpp.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//============================================================================
// QP/C++ Real-Time Embedded Framework (RTEF)
// Version 8.0.2
// QP/C++ Real-Time Event Framework (RTEF)
//
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
//
Expand Down
3 changes: 1 addition & 2 deletions include/qs_dummy.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//============================================================================
// QP/C++ Real-Time Embedded Framework (RTEF)
// Version 8.0.2
// QP/C++ Real-Time Event Framework (RTEF)
//
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
//
Expand Down
1 change: 0 additions & 1 deletion include/qsafe.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//============================================================================
// SafeQP/C Real-Time Embedded Framework (RTEF)
// Version 8.0.2
//
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
//
Expand Down
3 changes: 1 addition & 2 deletions include/qstamp.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//============================================================================
// QP/C++ Real-Time Embedded Framework (RTEF)
// Version 8.0.2
// QP/C++ Real-Time Event Framework (RTEF)
//
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
//
Expand Down
3 changes: 1 addition & 2 deletions include/qv.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//============================================================================
// QP/C++ Real-Time Embedded Framework (RTEF)
// Version 8.0.2
// QP/C++ Real-Time Event Framework (RTEF)
//
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
//
Expand Down
2 changes: 1 addition & 1 deletion ports/arm-cm/qk/armclang/qk_port.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//============================================================================
// QP/C++ Real-Time Embedded Framework (RTEF)
// QP/C++ Real-Time Event Framework (RTEF)
//
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
//
Expand Down
2 changes: 1 addition & 1 deletion ports/arm-cm/qk/armclang/qp_port.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//============================================================================
// QP/C++ Real-Time Embedded Framework (RTEF)
// QP/C++ Real-Time Event Framework (RTEF)
//
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
//
Expand Down
2 changes: 1 addition & 1 deletion ports/arm-cm/qk/armclang/qs_port.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//============================================================================
// QP/C++ Real-Time Embedded Framework (RTEF)
// QP/C++ Real-Time Event Framework (RTEF)
//
// Copyright (C) 2005 Quantum Leaps, LLC. All rights reserved.
//
Expand Down
Loading

0 comments on commit 46560cf

Please sign in to comment.