Skip to content

Commit cee91dd

Browse files
committed
8.1.1
1 parent b326819 commit cee91dd

File tree

8 files changed

+27
-44
lines changed

8 files changed

+27
-44
lines changed

include/qp.hpp

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
#define QP_HPP_
3131

3232
//============================================================================
33-
#define QP_VERSION_STR "8.1.0"
34-
#define QP_VERSION 810U
35-
// <VER>=810 <DATE>=250930
36-
#define QP_RELEASE 0x6A6F1BB5U
33+
#define QP_VERSION_STR "8.1.1"
34+
#define QP_VERSION 811U
35+
// <VER>=810 <DATE>=251008
36+
#define QP_RELEASE 0x6A6334D4U
3737

3838
//----------------------------------------------------------------------------
3939
// default configuration settings
@@ -218,9 +218,7 @@ class QAsm {
218218
QEvt const * const e,
219219
std::uint_fast8_t const qsId) = 0;
220220
virtual bool isIn(QStateHandler const stateHndl) = 0;
221-
#ifdef Q_SPY
222221
virtual QStateHandler getStateHandler() const noexcept = 0;
223-
#endif
224222

225223
QStateHandler state() const noexcept {
226224
return m_state.fun; // public "getter" for the state handler
@@ -310,11 +308,9 @@ class QHsm : public QP::QAsm {
310308
void dispatch(
311309
QEvt const * const e,
312310
std::uint_fast8_t const qsId) override;
313-
#ifdef Q_SPY
311+
bool isIn(QStateHandler const stateHndl) noexcept override;
314312
QStateHandler getStateHandler() const noexcept override;
315-
#endif
316313

317-
bool isIn(QStateHandler const stateHndl) noexcept override;
318314
QStateHandler childState(QStateHandler const parentHndl) noexcept;
319315

320316
private:
@@ -348,14 +344,12 @@ class QMsm : public QP::QAsm {
348344
void dispatch(
349345
QEvt const * const e,
350346
std::uint_fast8_t const qsId) override;
351-
#ifdef Q_SPY
347+
bool isIn(QStateHandler const stateHndl) noexcept override;
352348
QStateHandler getStateHandler() const noexcept override;
353-
#endif
354349

355-
static QMState const * topQMState() noexcept;
356-
bool isIn(QStateHandler const stateHndl) noexcept override;
357350
QMState const * childStateObj(QMState const * const parentHndl)
358351
const noexcept;
352+
static QMState const * topQMState() noexcept;
359353

360354
private:
361355
QState execTatbl_(
@@ -536,10 +530,9 @@ class QActive : public QP::QAsm {
536530
void dispatch(
537531
QEvt const * const e,
538532
std::uint_fast8_t const qsId) override;
539-
#ifdef Q_SPY
540-
QStateHandler getStateHandler() const noexcept override;
541-
#endif
542533
bool isIn(QStateHandler const stateHndl) noexcept override;
534+
QStateHandler getStateHandler() const noexcept override;
535+
543536
QStateHandler childState(QStateHandler const parentHandler) noexcept;
544537
void setAttr(
545538
std::uint32_t attr1,
@@ -683,11 +676,9 @@ class QMActive : public QP::QActive {
683676
QEvt const * const e,
684677
std::uint_fast8_t const qsId) override;
685678
bool isIn(QStateHandler const stateHndl) noexcept override;
686-
QMState const *childStateObj(QMState const * const parent) const noexcept;
687-
688-
#ifdef Q_SPY
689679
QStateHandler getStateHandler() const noexcept override;
690-
#endif // def Q_SPY
680+
681+
QMState const *childStateObj(QMState const * const parent) const noexcept;
691682
}; // class QMActive
692683

693684
//----------------------------------------------------------------------------

qpcpp_8.1.0.sha1 renamed to qpcpp_8.1.1.sha1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
c2ac64078c92429e6ea52a527a4ee56cc106a0a9 *include/qequeue.hpp
22
c222b081c4f0f5dbfcd39dcdc87f82d586ef9b15 *include/qk.hpp
33
d299b9482e86b87001cee203c1f0c21293980699 *include/qmpool.hpp
4-
92042170e7d04b05eb9c4b2a98a79a1018a0a23d *include/qp.hpp
4+
fa1cc0d5136c74174198c929060a1bae8dc280be *include/qp.hpp
55
8ff45f7c77045265339f6bfc4b5366c0c4bb254d *include/qp_pkg.hpp
66
4764321b447e0e0ac3e50ca16c48188df5868dc6 *include/qpcpp.hpp
7-
a3b77b9a2e86ad7861c81c7788f819e64a97af92 *include/qs.hpp
7+
2093bb5bf0619b53dcb2e189f6e3fad773822c13 *include/qs.hpp
88
5b07a296f7689e957b5b9e2ed3767fb67d3cf049 *include/qs_dummy.hpp
99
449b8b5b8dee8baeb7bef5b63d44fb04cbd0d436 *include/qs_pkg.hpp
1010
6054504a150163f4a478fa4212c3816469c003dc *include/qsafe.h
@@ -13,17 +13,17 @@ a3b77b9a2e86ad7861c81c7788f819e64a97af92 *include/qs.hpp
1313
7610f4b25eba345a6d8c846e10c48e199cd3fbac *include/qxk.hpp
1414
2b05a89f7e519ef393c27e556c22edb971e1f865 *include/README.md
1515
71899ce74eeb04f333ed00d53f87719f722a39ab *src/qf/CMakeLists.txt
16-
8494d9aba98f1083c2820ce3e6ba2cc5a3664976 *src/qf/qep_hsm.cpp
17-
73df3c0077b68deb5b66c0e4a29fe86b2d540613 *src/qf/qep_msm.cpp
16+
e2b67daf3916eb8b7b2aa90437b4ca0391988410 *src/qf/qep_hsm.cpp
17+
91f544c88ec0909ce802da08bc981f1abcb37b3b *src/qf/qep_msm.cpp
1818
e32d4799c059f6504537dca502fb6908baa9a126 *src/qf/qf_act.cpp
1919
83e9ee8eb2b112a319532bc6c2f08ed34d877655 *src/qf/qf_actq.cpp
2020
386592abb28a0dff83a9ab64400d02350eb84c20 *src/qf/qf_defer.cpp
2121
23284ccad1dc03dca438721970b17d5ad67acba5 *src/qf/qf_dyn.cpp
2222
9aed73a85db1c734736404a8be6a37ebe6e35f91 *src/qf/qf_mem.cpp
2323
d1e62ee3c02e002e3cab4e458de683b807e644bd *src/qf/qf_ps.cpp
24-
f876bf6b0f1826a471c4b6cb9b6f98147eb3dd18 *src/qf/qf_qact.cpp
24+
3cc49360c1d69cdc33b2c08cc657889cfea5947b *src/qf/qf_qact.cpp
2525
6bf00dc6980960064f84750c8011d77437452e75 *src/qf/qf_qeq.cpp
26-
1fd5aa19bf8454ac39ce324ec458dd4fadf2c78c *src/qf/qf_qmact.cpp
26+
71b607d20050f4a9eecd681fea1091b5a3faf510 *src/qf/qf_qmact.cpp
2727
0486d3abc1ec3b3dc1ea320181c4ca6bb809cad9 *src/qf/qf_time.cpp
2828
7cdab433e81612862fd27f0cf792d38e1197d064 *src/qk/CMakeLists.txt
2929
dfa59caacffb6d5c1a45b5f3e0b82f4316890ea1 *src/qk/qk.cpp
@@ -33,7 +33,7 @@ eb28260d471fc752ca54b2c1e2d763f28432c2c1 *src/qs/CMakeLists.txt
3333
0dd2c3c6e5ac20dc9a5a50ecba426b0516c28648 *src/qs/qs_fp.cpp
3434
56bdcf492f2ce83529bb24b149b8fb99aabff521 *src/qs/qs_rx.cpp
3535
c97bda54ac3be8da467c70440f983fa934eaa864 *src/qs/qstamp.cpp
36-
20b034d6b3b6dfadd5a795e8c5bda1cb4d218989 *src/qs/qutest.cpp
36+
006337efd40f1403b785b924a013ddf6baa85a0e *src/qs/qutest.cpp
3737
b6d93a16f5b176d3da4888a7efb265730337f46d *src/qv/CMakeLists.txt
3838
04092fcc4b555c932a4f81ace6132c2a99fe3d47 *src/qv/qv.cpp
3939
ff8ed0166b3d96865df8d07d92bd82301f9aa1bf *src/qxk/qxk.cpp

sha1.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@setlocal
22

3-
set FNAME=qpcpp_8.1.0.sha1
3+
set FNAME=qpcpp_8.1.1.sha1
44

55
:: usage
66
@echo Usage: sha1 [gen]

src/qf/qep_hsm.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ void QHsm::init(
162162
QS_CRIT_ENTRY();
163163
bool toDo = false; // assume that dictionary not produced
164164
if ((QS::priv_.flags & 0x01U) == 0U) { // dictionary not produced yet?
165-
QS::priv_.flags |= 0x01U; // mark the QHsm_top dictionary as produced
165+
QS::priv_.flags |= 0x01U; // mark the QHsm::top dictionary as produced
166166
toDo = true;
167167
}
168168
QS_CRIT_EXIT();
@@ -248,7 +248,6 @@ void QHsm::dispatch(
248248

249249
// process the event hierarchically...
250250
std::array <QStateHandler, QHSM_MAX_NEST_DEPTH_> path; // entry path array
251-
path[0] = s; // save current state
252251
m_temp.fun = s;
253252
QState r; // state handler return value
254253
std::int_fast8_t ip = QHSM_MAX_NEST_DEPTH_;//path index & fixed loop bound
@@ -271,7 +270,10 @@ void QHsm::dispatch(
271270
}
272271
} while (r == Q_RET_SUPER); // loop as long as superstate returned
273272

274-
if (r == Q_RET_HANDLED) { // did the last handler handle event e?
273+
if (r == Q_RET_IGNORED) { // was event e ignored?
274+
QS_TRAN0_(QS_QEP_IGNORED, m_state.fun); // output QS record
275+
}
276+
else if (r == Q_RET_HANDLED) { // did the last handler handle event e?
275277
QS_TRAN0_(QS_QEP_INTERN_TRAN, s); // output QS record
276278
}
277279
else if ((r == Q_RET_TRAN) || (r == Q_RET_TRAN_HIST)) { // tran. taken?
@@ -304,15 +306,13 @@ void QHsm::dispatch(
304306
// enter the target (possibly recursively) by initial trans.
305307
enter_target_(&path[0], ip, qsId);
306308
QS_TRAN_END_(QS_QEP_TRAN, s, path[0]); // output QS record
307-
}
308-
else if (r == Q_RET_IGNORED) { // was event e ignored?
309-
QS_TRAN0_(QS_QEP_IGNORED, m_state.fun); // output QS record
309+
310+
m_state.fun = path[0]; // change the current active state
310311
}
311312
else {
312313
Q_ERROR_LOCAL(360); // last state handler returned impossible value
313314
}
314315

315-
m_state.fun = path[0]; // change the current active state
316316
#ifndef Q_UNSAFE
317317
// establish stable state configuration
318318
m_temp.uint = dis_update<std::uintptr_t>(m_state.uint);
@@ -593,12 +593,10 @@ QStateHandler QHsm::childState(QStateHandler const parentHndl) noexcept {
593593
}
594594

595595
//............................................................................
596-
#ifdef Q_SPY
597596
QStateHandler QHsm::getStateHandler() const noexcept {
598597
// NOTE: this function does NOT apply critical section, so it can
599598
// be safely called from an already established critical section.
600599
return m_state.fun; // public "getter" to the state handler (function)
601600
}
602-
#endif
603601

604602
} // namespace QP

src/qf/qep_msm.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,11 +427,9 @@ QMState const * QMsm::childStateObj(QMState const * const parentHndl)
427427
return child;
428428
}
429429
//............................................................................
430-
#ifdef Q_SPY
431430
QStateHandler QMsm::getStateHandler() const noexcept {
432431
// return the current state handler (function pointer)
433432
return m_state.obj->stateHandler;
434433
}
435-
#endif
436434

437435
} // namespace QP

src/qf/qf_qact.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,10 @@ QActive* QActive::fromRegistry(std::uint_fast8_t const prio) {
162162
return QActive_registry_[prio];
163163
}
164164
//............................................................................
165-
#ifdef Q_SPY
166165
QStateHandler QActive::getStateHandler() const noexcept {
167166
// delegate to the QHsm class
168167
return reinterpret_cast<QHsm const *>(this)->QHsm::getStateHandler();
169168
}
170-
#endif // def Q_SPY
171169

172170
//----------------------------------------------------------------------------
173171
#ifndef QF_LOG2

src/qf/qf_qmact.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,9 @@ QMState const * QMActive::childStateObj(QMState const * const parent) const noex
8282
->QMsm::childStateObj(parent);
8383
}
8484
//............................................................................
85-
#ifdef Q_SPY
8685
QStateHandler QMActive::getStateHandler() const noexcept {
8786
// delegate to the QMsm class
8887
return reinterpret_cast<QMsm const *>(this)->QMsm::getStateHandler();
8988
}
90-
#endif // def Q_SPY
9189

9290
} // namespace QP

0 commit comments

Comments
 (0)