diff --git a/doxygen/metrics.dox b/doxygen/metrics.dox index 26dd3612..c02e009a 100644 --- a/doxygen/metrics.dox +++ b/doxygen/metrics.dox @@ -62,7 +62,7 @@ 1 1 14 1 1 QP::QActiveDummy::init@605-605@..\include\qs.hpp 1 1 14 1 1 QP::QXThread::init@86-86@..\include\qxthread.hpp 6 1 51 5 6 QP::QXThread::start@99-104@..\include\qxthread.hpp - 2 1 11 1 3 QP::QEvt@101-103@..\src\qf\qep_hsm.cpp + 2 1 15 2 3 QP::QEvt@101-103@..\src\qf\qep_hsm.cpp 4 1 27 1 4 QP::QHsm::QHsm@119-122@..\src\qf\qep_hsm.cpp 2 1 8 0 2 QP::QHsm::~QHsm@128-129@..\src\qf\qep_hsm.cpp 48 7 342 1 68 QP::QHsm::init@140-207@..\src\qf\qep_hsm.cpp @@ -122,13 +122,13 @@ 5 1 27 1 5 QP::QMActive::childStateObj@85-89@..\src\qf\qf_qmact.cpp 69 7 375 2 100 QP::QF::tickX_@79-178@..\src\qf\qf_time.cpp 13 3 61 1 13 QP::QF::noTimeEvtsActiveX@205-217@..\src\qf\qf_time.cpp - 16 2 100 3 32 QP::QTimeEvt::QTimeEvt@230-261@..\src\qf\qf_time.cpp - 13 1 49 0 27 QP::QTimeEvt::QTimeEvt@267-293@..\src\qf\qf_time.cpp - 33 7 205 2 57 QP::QTimeEvt::armX@321-377@..\src\qf\qf_time.cpp - 32 2 155 1 38 QP::QTimeEvt::disarm@395-432@..\src\qf\qf_time.cpp - 33 7 199 1 58 QP::QTimeEvt::rearm@454-511@..\src\qf\qf_time.cpp - 5 1 28 1 5 QP::QTimeEvt::wasDisarmed@533-537@..\src\qf\qf_time.cpp - 7 1 28 1 9 QP::QTimeEvt::currCtr@552-560@..\src\qf\qf_time.cpp + 16 2 104 3 32 QP::QTimeEvt::QTimeEvt@230-261@..\src\qf\qf_time.cpp + 13 1 53 0 29 QP::QTimeEvt::QTimeEvt@267-295@..\src\qf\qf_time.cpp + 33 7 205 2 57 QP::QTimeEvt::armX@323-379@..\src\qf\qf_time.cpp + 32 2 155 1 38 QP::QTimeEvt::disarm@397-434@..\src\qf\qf_time.cpp + 33 7 199 1 58 QP::QTimeEvt::rearm@456-513@..\src\qf\qf_time.cpp + 5 1 28 1 5 QP::QTimeEvt::wasDisarmed@535-539@..\src\qf\qf_time.cpp + 7 1 28 1 9 QP::QTimeEvt::currCtr@554-562@..\src\qf\qf_time.cpp 11 2 79 1 16 QP::QF::init@78-93@..\src\qk\qk.cpp 3 1 14 1 4 QP::QF::stop@111-114@..\src\qk\qk.cpp 6 2 26 1 8 QP::initial_events@119-126@..\src\qk\qk.cpp @@ -198,7 +198,7 @@ NLOC Avg.NLOC AvgCCN Avg.token function_cnt file 12 0.0 0.0 0.0 0 ..\include\qv.hpp 32 0.0 0.0 0.0 0 ..\include\qxk.hpp 62 3.5 1.0 32.5 2 ..\include\qxthread.hpp - 320 33.4 5.3 192.4 9 ..\src\qf\qep_hsm.cpp + 320 33.4 5.3 192.9 9 ..\src\qf\qep_hsm.cpp 310 36.9 6.4 216.0 8 ..\src\qf\qep_msm.cpp 62 12.5 3.5 91.8 4 ..\src\qf\qf_act.cpp 242 25.4 4.0 147.9 9 ..\src\qf\qf_actq.cpp @@ -209,7 +209,7 @@ NLOC Avg.NLOC AvgCCN Avg.token function_cnt file 11 8.0 3.0 59.0 1 ..\src\qf\qf_qact.cpp 159 30.0 4.0 154.4 5 ..\src\qf\qf_qeq.cpp 27 3.8 1.0 25.3 6 ..\src\qf\qf_qmact.cpp - 232 24.6 3.4 133.3 9 ..\src\qf\qf_time.cpp + 232 24.6 3.4 134.2 9 ..\src\qf\qf_time.cpp 184 18.8 4.1 122.2 9 ..\src\qk\qk.cpp 76 16.0 3.8 96.5 4 ..\src\qv\qv.cpp 267 22.5 4.3 142.4 11 ..\src\qxk\qxk.cpp @@ -229,6 +229,6 @@ NLOC Avg.NLOC AvgCCN Avg.token function_cnt file ========================================================================================== Total nloc Avg.NLOC AvgCCN Avg.token Fun Cnt Warning cnt Fun Rt nloc Rt ------------------------------------------------------------------------------------------ - 3972 16.9 3.1 103.0 174 1 0.01 0.04 + 3972 16.9 3.1 103.1 174 1 0.01 0.04 @endcode */ diff --git a/include/qep.hpp b/include/qep.hpp index 308ef8e7..50b0f3f7 100644 --- a/include/qep.hpp +++ b/include/qep.hpp @@ -155,15 +155,15 @@ namespace QP { //************************************************************************ class QEvt { public: - //! public constructor (dynamic event) - explicit QEvt(QSignal const s) noexcept + //! public constructor (overload for dynamic events) + QEvt(QSignal const s) noexcept : sig(s) // poolId_/refCtr_ intentionally uninitialized {} - enum StaticEvt : std::uint8_t { STATIC_EVT }; - //! public constructor (static event) - explicit QEvt(QSignal const s, StaticEvt /*dummy*/) noexcept + //! public constructor (overload for static events) + enum StaticEvt : std::uint8_t { STATIC_EVT }; + constexpr QEvt(QSignal const s, StaticEvt /*dummy*/) noexcept : sig(s), poolId_(0U), refCtr_(0U) diff --git a/ports/win32-qutest/qep_port.hpp b/ports/win32-qutest/qep_port.hpp index c25ae3b9..a6318dcd 100644 --- a/ports/win32-qutest/qep_port.hpp +++ b/ports/win32-qutest/qep_port.hpp @@ -2,8 +2,8 @@ /// @brief port to Win32 with GNU or Visual Studio C/C++ compilers /// @cond ///*************************************************************************** -/// Last updated for version 6.8.0 -/// Last updated on 2020-01-22 +/// Last updated for version 6.8.1 +/// Last updated on 2020-04-07 /// /// Q u a n t u m L e a P s /// ------------------------ @@ -50,6 +50,10 @@ #endif +// uncomment to provide QEvt constructors +//#define Q_EVT_CTOR 1 +//#define Q_EVT_VIRTUAL 1 + #include // Exact-width types. C++11 Standard #include "qep.hpp" // QEP platform-independent public interface diff --git a/ports/win32-qv/qep_port.hpp b/ports/win32-qv/qep_port.hpp index c25ae3b9..a6318dcd 100644 --- a/ports/win32-qv/qep_port.hpp +++ b/ports/win32-qv/qep_port.hpp @@ -2,8 +2,8 @@ /// @brief port to Win32 with GNU or Visual Studio C/C++ compilers /// @cond ///*************************************************************************** -/// Last updated for version 6.8.0 -/// Last updated on 2020-01-22 +/// Last updated for version 6.8.1 +/// Last updated on 2020-04-07 /// /// Q u a n t u m L e a P s /// ------------------------ @@ -50,6 +50,10 @@ #endif +// uncomment to provide QEvt constructors +//#define Q_EVT_CTOR 1 +//#define Q_EVT_VIRTUAL 1 + #include // Exact-width types. C++11 Standard #include "qep.hpp" // QEP platform-independent public interface diff --git a/ports/win32/qep_port.hpp b/ports/win32/qep_port.hpp index c25ae3b9..a6318dcd 100644 --- a/ports/win32/qep_port.hpp +++ b/ports/win32/qep_port.hpp @@ -2,8 +2,8 @@ /// @brief port to Win32 with GNU or Visual Studio C/C++ compilers /// @cond ///*************************************************************************** -/// Last updated for version 6.8.0 -/// Last updated on 2020-01-22 +/// Last updated for version 6.8.1 +/// Last updated on 2020-04-07 /// /// Q u a n t u m L e a P s /// ------------------------ @@ -50,6 +50,10 @@ #endif +// uncomment to provide QEvt constructors +//#define Q_EVT_CTOR 1 +//#define Q_EVT_VIRTUAL 1 + #include // Exact-width types. C++11 Standard #include "qep.hpp" // QEP platform-independent public interface diff --git a/src/qf/qep_hsm.cpp b/src/qf/qep_hsm.cpp index fdfa9cd2..f7407ae8 100644 --- a/src/qf/qep_hsm.cpp +++ b/src/qf/qep_hsm.cpp @@ -93,12 +93,12 @@ enum : QSignal { /// to state handler functions of QP::QHsm and QP::QFsm subclasses to execute /// entry actions, exit actions, and initial transitions. /// -static QEvt const QEP_reservedEvt_[4] = { +static QEvt const QEP_reservedEvt_[4] { #ifdef Q_EVT_CTOR // Is the QEvt constructor provided? - QEvt(0U), - QEvt(1U), - QEvt(2U), - QEvt(3U) + QEvt(0U, QEvt::STATIC_EVT), + QEvt(1U, QEvt::STATIC_EVT), + QEvt(2U, QEvt::STATIC_EVT), + QEvt(3U, QEvt::STATIC_EVT) #else // QEvt is a POD (Plain Old Datatype) { 0U, 0U, 0U }, { 1U, 0U, 0U }, diff --git a/src/qf/qf_time.cpp b/src/qf/qf_time.cpp index 943fd52d..7789b83a 100644 --- a/src/qf/qf_time.cpp +++ b/src/qf/qf_time.cpp @@ -3,8 +3,8 @@ /// @ingroup qf /// @cond ///*************************************************************************** -/// Last updated for version 6.8.0 -/// Last updated on 2020-03-29 +/// Last updated for version 6.8.1 +/// Last updated on 2020-04-05 /// /// Q u a n t u m L e a P s /// ------------------------ @@ -231,7 +231,7 @@ QTimeEvt::QTimeEvt(QActive * const act, enum_t const sgnl, std::uint_fast8_t const tickRate) noexcept : #ifdef Q_EVT_CTOR - QEvt(static_cast(sgnl)), + QEvt(static_cast(sgnl), QEvt::STATIC_EVT), #else QEvt(), #endif @@ -267,7 +267,7 @@ QTimeEvt::QTimeEvt(QActive * const act, QTimeEvt::QTimeEvt() noexcept : #ifdef Q_EVT_CTOR - QEvt(0U), + QEvt(0U, QEvt::STATIC_EVT), #else QEvt(), #endif // Q_EVT_CTOR @@ -278,7 +278,6 @@ QTimeEvt::QTimeEvt() noexcept { #ifndef Q_EVT_CTOR sig = 0U; -#endif // Q_EVT_CTOR // Setting the POOL_ID event attribute to zero is correct only for // events not allocated from event pools, which must be the case @@ -290,6 +289,9 @@ QTimeEvt::QTimeEvt() noexcept // reused to hold the tickRate as well as other information // refCtr_ = 0U; // default rate 0 + +#endif // Q_EVT_CTOR + } //****************************************************************************