From 090827832ff7b84816631d85bdbf33d4603fdd40 Mon Sep 17 00:00:00 2001 From: Andrew Gresyk Date: Mon, 25 Nov 2019 09:05:50 +0100 Subject: [PATCH] ^ uglified template arguments --- include/hfsm2/detail/control.inl | 156 +- include/hfsm2/detail/injections.inl | 102 +- include/hfsm2/detail/plan_data.inl | 8 +- include/hfsm2/detail/shared/array.inl | 28 +- include/hfsm2/detail/shared/utility.hpp | 8 +- include/hfsm2/detail/state_registry.inl | 88 +- include/hfsm2/detail/structure/composite.hpp | 4 +- include/hfsm2/detail/structure/composite.inl | 180 +- .../hfsm2/detail/structure/composite_sub.hpp | 2 +- .../detail/structure/composite_sub_1.inl | 182 +- .../detail/structure/composite_sub_2.inl | 182 +- include/hfsm2/detail/structure/forward.hpp | 98 +- include/hfsm2/detail/structure/orthogonal.inl | 128 +- .../detail/structure/orthogonal_sub_1.inl | 128 +- .../detail/structure/orthogonal_sub_2.inl | 130 +- include/hfsm2/detail/structure/root.hpp | 44 +- include/hfsm2/detail/structure/root.inl | 132 +- include/hfsm2/detail/structure/state.inl | 100 +- include/hfsm2/machine.hpp | 1734 ++++++++--------- include/hfsm2/machine_dev.hpp | 34 +- 20 files changed, 1734 insertions(+), 1734 deletions(-) diff --git a/include/hfsm2/detail/control.inl b/include/hfsm2/detail/control.inl index 9f21c47..259fdf9 100644 --- a/include/hfsm2/detail/control.inl +++ b/include/hfsm2/detail/control.inl @@ -3,9 +3,9 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template -ControlT::Region::Region(ControlT& control_, - const RegionID id) +template +ControlT::Region::Region(ControlT& control_, + const RegionID id) : control{control_} , prevId{control._regionId} { @@ -14,16 +14,16 @@ ControlT::Region::Region(ControlT& control_, //------------------------------------------------------------------------------ -template -ControlT::Region::~Region() { +template +ControlT::Region::~Region() { control.resetRegion(prevId); } //////////////////////////////////////////////////////////////////////////////// -template +template void -ControlT::setRegion(const RegionID id) { +ControlT::setRegion(const RegionID id) { HFSM_ASSERT(_regionId <= id && id < RegionList::SIZE); _regionId = id; @@ -31,9 +31,9 @@ ControlT::setRegion(const RegionID id) { //------------------------------------------------------------------------------ -template +template void -ControlT::resetRegion(const RegionID id) { //-V524 +ControlT::resetRegion(const RegionID id) { //-V524 HFSM_ASSERT(id <= _regionId && _regionId < RegionList::SIZE); _regionId = id; @@ -41,9 +41,9 @@ ControlT::resetRegion(const RegionID id) { //-V524 //////////////////////////////////////////////////////////////////////////////// -template -PlanControlT::Origin::Origin(PlanControlT& control_, - const StateID id) +template +PlanControlT::Origin::Origin(PlanControlT& control_, + const StateID id) : control{control_} , prevId{control._originId} { @@ -52,18 +52,18 @@ PlanControlT::Origin::Origin(PlanControlT& control_, //------------------------------------------------------------------------------ -template -PlanControlT::Origin::~Origin() { +template +PlanControlT::Origin::~Origin() { control.resetOrigin(prevId); } //////////////////////////////////////////////////////////////////////////////// -template -PlanControlT::Region::Region(PlanControlT& control_, - const RegionID id, - const StateID index, - const LongIndex size) +template +PlanControlT::Region::Region(PlanControlT& control_, + const RegionID id, + const StateID index, + const LongIndex size) : control{control_} , prevId{control._regionId} , prevIndex{control._regionIndex} @@ -74,8 +74,8 @@ PlanControlT::Region::Region(PlanControlT& control_, //------------------------------------------------------------------------------ -template -PlanControlT::Region::~Region() { +template +PlanControlT::Region::~Region() { control.resetRegion(prevId, prevIndex, prevSize); control._status.clear(); @@ -83,9 +83,9 @@ PlanControlT::Region::~Region() { //////////////////////////////////////////////////////////////////////////////// -template +template void -PlanControlT::setOrigin(const StateID id) { +PlanControlT::setOrigin(const StateID id) { HFSM_ASSERT(_regionId + _regionSize <= StateList::SIZE); HFSM_ASSERT(_originId <= id && id < StateList::SIZE); @@ -94,9 +94,9 @@ PlanControlT::setOrigin(const StateID id) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -PlanControlT::resetOrigin(const StateID id) { //-V524 +PlanControlT::resetOrigin(const StateID id) { //-V524 HFSM_ASSERT(_regionId + _regionSize <= StateList::SIZE); HFSM_ASSERT(id <= _originId && _originId < StateList::SIZE); @@ -105,11 +105,11 @@ PlanControlT::resetOrigin(const StateID id) { //-V524 //------------------------------------------------------------------------------ -template +template void -PlanControlT::setRegion(const RegionID id, - const StateID index, - const LongIndex size) +PlanControlT::setRegion(const RegionID id, + const StateID index, + const LongIndex size) { HFSM_ASSERT(_regionId <= id && id < RegionList::SIZE); HFSM_ASSERT(_regionIndex <= index && index + size <= _regionIndex + _regionSize); @@ -121,11 +121,11 @@ PlanControlT::setRegion(const RegionID id, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -PlanControlT::resetRegion(const RegionID id, //-V524 - const StateID index, - const LongIndex size) +PlanControlT::resetRegion(const RegionID id, //-V524 + const StateID index, + const LongIndex size) { HFSM_ASSERT(id <= _regionId && _regionId < RegionList::SIZE); HFSM_ASSERT(index <= _regionIndex && _regionIndex + _regionSize <= index + size); @@ -137,8 +137,8 @@ PlanControlT::resetRegion(const RegionID id, //-V524 //////////////////////////////////////////////////////////////////////////////// -template -FullControlT::Lock::Lock(FullControlT& control_) +template +FullControlT::Lock::Lock(FullControlT& control_) : control(!control_._locked ? &control_ : nullptr) { if (control) @@ -147,19 +147,19 @@ FullControlT::Lock::Lock(FullControlT& control_) //------------------------------------------------------------------------------ -template -FullControlT::Lock::~Lock() { +template +FullControlT::Lock::~Lock() { if (control) control->_locked = false; } //////////////////////////////////////////////////////////////////////////////// -template +template template Status -FullControlT::updatePlan(TState& headState, - const Status subStatus) +FullControlT::updatePlan(TState& headState, + const Status subStatus) { using State = TState; static constexpr StateID STATE_ID = State::STATE_ID; @@ -202,10 +202,10 @@ FullControlT::updatePlan(TState& headState, //------------------------------------------------------------------------------ -template +template template Status -FullControlT::buildPlanStatus() { +FullControlT::buildPlanStatus() { using State = TState; static constexpr StateID STATE_ID = State::STATE_ID; @@ -235,9 +235,9 @@ FullControlT::buildPlanStatus() { //------------------------------------------------------------------------------ -template +template void -FullControlT::changeTo(const StateID stateId) { +FullControlT::changeTo(const StateID stateId) { if (!_locked) { const Request request{Request::Type::CHANGE, stateId}; _requests << request; @@ -251,10 +251,10 @@ FullControlT::changeTo(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -FullControlT::changeTo(const StateID stateId, - const Payload& payload) +FullControlT::changeTo(const StateID stateId, + const Payload& payload) { if (!_locked) { const Request request{Request::Type::CHANGE, stateId, payload}; @@ -269,9 +269,9 @@ FullControlT::changeTo(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -FullControlT::restart(const StateID stateId) { +FullControlT::restart(const StateID stateId) { if (!_locked) { const Request request{Request::Type::RESTART, stateId}; _requests << request; @@ -285,10 +285,10 @@ FullControlT::restart(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -FullControlT::restart(const StateID stateId, - const Payload& payload) +FullControlT::restart(const StateID stateId, + const Payload& payload) { if (!_locked) { const Request request{Request::Type::RESTART, stateId, payload}; @@ -303,9 +303,9 @@ FullControlT::restart(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -FullControlT::resume(const StateID stateId) { +FullControlT::resume(const StateID stateId) { if (!_locked) { const Request request{Request::Type::RESUME, stateId}; _requests << request; @@ -319,10 +319,10 @@ FullControlT::resume(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -FullControlT::resume(const StateID stateId, - const Payload& payload) +FullControlT::resume(const StateID stateId, + const Payload& payload) { if (!_locked) { const Request request{Request::Type::RESUME, stateId, payload}; @@ -337,9 +337,9 @@ FullControlT::resume(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -FullControlT::utilize(const StateID stateId) { +FullControlT::utilize(const StateID stateId) { if (!_locked) { const Request request{Request::Type::UTILIZE, stateId}; _requests << request; @@ -353,10 +353,10 @@ FullControlT::utilize(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -FullControlT::utilize(const StateID stateId, - const Payload& payload) +FullControlT::utilize(const StateID stateId, + const Payload& payload) { if (!_locked) { const Request request{Request::Type::UTILIZE, stateId, payload}; @@ -371,9 +371,9 @@ FullControlT::utilize(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -FullControlT::randomize(const StateID stateId) { +FullControlT::randomize(const StateID stateId) { if (!_locked) { const Request request{Request::Type::RANDOMIZE, stateId}; _requests << request; @@ -387,10 +387,10 @@ FullControlT::randomize(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -FullControlT::randomize(const StateID stateId, - const Payload& payload) +FullControlT::randomize(const StateID stateId, + const Payload& payload) { if (!_locked) { const Request request{Request::Type::RANDOMIZE, stateId, payload}; @@ -405,9 +405,9 @@ FullControlT::randomize(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -FullControlT::schedule(const StateID stateId) { +FullControlT::schedule(const StateID stateId) { const Request transition{Request::Type::SCHEDULE, stateId}; _requests << transition; @@ -416,10 +416,10 @@ FullControlT::schedule(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -FullControlT::schedule(const StateID stateId, - const Payload& payload) +FullControlT::schedule(const StateID stateId, + const Payload& payload) { const Request transition{Request::Type::SCHEDULE, stateId, payload}; _requests << transition; @@ -429,9 +429,9 @@ FullControlT::schedule(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -FullControlT::succeed() { +FullControlT::succeed() { _status.result = Status::SUCCESS; _planData.tasksSuccesses.set(_originId); @@ -448,9 +448,9 @@ FullControlT::succeed() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -FullControlT::fail() { +FullControlT::fail() { _status.result = Status::FAILURE; _planData.tasksFailures.set(_originId); @@ -467,9 +467,9 @@ FullControlT::fail() { //////////////////////////////////////////////////////////////////////////////// -template +template void -GuardControlT::cancelPendingTransitions() { +GuardControlT::cancelPendingTransitions() { _cancelled = true; HFSM_LOG_CANCELLED_PENDING(context(), _originId); diff --git a/include/hfsm2/detail/injections.inl b/include/hfsm2/detail/injections.inl index 3919598..721eede 100644 --- a/include/hfsm2/detail/injections.inl +++ b/include/hfsm2/detail/injections.inl @@ -3,127 +3,127 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template +template void -B_::widePreEntryGuard(typename TF::Context& context) { - TF::preEntryGuard(context); - B_::widePreEntryGuard(context); +B_::widePreEntryGuard(typename TF_::Context& context) { + TF_::preEntryGuard(context); + B_::widePreEntryGuard(context); } //------------------------------------------------------------------------------ -template +template void -B_::widePreEnter(typename TF::Context& context) { - TF::preEnter(context); - B_::widePreEnter(context); +B_::widePreEnter(typename TF_::Context& context) { + TF_::preEnter(context); + B_::widePreEnter(context); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -B_::widePreReenter(typename TF::Context& context) { - TF::preReenter(context); - B_::widePreReenter(context); +B_::widePreReenter(typename TF_::Context& context) { + TF_::preReenter(context); + B_::widePreReenter(context); } //------------------------------------------------------------------------------ -template +template void -B_::widePreUpdate(typename TF::Context& context) { - TF::preUpdate(context); - B_::widePreUpdate(context); +B_::widePreUpdate(typename TF_::Context& context) { + TF_::preUpdate(context); + B_::widePreUpdate(context); } //------------------------------------------------------------------------------ -template +template template void -B_::widePreReact(const TEvent& event, - typename TF::Context& context) +B_::widePreReact(const TEvent& event, + typename TF_::Context& context) { - TF::preReact(event, context); - B_::widePreReact(event, context); + TF_::preReact(event, context); + B_::widePreReact(event, context); } //------------------------------------------------------------------------------ -template +template void -B_::widePreExitGuard(typename TF::Context& context) { - TF::preExitGuard(context); - B_::widePreExitGuard(context); +B_::widePreExitGuard(typename TF_::Context& context) { + TF_::preExitGuard(context); + B_::widePreExitGuard(context); } //------------------------------------------------------------------------------ -template +template void -B_::widePostExit(typename TF::Context& context) { - TF::postExit(context); - B_::widePostExit(context); +B_::widePostExit(typename TF_::Context& context) { + TF_::postExit(context); + B_::widePostExit(context); } //////////////////////////////////////////////////////////////////////////////// -template +template void -B_::widePreEntryGuard(typename TF::Context& context) { - TF::preEntryGuard(context); +B_::widePreEntryGuard(typename TF_::Context& context) { + TF_::preEntryGuard(context); } //------------------------------------------------------------------------------ -template +template void -B_::widePreEnter(typename TF::Context& context) { - TF::preEnter(context); +B_::widePreEnter(typename TF_::Context& context) { + TF_::preEnter(context); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -B_::widePreReenter(typename TF::Context& context) { - TF::preReenter(context); +B_::widePreReenter(typename TF_::Context& context) { + TF_::preReenter(context); } //------------------------------------------------------------------------------ -template +template void -B_::widePreUpdate(typename TF::Context& context) { - TF::preUpdate(context); +B_::widePreUpdate(typename TF_::Context& context) { + TF_::preUpdate(context); } //------------------------------------------------------------------------------ -template +template template void -B_::widePreReact(const TEvent& event, - typename TF::Context& context) +B_::widePreReact(const TEvent& event, + typename TF_::Context& context) { - TF::preReact(event, context); + TF_::preReact(event, context); } //------------------------------------------------------------------------------ -template +template void -B_::widePreExitGuard(typename TF::Context& context) { - TF::preExitGuard(context); +B_::widePreExitGuard(typename TF_::Context& context) { + TF_::preExitGuard(context); } //------------------------------------------------------------------------------ -template +template void -B_::widePostExit(typename TF::Context& context) { - TF::postExit(context); +B_::widePostExit(typename TF_::Context& context) { + TF_::postExit(context); } //////////////////////////////////////////////////////////////////////////////// diff --git a/include/hfsm2/detail/plan_data.inl b/include/hfsm2/detail/plan_data.inl index 78d4435..ee89e79 100644 --- a/include/hfsm2/detail/plan_data.inl +++ b/include/hfsm2/detail/plan_data.inl @@ -5,9 +5,9 @@ namespace detail { #ifdef HFSM_ENABLE_ASSERT -template +template void -PlanDataT>::verifyPlans() const { +PlanDataT>::verifyPlans() const { LongIndex planCount = 0; for (RegionID id = 0; id < REGION_COUNT; ++id) planCount += verifyPlan(id); @@ -17,9 +17,9 @@ PlanDataT>::verifyPlans() const //------------------------------------------------------------------------------ -template +template LongIndex -PlanDataT>::verifyPlan(const RegionID regionId) const { +PlanDataT>::verifyPlan(const RegionID regionId) const { LongIndex length = 0; const Bounds& bounds = tasksBounds[regionId]; diff --git a/include/hfsm2/detail/shared/array.inl b/include/hfsm2/detail/shared/array.inl index f304270..9ce13e4 100644 --- a/include/hfsm2/detail/shared/array.inl +++ b/include/hfsm2/detail/shared/array.inl @@ -3,16 +3,16 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template -StaticArray::StaticArray(const Item filler) { +template +StaticArray::StaticArray(const Item filler) { fill(filler); } //------------------------------------------------------------------------------ -template +template T& -StaticArray::operator[] (const LongIndex i) { +StaticArray::operator[] (const LongIndex i) { HFSM_ASSERT(0 <= i && i < CAPACITY); return _items[i]; @@ -20,9 +20,9 @@ StaticArray::operator[] (const LongIndex i) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template const T& -StaticArray::operator[] (const LongIndex i) const { +StaticArray::operator[] (const LongIndex i) const { HFSM_ASSERT(0 <= i && i < CAPACITY); return _items[i]; @@ -30,19 +30,19 @@ StaticArray::operator[] (const LongIndex i) const { //------------------------------------------------------------------------------ -template +template void -StaticArray::fill(const Item filler) { +StaticArray::fill(const Item filler) { for (LongIndex i = 0; i < CAPACITY; ++i) _items[i] = filler; } //////////////////////////////////////////////////////////////////////////////// -template +template template LongIndex -Array::operator << (TValue&& value) { +Array::operator << (TValue&& value) { HFSM_ASSERT(_count < CAPACITY); new (&_items[_count]) Item{std::move(value)}; @@ -52,9 +52,9 @@ Array::operator << (TValue&& value) { //------------------------------------------------------------------------------ -template +template T& -Array::operator[] (const LongIndex i) { +Array::operator[] (const LongIndex i) { HFSM_ASSERT(0 <= i && i < CAPACITY); return _items[i]; @@ -62,9 +62,9 @@ Array::operator[] (const LongIndex i) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template const T& -Array::operator[] (const LongIndex i) const { +Array::operator[] (const LongIndex i) const { HFSM_ASSERT(0 <= i && i < CAPACITY); return _items[i]; diff --git a/include/hfsm2/detail/shared/utility.hpp b/include/hfsm2/detail/shared/utility.hpp index bdd5c43..66cf60c 100644 --- a/include/hfsm2/detail/shared/utility.hpp +++ b/include/hfsm2/detail/shared/utility.hpp @@ -189,16 +189,16 @@ end(const T(& a)[NCapacity]) { //////////////////////////////////////////////////////////////////////////////// -template +template struct Min { - static constexpr auto VALUE = N1 < N2 ? N1 : N2; + static constexpr auto VALUE = N1_ < N2_ ? N1_ : N2_; }; //------------------------------------------------------------------------------ -template +template struct Max { - static constexpr auto VALUE = N1 > N2 ? N1 : N2; + static constexpr auto VALUE = N1_ > N2_ ? N1_ : N2_; }; //------------------------------------------------------------------------------ diff --git a/include/hfsm2/detail/state_registry.inl b/include/hfsm2/detail/state_registry.inl index 337326c..4c5afe8 100644 --- a/include/hfsm2/detail/state_registry.inl +++ b/include/hfsm2/detail/state_registry.inl @@ -5,18 +5,18 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template +template void -AllForksT::clear() { +AllForksT::clear() { compo.fill(INVALID_SHORT_INDEX); ortho.clear(); } //////////////////////////////////////////////////////////////////////////////// -template +template bool -StateRegistryT>::isActive(const StateID stateId) const { +StateRegistryT>::isActive(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) for (Parent parent = stateParents[stateId]; parent; @@ -33,9 +33,9 @@ StateRegistryT>::isActive(const // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -StateRegistryT>::isResumable(const StateID stateId) const { +StateRegistryT>::isResumable(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) for (Parent parent = stateParents[stateId]; parent; @@ -52,9 +52,9 @@ StateRegistryT>::isResumable(co //------------------------------------------------------------------------------ -template +template bool -StateRegistryT>::isPendingChange(const StateID stateId) const { +StateRegistryT>::isPendingChange(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) for (Parent parent = stateParents[stateId]; parent; @@ -72,9 +72,9 @@ StateRegistryT>::isPendingChang // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -StateRegistryT>::isPendingEnter(const StateID stateId) const { +StateRegistryT>::isPendingEnter(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) for (Parent parent = stateParents[stateId]; parent; @@ -92,9 +92,9 @@ StateRegistryT>::isPendingEnter // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -StateRegistryT>::isPendingExit(const StateID stateId) const { +StateRegistryT>::isPendingExit(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) for (Parent parent = stateParents[stateId]; parent; @@ -112,9 +112,9 @@ StateRegistryT>::isPendingExit( //------------------------------------------------------------------------------ -template +template const Parent& -StateRegistryT>::forkParent(const ForkID forkId) const { +StateRegistryT>::forkParent(const ForkID forkId) const { HFSM_ASSERT(forkId != 0); return forkId > 0 ? @@ -124,9 +124,9 @@ StateRegistryT>::forkParent(con //------------------------------------------------------------------------------ -template -typename StateRegistryT>::OrthoBits -StateRegistryT>::resumableOrthoFork(const ForkID forkId) { +template +typename StateRegistryT>::OrthoBits +StateRegistryT>::resumableOrthoFork(const ForkID forkId) { HFSM_ASSERT(forkId < 0); const Units& units = orthoUnits[-forkId - 1]; @@ -135,9 +135,9 @@ StateRegistryT>::resumableOrtho // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename StateRegistryT>::OrthoBits -StateRegistryT>::requestedOrthoFork(const ForkID forkId) { +template +typename StateRegistryT>::OrthoBits +StateRegistryT>::requestedOrthoFork(const ForkID forkId) { HFSM_ASSERT(forkId < 0); const Units& units = orthoUnits[-forkId - 1]; @@ -146,9 +146,9 @@ StateRegistryT>::requestedOrtho //------------------------------------------------------------------------------ -template +template bool -StateRegistryT>::requestImmediate(const Request request) { +StateRegistryT>::requestImmediate(const Request request) { if (request.stateId == 0) return false; else if (HFSM_CHECKED(request.stateId < STATE_COUNT)) { @@ -200,9 +200,9 @@ StateRegistryT>::requestImmedia // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -StateRegistryT>::requestScheduled(const StateID stateId) { +StateRegistryT>::requestScheduled(const StateID stateId) { if (HFSM_CHECKED(stateId < STATE_COUNT)) { const Parent parent = stateParents[stateId]; @@ -217,18 +217,18 @@ StateRegistryT>::requestSchedul //------------------------------------------------------------------------------ -template +template void -StateRegistryT>::clearRequests() { +StateRegistryT>::clearRequests() { compoRemains.clear(); requested.clear(); } //////////////////////////////////////////////////////////////////////////////// -template +template bool -StateRegistryT>::isActive(const StateID stateId) const { +StateRegistryT>::isActive(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) { if (Parent parent = stateParents[stateId]) { HFSM_ASSERT(parent.forkId > 0); @@ -243,9 +243,9 @@ StateRegistryT>::isActive(const Sta // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -StateRegistryT>::isResumable(const StateID stateId) const { +StateRegistryT>::isResumable(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) if (Parent parent = stateParents[stateId]) { HFSM_ASSERT(parent.forkId > 0); @@ -258,9 +258,9 @@ StateRegistryT>::isResumable(const //------------------------------------------------------------------------------ -template +template bool -StateRegistryT>::isPendingChange(const StateID stateId) const { +StateRegistryT>::isPendingChange(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) if (Parent parent = stateParents[stateId]) { HFSM_ASSERT(parent.forkId > 0); @@ -274,9 +274,9 @@ StateRegistryT>::isPendingChange(co // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -StateRegistryT>::isPendingEnter(const StateID stateId) const { +StateRegistryT>::isPendingEnter(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) if (Parent parent = stateParents[stateId]) { HFSM_ASSERT(parent.forkId > 0); @@ -290,9 +290,9 @@ StateRegistryT>::isPendingEnter(con // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -StateRegistryT>::isPendingExit(const StateID stateId) const { +StateRegistryT>::isPendingExit(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) if (Parent parent = stateParents[stateId]) { HFSM_ASSERT(parent.forkId > 0); @@ -306,9 +306,9 @@ StateRegistryT>::isPendingExit(cons //------------------------------------------------------------------------------ -template +template const Parent& -StateRegistryT>::forkParent(const ForkID forkId) const { +StateRegistryT>::forkParent(const ForkID forkId) const { HFSM_ASSERT(forkId > 0); return compoParents[forkId - 1]; @@ -316,9 +316,9 @@ StateRegistryT>::forkParent(const F //------------------------------------------------------------------------------ -template +template bool -StateRegistryT>::requestImmediate(const Request request) { +StateRegistryT>::requestImmediate(const Request request) { if (request.stateId == 0) return false; else if (HFSM_CHECKED(request.stateId < STATE_COUNT)) { @@ -356,9 +356,9 @@ StateRegistryT>::requestImmediate(c // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -StateRegistryT>::requestScheduled(const StateID stateId) { +StateRegistryT>::requestScheduled(const StateID stateId) { HFSM_ASSERT(stateId < STATE_COUNT); if (stateId < STATE_COUNT) { @@ -371,9 +371,9 @@ StateRegistryT>::requestScheduled(c //------------------------------------------------------------------------------ -template +template void -StateRegistryT>::clearRequests() { +StateRegistryT>::clearRequests() { compoRemains.clear(); requested.clear(); } diff --git a/include/hfsm2/detail/structure/composite.hpp b/include/hfsm2/detail/structure/composite.hpp index 9f476f6..fae0cb4 100644 --- a/include/hfsm2/detail/structure/composite.hpp +++ b/include/hfsm2/detail/structure/composite.hpp @@ -106,7 +106,7 @@ struct C_ { #if HFSM_EXPLICIT_MEMBER_SPECIALIZATION - template + template HFSM_INLINE void deepRequestChange (Control& control, const ShortIndex = INVALID_SHORT_INDEX); template <> @@ -144,7 +144,7 @@ struct C_ { #if HFSM_EXPLICIT_MEMBER_SPECIALIZATION - template + template HFSM_INLINE UP deepReportChange (Control& control); template <> diff --git a/include/hfsm2/detail/structure/composite.inl b/include/hfsm2/detail/structure/composite.inl index 9dea817..03e21ec 100644 --- a/include/hfsm2/detail/structure/composite.inl +++ b/include/hfsm2/detail/structure/composite.inl @@ -3,13 +3,13 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template +template ShortIndex -C_::resolveRandom(Control& control, - const Utility(& options)[Info::WIDTH], - const Utility sum, - const Rank(& ranks)[Info::WIDTH], - const Rank top) +C_::resolveRandom(Control& control, + const Utility(& options)[Info::WIDTH], + const Utility sum, + const Rank(& ranks)[Info::WIDTH], + const Rank top) { const Utility random = control._random.next(); HFSM_ASSERT(0.0f <= random && random < 1.0f); @@ -35,10 +35,10 @@ C_::resolveRandom(Control& control, //------------------------------------------------------------------------------ -template +template void -C_::deepRegister(StateRegistry& stateRegistry, - const Parent parent) +C_::deepRegister(StateRegistry& stateRegistry, + const Parent parent) { stateRegistry.compoParents[COMPO_INDEX] = parent; @@ -48,9 +48,9 @@ C_::deepRegister(StateRegistry& stateRegistry, //------------------------------------------------------------------------------ -template +template bool -C_::deepForwardEntryGuard(GuardControl& control) { +C_::deepForwardEntryGuard(GuardControl& control) { const ShortIndex active = compoActive (control); const ShortIndex requested = compoRequested(control); @@ -66,9 +66,9 @@ C_::deepForwardEntryGuard(GuardControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -C_::deepEntryGuard(GuardControl& control) { +C_::deepEntryGuard(GuardControl& control) { const ShortIndex requested = compoRequested(control); HFSM_ASSERT(requested != INVALID_SHORT_INDEX); @@ -80,9 +80,9 @@ C_::deepEntryGuard(GuardControl& control) { //------------------------------------------------------------------------------ -template +template void -C_::deepEnter(PlanControl& control) { +C_::deepEnter(PlanControl& control) { ShortIndex& active = compoActive (control); ShortIndex& resumable = compoResumable(control); ShortIndex& requested = compoRequested(control); @@ -106,9 +106,9 @@ C_::deepEnter(PlanControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepReenter(PlanControl& control) { +C_::deepReenter(PlanControl& control) { ShortIndex& active = compoActive (control); ShortIndex& resumable = compoResumable(control); ShortIndex& requested = compoRequested(control); @@ -138,9 +138,9 @@ C_::deepReenter(PlanControl& control) { //------------------------------------------------------------------------------ -template +template Status -C_::deepUpdate(FullControl& control) { +C_::deepUpdate(FullControl& control) { const ShortIndex active = compoActive(control); HFSM_ASSERT(active != INVALID_SHORT_INDEX); @@ -166,11 +166,11 @@ C_::deepUpdate(FullControl& control) { //------------------------------------------------------------------------------ -template +template template Status -C_::deepReact(FullControl& control, - const TEvent& event) +C_::deepReact(FullControl& control, + const TEvent& event) { const ShortIndex active = compoActive(control); HFSM_ASSERT(active != INVALID_SHORT_INDEX); @@ -197,9 +197,9 @@ C_::deepReact(FullControl& control, //------------------------------------------------------------------------------ -template +template bool -C_::deepForwardExitGuard(GuardControl& control) { +C_::deepForwardExitGuard(GuardControl& control) { const ShortIndex active = compoActive(control); HFSM_ASSERT(active != INVALID_SHORT_INDEX); @@ -213,9 +213,9 @@ C_::deepForwardExitGuard(GuardControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -C_::deepExitGuard(GuardControl& control) { +C_::deepExitGuard(GuardControl& control) { const ShortIndex active = compoActive(control); HFSM_ASSERT(active != INVALID_SHORT_INDEX); @@ -227,9 +227,9 @@ C_::deepExitGuard(GuardControl& control) { //------------------------------------------------------------------------------ -template +template void -C_::deepExit(PlanControl& control) { +C_::deepExit(PlanControl& control) { ShortIndex& active = compoActive (control); ShortIndex& resumable = compoResumable(control); @@ -247,10 +247,10 @@ C_::deepExit(PlanControl& control) { //------------------------------------------------------------------------------ -template +template void -C_::deepForwardActive(Control& control, - const RequestType request) +C_::deepForwardActive(Control& control, + const RequestType request) { HFSM_ASSERT(control._stateRegistry.isActive(HEAD_ID)); @@ -266,10 +266,10 @@ C_::deepForwardActive(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepForwardRequest(Control& control, - const RequestType request) +C_::deepForwardRequest(Control& control, + const RequestType request) { const ShortIndex requested = compoRequested(control); @@ -281,10 +281,10 @@ C_::deepForwardRequest(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequest(Control& control, - const RequestType request) +C_::deepRequest(Control& control, + const RequestType request) { switch (request) { case Request::REMAIN: @@ -320,9 +320,9 @@ C_::deepRequest(Control& control, #if !HFSM_EXPLICIT_MEMBER_SPECIALIZATION -template +template void -C_::deepRequestChange(Control& control) +C_::deepRequestChange(Control& control) { switch (STRATEGY) { case Strategy::Composite: @@ -350,9 +350,9 @@ C_::deepRequestChange(Control& control) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequestChangeComposite(Control& control) { +C_::deepRequestChangeComposite(Control& control) { ShortIndex& requested = compoRequested(control); requested = 0; @@ -362,9 +362,9 @@ C_::deepRequestChangeComposite(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequestChangeResumable(Control& control) { +C_::deepRequestChangeResumable(Control& control) { const ShortIndex resumable = compoResumable(control); ShortIndex& requested = compoRequested(control); @@ -376,9 +376,9 @@ C_::deepRequestChangeResumable(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequestChangeUtilitarian(Control& control) { +C_::deepRequestChangeUtilitarian(Control& control) { const UP s = _subStates.wideReportChangeUtilitarian(control); HFSM_ASSERT(s.prong != INVALID_SHORT_INDEX); @@ -390,9 +390,9 @@ C_::deepRequestChangeUtilitarian(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequestChangeRandom(Control& control) { +C_::deepRequestChangeRandom(Control& control) { Rank ranks[Info::WIDTH]; Rank top = _subStates.wideReportRank(control, ranks); @@ -406,9 +406,9 @@ C_::deepRequestChangeRandom(Control& control) { //------------------------------------------------------------------------------ -template +template void -C_::deepRequestRemain(StateRegistry& stateRegistry) { +C_::deepRequestRemain(StateRegistry& stateRegistry) { const ShortIndex active = compoActive (stateRegistry); ShortIndex& requested = compoRequested(stateRegistry); @@ -420,9 +420,9 @@ C_::deepRequestRemain(StateRegistry& stateRegistry) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequestRestart(StateRegistry& stateRegistry) { +C_::deepRequestRestart(StateRegistry& stateRegistry) { ShortIndex& requested = compoRequested(stateRegistry); requested = 0; @@ -432,9 +432,9 @@ C_::deepRequestRestart(StateRegistry& stateRegistry) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequestResume(StateRegistry& stateRegistry) { +C_::deepRequestResume(StateRegistry& stateRegistry) { const ShortIndex resumable = compoResumable(stateRegistry); ShortIndex& requested = compoRequested(stateRegistry); @@ -446,9 +446,9 @@ C_::deepRequestResume(StateRegistry& stateRegistry) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequestUtilize(Control& control) { +C_::deepRequestUtilize(Control& control) { const UP s = _subStates.wideReportUtilize(control); ShortIndex& requested = compoRequested(control); @@ -459,9 +459,9 @@ C_::deepRequestUtilize(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequestRandomize(Control& control) { +C_::deepRequestRandomize(Control& control) { Rank ranks[Info::WIDTH]; Rank top = _subStates.wideReportRank(control, ranks); @@ -477,9 +477,9 @@ C_::deepRequestRandomize(Control& control) { #if !HFSM_EXPLICIT_MEMBER_SPECIALIZATION -template -typename TA::UP -C_::deepReportChange(Control& control) { +template +typename TA_::UP +C_::deepReportChange(Control& control) { switch (STRATEGY) { case Strategy::Composite: return deepReportChangeComposite (control); @@ -503,9 +503,9 @@ C_::deepReportChange(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -C_::deepReportChangeComposite(Control& control) { +template +typename TA_::UP +C_::deepReportChangeComposite(Control& control) { ShortIndex& requested = compoRequested(control); requested = 0; @@ -520,9 +520,9 @@ C_::deepReportChangeComposite(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -C_::deepReportChangeResumable(Control& control) { +template +typename TA_::UP +C_::deepReportChangeResumable(Control& control) { const ShortIndex resumable = compoResumable(control); ShortIndex& requested = compoRequested(control); @@ -540,9 +540,9 @@ C_::deepReportChangeResumable(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -C_::deepReportChangeUtilitarian(Control& control) { +template +typename TA_::UP +C_::deepReportChangeUtilitarian(Control& control) { const UP h = _headState.deepReportChange(control); const UP s = _subStates.wideReportChangeUtilitarian(control); @@ -559,9 +559,9 @@ C_::deepReportChangeUtilitarian(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -C_::deepReportChangeRandom(Control& control) { +template +typename TA_::UP +C_::deepReportChangeRandom(Control& control) { const UP h = _headState.deepReportChange(control); Rank ranks[Info::WIDTH]; @@ -582,9 +582,9 @@ C_::deepReportChangeRandom(Control& control) { //------------------------------------------------------------------------------ -template -typename TA::UP -C_::deepReportUtilize(Control& control) { +template +typename TA_::UP +C_::deepReportUtilize(Control& control) { const UP h = _headState.deepReportUtilize(control); const UP s = _subStates.wideReportUtilize(control); @@ -601,17 +601,17 @@ C_::deepReportUtilize(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Rank -C_::deepReportRank(Control& control) { +template +typename TA_::Rank +C_::deepReportRank(Control& control) { return _headState.wrapRank(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -C_::deepReportRandomize(Control& control) { +template +typename TA_::Utility +C_::deepReportRandomize(Control& control) { const Utility h = _headState.wrapUtility(control); Rank ranks[Info::WIDTH]; @@ -629,9 +629,9 @@ C_::deepReportRandomize(Control& control) { //------------------------------------------------------------------------------ -template +template void -C_::deepEnterRequested(PlanControl& control) { +C_::deepEnterRequested(PlanControl& control) { ShortIndex& active = compoActive (control); ShortIndex& requested = compoRequested(control); @@ -647,9 +647,9 @@ C_::deepEnterRequested(PlanControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepChangeToRequested(PlanControl& control) { +C_::deepChangeToRequested(PlanControl& control) { ShortIndex& active = compoActive (control); ShortIndex& resumable = compoResumable(control); ShortIndex& requested = compoRequested(control); @@ -683,12 +683,12 @@ C_::deepChangeToRequested(PlanControl& control) { #ifdef HFSM_ENABLE_STRUCTURE_REPORT -template +template void -C_::deepGetNames(const LongIndex parent, - const RegionType region, - const ShortIndex depth, - StructureStateInfos& _stateInfos) const +C_::deepGetNames(const LongIndex parent, + const RegionType region, + const ShortIndex depth, + StructureStateInfos& _stateInfos) const { _headState.deepGetNames(parent, region, depth, _stateInfos); _subStates.wideGetNames(_stateInfos.count() - 1, StructureStateInfo::COMPOSITE, depth + 1, _stateInfos); diff --git a/include/hfsm2/detail/structure/composite_sub.hpp b/include/hfsm2/detail/structure/composite_sub.hpp index 8397ae2..c808048 100644 --- a/include/hfsm2/detail/structure/composite_sub.hpp +++ b/include/hfsm2/detail/structure/composite_sub.hpp @@ -97,7 +97,7 @@ struct CS_ { #if HFSM_EXPLICIT_MEMBER_SPECIALIZATION - template + template HFSM_INLINE void wideRequestChange (Control& control, const ShortIndex = INVALID_SHORT_INDEX); template <> diff --git a/include/hfsm2/detail/structure/composite_sub_1.inl b/include/hfsm2/detail/structure/composite_sub_1.inl index ffcf5a4..ae1bc1f 100644 --- a/include/hfsm2/detail/structure/composite_sub_1.inl +++ b/include/hfsm2/detail/structure/composite_sub_1.inl @@ -3,10 +3,10 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template +template void -CS_::wideRegister(StateRegistry& stateRegistry, - const Parent parent) +CS_::wideRegister(StateRegistry& stateRegistry, + const Parent parent) { lHalf.wideRegister(stateRegistry, Parent{parent.forkId, L_PRONG}); rHalf.wideRegister(stateRegistry, Parent{parent.forkId, R_PRONG}); @@ -14,10 +14,10 @@ CS_::wideRegister(StateRegistry& stateRegistry, //------------------------------------------------------------------------------ -template +template bool -CS_::wideForwardEntryGuard(GuardControl& control, - const ShortIndex prong) +CS_::wideForwardEntryGuard(GuardControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -29,10 +29,10 @@ CS_::wideForwardEntryGuard(GuardControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -CS_::wideEntryGuard(GuardControl& control, - const ShortIndex prong) +CS_::wideEntryGuard(GuardControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -44,10 +44,10 @@ CS_::wideEntryGuard(GuardControl& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideEnter(PlanControl& control, - const ShortIndex prong) +CS_::wideEnter(PlanControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -59,10 +59,10 @@ CS_::wideEnter(PlanControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideReenter(PlanControl& control, - const ShortIndex prong) +CS_::wideReenter(PlanControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -74,10 +74,10 @@ CS_::wideReenter(PlanControl& control, //------------------------------------------------------------------------------ -template +template Status -CS_::wideUpdate(FullControl& control, - const ShortIndex prong) +CS_::wideUpdate(FullControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -88,12 +88,12 @@ CS_::wideUpdate(FullControl& control, //------------------------------------------------------------------------------ -template +template template Status -CS_::wideReact(FullControl& control, - const TEvent& event, - const ShortIndex prong) +CS_::wideReact(FullControl& control, + const TEvent& event, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -104,10 +104,10 @@ CS_::wideReact(FullControl& control, //------------------------------------------------------------------------------ -template +template bool -CS_::wideForwardExitGuard(GuardControl& control, - const ShortIndex prong) +CS_::wideForwardExitGuard(GuardControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -119,10 +119,10 @@ CS_::wideForwardExitGuard(GuardControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -CS_::wideExitGuard(GuardControl& control, - const ShortIndex prong) +CS_::wideExitGuard(GuardControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -134,10 +134,10 @@ CS_::wideExitGuard(GuardControl& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideExit(PlanControl& control, - const ShortIndex prong) +CS_::wideExit(PlanControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -149,11 +149,11 @@ CS_::wideExit(PlanControl& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideForwardActive(Control& control, - const RequestType request, - const ShortIndex prong) +CS_::wideForwardActive(Control& control, + const RequestType request, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -165,11 +165,11 @@ CS_::wideForwardActive(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideForwardRequest(Control& control, - const RequestType request, - const ShortIndex prong) +CS_::wideForwardRequest(Control& control, + const RequestType request, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -181,18 +181,18 @@ CS_::wideForwardRequest(Control& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideRequestChangeComposite(Control& control) { +CS_::wideRequestChangeComposite(Control& control) { lHalf.wideRequestChangeComposite(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideRequestChangeResumable(Control& control, - const ShortIndex prong) +CS_::wideRequestChangeResumable(Control& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -204,26 +204,26 @@ CS_::wideRequestChangeResumable(Control& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideRequestRemain(StateRegistry& stateRegistry) { +CS_::wideRequestRemain(StateRegistry& stateRegistry) { lHalf.wideRequestRemain(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideRequestRestart(StateRegistry& stateRegistry) { +CS_::wideRequestRestart(StateRegistry& stateRegistry) { lHalf.wideRequestRestart(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideRequestResume(StateRegistry& stateRegistry, - const ShortIndex prong) +CS_::wideRequestResume(StateRegistry& stateRegistry, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -235,9 +235,9 @@ CS_::wideRequestResume(StateRegistry& stateRegistry, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -CS_::wideReportUtilize(Control& control) { +template +typename TA_::UP +CS_::wideReportUtilize(Control& control) { const UP l = lHalf.wideReportUtilize(control); const UP r = rHalf.wideReportUtilize(control); @@ -247,10 +247,10 @@ CS_::wideReportUtilize(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Rank -CS_::wideReportRank(Control& control, - Rank* const ranks) +template +typename TA_::Rank +CS_::wideReportRank(Control& control, + Rank* const ranks) { HFSM_ASSERT(ranks); @@ -263,12 +263,12 @@ CS_::wideReportRank(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -CS_::wideReportRandomize(Control& control, - Utility* const options, - const Rank* const ranks, - const Rank top) +template +typename TA_::Utility +CS_::wideReportRandomize(Control& control, + Utility* const options, + const Rank* const ranks, + const Rank top) { HFSM_ASSERT(options && ranks); @@ -280,18 +280,18 @@ CS_::wideReportRandomize(Control& control, //------------------------------------------------------------------------------ -template -typename TA::UP -CS_::wideReportChangeComposite(Control& control) { +template +typename TA_::UP +CS_::wideReportChangeComposite(Control& control) { return lHalf.wideReportChangeComposite(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -CS_::wideReportChangeResumable(Control& control, - const ShortIndex prong) +template +typename TA_::UP +CS_::wideReportChangeResumable(Control& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -303,9 +303,9 @@ CS_::wideReportChangeResumable(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -CS_::wideReportChangeUtilitarian(Control& control) { +template +typename TA_::UP +CS_::wideReportChangeUtilitarian(Control& control) { const UP l = lHalf.wideReportChangeUtilitarian(control); const UP r = rHalf.wideReportChangeUtilitarian(control); @@ -315,12 +315,12 @@ CS_::wideReportChangeUtilitarian(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -CS_::wideReportChangeRandom(Control& control, - Utility* const options, - const Rank* const ranks, - const Rank top) +template +typename TA_::Utility +CS_::wideReportChangeRandom(Control& control, + Utility* const options, + const Rank* const ranks, + const Rank top) { HFSM_ASSERT(options && ranks); @@ -332,10 +332,10 @@ CS_::wideReportChangeRandom(Control& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideEnterRequested(PlanControl& control, - const ShortIndex prong) +CS_::wideEnterRequested(PlanControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -347,10 +347,10 @@ CS_::wideEnterRequested(PlanControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideChangeToRequested(PlanControl& control, - const ShortIndex prong) +CS_::wideChangeToRequested(PlanControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -364,12 +364,12 @@ CS_::wideChangeToRequested(PlanControl& control, #ifdef HFSM_ENABLE_STRUCTURE_REPORT -template +template void -CS_::wideGetNames(const LongIndex parent, - const RegionType /*region*/, - const ShortIndex depth, - StructureStateInfos& _stateInfos) const +CS_::wideGetNames(const LongIndex parent, + const RegionType /*region*/, + const ShortIndex depth, + StructureStateInfos& _stateInfos) const { lHalf.wideGetNames(parent, StructureStateInfo::COMPOSITE, depth, _stateInfos); rHalf.wideGetNames(parent, StructureStateInfo::COMPOSITE, depth, _stateInfos); diff --git a/include/hfsm2/detail/structure/composite_sub_2.inl b/include/hfsm2/detail/structure/composite_sub_2.inl index ea87769..efd5d46 100644 --- a/include/hfsm2/detail/structure/composite_sub_2.inl +++ b/include/hfsm2/detail/structure/composite_sub_2.inl @@ -3,20 +3,20 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template +template void -CS_::wideRegister(StateRegistry& stateRegistry, - const Parent parent) +CS_::wideRegister(StateRegistry& stateRegistry, + const Parent parent) { state.deepRegister(stateRegistry, Parent{parent.forkId, PRONG_INDEX}); } //------------------------------------------------------------------------------ -template +template bool -CS_::wideForwardEntryGuard(GuardControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideForwardEntryGuard(GuardControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -25,10 +25,10 @@ CS_::wideForwardEntryGuard(GuardControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -CS_::wideEntryGuard(GuardControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideEntryGuard(GuardControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -37,10 +37,10 @@ CS_::wideEntryGuard(GuardControl& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideEnter(PlanControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideEnter(PlanControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -49,10 +49,10 @@ CS_::wideEnter(PlanControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideReenter(PlanControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideReenter(PlanControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -61,10 +61,10 @@ CS_::wideReenter(PlanControl& control, //------------------------------------------------------------------------------ -template +template Status -CS_::wideUpdate(FullControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideUpdate(FullControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -73,12 +73,12 @@ CS_::wideUpdate(FullControl& control, //------------------------------------------------------------------------------ -template +template template Status -CS_::wideReact(FullControl& control, - const TEvent& event, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideReact(FullControl& control, + const TEvent& event, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -87,10 +87,10 @@ CS_::wideReact(FullControl& control, //------------------------------------------------------------------------------ -template +template bool -CS_::wideForwardExitGuard(GuardControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideForwardExitGuard(GuardControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -99,10 +99,10 @@ CS_::wideForwardExitGuard(GuardControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -CS_::wideExitGuard(GuardControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideExitGuard(GuardControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -111,10 +111,10 @@ CS_::wideExitGuard(GuardControl& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideExit(PlanControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideExit(PlanControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -123,11 +123,11 @@ CS_::wideExit(PlanControl& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideForwardActive(Control& control, - const RequestType request, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideForwardActive(Control& control, + const RequestType request, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -136,11 +136,11 @@ CS_::wideForwardActive(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideForwardRequest(Control& control, - const RequestType request, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideForwardRequest(Control& control, + const RequestType request, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -149,18 +149,18 @@ CS_::wideForwardRequest(Control& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideRequestChangeComposite(Control& control) { +CS_::wideRequestChangeComposite(Control& control) { state.deepRequestChange(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideRequestChangeResumable(Control& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideRequestChangeResumable(Control& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -169,26 +169,26 @@ CS_::wideRequestChangeResumable(Control& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideRequestRemain(StateRegistry& stateRegistry) { +CS_::wideRequestRemain(StateRegistry& stateRegistry) { state.deepRequestRemain(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideRequestRestart(StateRegistry& stateRegistry) { +CS_::wideRequestRestart(StateRegistry& stateRegistry) { state.deepRequestRestart(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideRequestResume(StateRegistry& stateRegistry, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideRequestResume(StateRegistry& stateRegistry, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -197,18 +197,18 @@ CS_::wideRequestResume(StateRegistry& stateRegistry, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -CS_::wideReportUtilize(Control& control) { +template +typename TA_::UP +CS_::wideReportUtilize(Control& control) { return state.deepReportUtilize(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Rank -CS_::wideReportRank(Control& control, - Rank* const ranks) +template +typename TA_::Rank +CS_::wideReportRank(Control& control, + Rank* const ranks) { HFSM_ASSERT(ranks); @@ -219,12 +219,12 @@ CS_::wideReportRank(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -CS_::wideReportRandomize(Control& control, - Utility* const options, - const Rank* const ranks, - const Rank top) +template +typename TA_::Utility +CS_::wideReportRandomize(Control& control, + Utility* const options, + const Rank* const ranks, + const Rank top) { HFSM_ASSERT(options && ranks); @@ -236,18 +236,18 @@ CS_::wideReportRandomize(Control& control, //------------------------------------------------------------------------------ -template -typename TA::UP -CS_::wideReportChangeComposite(Control& control) { +template +typename TA_::UP +CS_::wideReportChangeComposite(Control& control) { return state.deepReportChange(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -CS_::wideReportChangeResumable(Control& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +template +typename TA_::UP +CS_::wideReportChangeResumable(Control& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -256,20 +256,20 @@ CS_::wideReportChangeResumable(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -CS_::wideReportChangeUtilitarian(Control& control) { +template +typename TA_::UP +CS_::wideReportChangeUtilitarian(Control& control) { return state.deepReportChange(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -CS_::wideReportChangeRandom(Control& control, - Utility* const options, - const Rank* const ranks, - const Rank top) +template +typename TA_::Utility +CS_::wideReportChangeRandom(Control& control, + Utility* const options, + const Rank* const ranks, + const Rank top) { HFSM_ASSERT(options && ranks); @@ -281,10 +281,10 @@ CS_::wideReportChangeRandom(Control& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideEnterRequested(PlanControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideEnterRequested(PlanControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -293,10 +293,10 @@ CS_::wideEnterRequested(PlanControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideChangeToRequested(PlanControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideChangeToRequested(PlanControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -307,12 +307,12 @@ CS_::wideChangeToRequested(PlanControl& control, #ifdef HFSM_ENABLE_STRUCTURE_REPORT -template +template void -CS_::wideGetNames(const LongIndex parent, - const RegionType /*region*/, - const ShortIndex depth, - StructureStateInfos& _stateInfos) const +CS_::wideGetNames(const LongIndex parent, + const RegionType /*region*/, + const ShortIndex depth, + StructureStateInfos& _stateInfos) const { state.deepGetNames(parent, StructureStateInfo::COMPOSITE, depth, _stateInfos); } diff --git a/include/hfsm2/detail/structure/forward.hpp b/include/hfsm2/detail/structure/forward.hpp index 2b5a303..65b5201 100644 --- a/include/hfsm2/detail/structure/forward.hpp +++ b/include/hfsm2/detail/structure/forward.hpp @@ -41,23 +41,23 @@ struct OSI_; template struct WrapT; -template -struct WrapT { - using Type = SI_; +template +struct WrapT { + using Type = SI_; }; -template -struct WrapT< CI_> { - using Type = CI_; +template +struct WrapT< CI_> { + using Type = CI_; }; -template -struct WrapT< OI_> { - using Type = OI_; +template +struct WrapT< OI_> { + using Type = OI_; }; -template -using Wrap = typename WrapT::Type; +template +using Wrap = typename WrapT::Type; //------------------------------------------------------------------------------ @@ -251,33 +251,33 @@ class RW_; template struct MaterialT; -template -struct MaterialT { - using Type = S_; +template +struct MaterialT { + using Type = S_; }; -template -struct MaterialT > { - using Type = C_, TS...>; +template +struct MaterialT > { + using Type = C_, TS_...>; }; -template -struct MaterialT > { - using Type = C_; +template +struct MaterialT > { + using Type = C_; }; -template -struct MaterialT > { - using Type = O_, TS...>; +template +struct MaterialT > { + using Type = O_, TS_...>; }; -template -struct MaterialT > { - using Type = O_; +template +struct MaterialT > { + using Type = O_; }; -template -using Material = typename MaterialT::Type; +template +using Material = typename MaterialT::Type; //------------------------------------------------------------------------------ @@ -344,45 +344,45 @@ struct RF_ final { //////////////////////////////////////////////////////////////////////////////// -template +template struct CSubMaterialT; -//template -//struct CSubMaterialT > { -// using Type = Material; +//template +//struct CSubMaterialT > { +// using Type = Material; //}; -template -struct CSubMaterialT> { - using Type = CS_; +template +struct CSubMaterialT> { + using Type = CS_; }; -template -using CSubMaterial = typename CSubMaterialT::Type; +template +using CSubMaterial = typename CSubMaterialT::Type; //------------------------------------------------------------------------------ template struct InfoT; -template -struct InfoT< S_> { - using Type = SI_< TH>; +template +struct InfoT> { + using Type = SI_< TH_>; }; -template -struct InfoT> { - using Type = CI_< TG, TH, TS...>; +template +struct InfoT> { + using Type = CI_< TG_, TH_, TS_...>; }; -template -struct InfoT> { - using Type = OI_< TH, TS...>; +template +struct InfoT> { + using Type = OI_< TH_, TS_...>; }; -template -struct InfoT> { - using Type = CSI_< TS...>; +template +struct InfoT> { + using Type = CSI_< TS_...>; }; //////////////////////////////////////////////////////////////////////////////// diff --git a/include/hfsm2/detail/structure/orthogonal.inl b/include/hfsm2/detail/structure/orthogonal.inl index 303c0cc..6577db3 100644 --- a/include/hfsm2/detail/structure/orthogonal.inl +++ b/include/hfsm2/detail/structure/orthogonal.inl @@ -3,10 +3,10 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template +template void -O_::deepRegister(StateRegistry& stateRegistry, - const Parent parent) +O_::deepRegister(StateRegistry& stateRegistry, + const Parent parent) { stateRegistry.orthoParents[ORTHO_INDEX] = parent; stateRegistry.orthoUnits[ORTHO_INDEX] = Units{ORTHO_UNIT, WIDTH}; @@ -17,9 +17,9 @@ O_::deepRegister(StateRegistry& stateRegistry, //------------------------------------------------------------------------------ -template +template bool -O_::deepForwardEntryGuard(GuardControl& control) { +O_::deepForwardEntryGuard(GuardControl& control) { const ProngConstBits requested = orthoRequested(static_cast(control)); ScopedRegion region{control, REGION_ID, HEAD_ID, REGION_SIZE}; @@ -32,9 +32,9 @@ O_::deepForwardEntryGuard(GuardControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -O_::deepEntryGuard(GuardControl& control) { +O_::deepEntryGuard(GuardControl& control) { ScopedRegion region{control, REGION_ID, HEAD_ID, REGION_SIZE}; return _headState.deepEntryGuard(control) || @@ -43,9 +43,9 @@ O_::deepEntryGuard(GuardControl& control) { //------------------------------------------------------------------------------ -template +template void -O_::deepEnter(PlanControl& control) { +O_::deepEnter(PlanControl& control) { ProngBits requested = orthoRequested(control); requested.clear(); @@ -57,9 +57,9 @@ O_::deepEnter(PlanControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepReenter(PlanControl& control) { +O_::deepReenter(PlanControl& control) { ProngBits requested = orthoRequested(control); requested.clear(); @@ -71,9 +71,9 @@ O_::deepReenter(PlanControl& control) { //------------------------------------------------------------------------------ -template +template Status -O_::deepUpdate(FullControl& control) { +O_::deepUpdate(FullControl& control) { ScopedRegion outer{control, REGION_ID, HEAD_ID, REGION_SIZE}; if (const auto headStatus = _headState.deepUpdate(control)) { @@ -96,11 +96,11 @@ O_::deepUpdate(FullControl& control) { //------------------------------------------------------------------------------ -template +template template Status -O_::deepReact(FullControl& control, - const TEvent& event) +O_::deepReact(FullControl& control, + const TEvent& event) { ScopedRegion outer{control, REGION_ID, HEAD_ID, REGION_SIZE}; @@ -124,9 +124,9 @@ O_::deepReact(FullControl& control, //------------------------------------------------------------------------------ -template +template bool -O_::deepForwardExitGuard(GuardControl& control) { +O_::deepForwardExitGuard(GuardControl& control) { const ProngConstBits requested = orthoRequested(static_cast(control)); ScopedRegion region{control, REGION_ID, HEAD_ID, REGION_SIZE}; @@ -139,9 +139,9 @@ O_::deepForwardExitGuard(GuardControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -O_::deepExitGuard(GuardControl& control) { +O_::deepExitGuard(GuardControl& control) { ScopedRegion region{control, REGION_ID, HEAD_ID, REGION_SIZE}; return _headState.deepExitGuard(control) || @@ -150,19 +150,19 @@ O_::deepExitGuard(GuardControl& control) { //------------------------------------------------------------------------------ -template +template void -O_::deepExit(PlanControl& control) { +O_::deepExit(PlanControl& control) { _subStates.wideExit(control); _headState.deepExit(control); } //------------------------------------------------------------------------------ -template +template void -O_::deepForwardActive(Control& control, - const RequestType request) +O_::deepForwardActive(Control& control, + const RequestType request) { HFSM_ASSERT(control._stateRegistry.isActive(HEAD_ID)); @@ -174,10 +174,10 @@ O_::deepForwardActive(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepForwardRequest(Control& control, - const RequestType request) +O_::deepForwardRequest(Control& control, + const RequestType request) { const ProngConstBits requested = orthoRequested(static_cast(control)); @@ -189,10 +189,10 @@ O_::deepForwardRequest(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepRequest(Control& control, - const RequestType request) +O_::deepRequest(Control& control, + const RequestType request) { switch (request) { case Request::REMAIN: @@ -226,57 +226,57 @@ O_::deepRequest(Control& control, //------------------------------------------------------------------------------ -template +template void -O_::deepRequestChange(Control& control) { +O_::deepRequestChange(Control& control) { _subStates.wideRequestChange(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepRequestRemain(StateRegistry& stateRegistry) { +O_::deepRequestRemain(StateRegistry& stateRegistry) { _subStates.wideRequestRemain(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepRequestRestart(StateRegistry& stateRegistry) { +O_::deepRequestRestart(StateRegistry& stateRegistry) { _subStates.wideRequestRestart(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepRequestResume(StateRegistry& stateRegistry) { +O_::deepRequestResume(StateRegistry& stateRegistry) { _subStates.wideRequestResume(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepRequestUtilize(Control& control) { +O_::deepRequestUtilize(Control& control) { _subStates.wideRequestUtilize(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepRequestRandomize(Control& control) { +O_::deepRequestRandomize(Control& control) { _subStates.wideRequestRandomize(control); } //------------------------------------------------------------------------------ -template -typename TA::UP -O_::deepReportChange(Control& control) { +template +typename TA_::UP +O_::deepReportChange(Control& control) { const UP h = _headState.deepReportChange(control); const Utility s = _subStates.wideReportChange(control); @@ -292,9 +292,9 @@ O_::deepReportChange(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -O_::deepReportUtilize(Control& control) { +template +typename TA_::UP +O_::deepReportUtilize(Control& control) { const UP h = _headState.deepReportUtilize(control); const Utility s = _subStates.wideReportUtilize(control); @@ -310,17 +310,17 @@ O_::deepReportUtilize(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Rank -O_::deepReportRank(Control& control) { +template +typename TA_::Rank +O_::deepReportRank(Control& control) { return _headState.wrapRank(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -O_::deepReportRandomize(Control& control) { +template +typename TA_::Utility +O_::deepReportRandomize(Control& control) { const Utility h = _headState.wrapUtility(control); const Utility s = _subStates.wideReportRandomize(control); @@ -333,18 +333,18 @@ O_::deepReportRandomize(Control& control) { //------------------------------------------------------------------------------ -template +template void -O_::deepEnterRequested(PlanControl& control) { +O_::deepEnterRequested(PlanControl& control) { _headState.deepEnter (control); _subStates.wideEnterRequested(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepChangeToRequested(PlanControl& control) { +O_::deepChangeToRequested(PlanControl& control) { _subStates.wideChangeToRequested(control); } @@ -352,12 +352,12 @@ O_::deepChangeToRequested(PlanControl& control) { #ifdef HFSM_ENABLE_STRUCTURE_REPORT -template +template void -O_::deepGetNames(const LongIndex parent, - const RegionType region, - const ShortIndex depth, - StructureStateInfos& _stateInfos) const +O_::deepGetNames(const LongIndex parent, + const RegionType region, + const ShortIndex depth, + StructureStateInfos& _stateInfos) const { _headState.deepGetNames(parent, region, depth, _stateInfos); _subStates.wideGetNames(_stateInfos.count() - 1, depth + 1, _stateInfos); diff --git a/include/hfsm2/detail/structure/orthogonal_sub_1.inl b/include/hfsm2/detail/structure/orthogonal_sub_1.inl index c8886d6..7bfa345 100644 --- a/include/hfsm2/detail/structure/orthogonal_sub_1.inl +++ b/include/hfsm2/detail/structure/orthogonal_sub_1.inl @@ -3,10 +3,10 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template +template void -OS_::wideRegister(StateRegistry& stateRegistry, - const ForkID forkId) +OS_::wideRegister(StateRegistry& stateRegistry, + const ForkID forkId) { initial .deepRegister(stateRegistry, Parent{forkId, PRONG_INDEX}); remaining.wideRegister(stateRegistry, forkId); @@ -14,10 +14,10 @@ OS_::wideRegister(StateRegistry& stateRegistry, //------------------------------------------------------------------------------ -template +template bool -OS_::wideForwardEntryGuard(GuardControl& control, - const ProngConstBits prongs) +OS_::wideForwardEntryGuard(GuardControl& control, + const ProngConstBits prongs) { const bool i = prongs.get(PRONG_INDEX) ? initial .deepForwardEntryGuard(control) : false; @@ -29,9 +29,9 @@ OS_::wideForwardEntryGuard(GuardControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -OS_::wideForwardEntryGuard(GuardControl& control) { +OS_::wideForwardEntryGuard(GuardControl& control) { const bool i = initial .deepForwardEntryGuard(control); const bool r = remaining.wideForwardEntryGuard(control); @@ -40,9 +40,9 @@ OS_::wideForwardEntryGuard(GuardControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -OS_::wideEntryGuard(GuardControl& control) { +OS_::wideEntryGuard(GuardControl& control) { const bool i = initial .deepEntryGuard(control); const bool r = remaining.wideEntryGuard(control); @@ -51,37 +51,37 @@ OS_::wideEntryGuard(GuardControl& control) { //------------------------------------------------------------------------------ -template +template void -OS_::wideEnter(PlanControl& control) { +OS_::wideEnter(PlanControl& control) { initial .deepEnter(control); remaining.wideEnter(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideReenter(PlanControl& control) { +OS_::wideReenter(PlanControl& control) { initial .deepReenter(control); remaining.wideReenter(control); } //------------------------------------------------------------------------------ -template +template Status -OS_::wideUpdate(FullControl& control) { +OS_::wideUpdate(FullControl& control) { const auto status = initial .deepUpdate(control); return combine(status, remaining.wideUpdate(control)); } //------------------------------------------------------------------------------ -template +template template Status -OS_::wideReact(FullControl& control, +OS_::wideReact(FullControl& control, const TEvent& event) { const auto status = initial .deepReact(control, event); @@ -90,10 +90,10 @@ OS_::wideReact(FullControl& control, //------------------------------------------------------------------------------ -template +template bool -OS_::wideForwardExitGuard(GuardControl& control, - const ProngConstBits prongs) +OS_::wideForwardExitGuard(GuardControl& control, + const ProngConstBits prongs) { const bool i = prongs.get(PRONG_INDEX) ? initial .deepForwardExitGuard(control) : false; @@ -105,9 +105,9 @@ OS_::wideForwardExitGuard(GuardControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -OS_::wideForwardExitGuard(GuardControl& control) { +OS_::wideForwardExitGuard(GuardControl& control) { const bool i = initial .deepForwardExitGuard(control); const bool r = remaining.wideForwardExitGuard(control); @@ -116,9 +116,9 @@ OS_::wideForwardExitGuard(GuardControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -OS_::wideExitGuard(GuardControl& control) { +OS_::wideExitGuard(GuardControl& control) { const bool i = initial .deepExitGuard(control); const bool r = remaining.wideExitGuard(control); @@ -127,20 +127,20 @@ OS_::wideExitGuard(GuardControl& control) { //------------------------------------------------------------------------------ -template +template void -OS_::wideExit(PlanControl& control) { +OS_::wideExit(PlanControl& control) { initial .deepExit(control); remaining.wideExit(control); } //------------------------------------------------------------------------------ -template +template void -OS_::wideForwardActive(Control& control, - const RequestType request, - const ProngConstBits prongs) +OS_::wideForwardActive(Control& control, + const RequestType request, + const ProngConstBits prongs) { const RequestType local = prongs.get(PRONG_INDEX) ? request : Request::REMAIN; @@ -151,11 +151,11 @@ OS_::wideForwardActive(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideForwardRequest(Control& control, - const RequestType request, - const ProngConstBits prongs) +OS_::wideForwardRequest(Control& control, + const RequestType request, + const ProngConstBits prongs) { const RequestType local = prongs.get(PRONG_INDEX) ? request : Request::REMAIN; @@ -166,63 +166,63 @@ OS_::wideForwardRequest(Control& control, //------------------------------------------------------------------------------ -template +template void -OS_::wideRequestChange(Control& control) { +OS_::wideRequestChange(Control& control) { initial .deepRequestChange(control); remaining.wideRequestChange(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestRemain(StateRegistry& stateRegistry) { +OS_::wideRequestRemain(StateRegistry& stateRegistry) { initial .deepRequestRemain(stateRegistry); remaining.wideRequestRemain(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestRestart(StateRegistry& stateRegistry) { +OS_::wideRequestRestart(StateRegistry& stateRegistry) { initial .deepRequestRestart(stateRegistry); remaining.wideRequestRestart(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestResume(StateRegistry& stateRegistry) { +OS_::wideRequestResume(StateRegistry& stateRegistry) { initial .deepRequestResume(stateRegistry); remaining.wideRequestResume(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestUtilize(Control& control) { +OS_::wideRequestUtilize(Control& control) { initial .deepRequestUtilize(control); remaining.wideRequestUtilize(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestRandomize(Control& control) { +OS_::wideRequestRandomize(Control& control) { initial .deepRequestRandomize(control); remaining.wideRequestRandomize(control); } //------------------------------------------------------------------------------ -template -typename TA::Utility -OS_::wideReportChange(Control& control) { +template +typename TA_::Utility +OS_::wideReportChange(Control& control) { const UP i = initial .deepReportChange(control); const Utility r = remaining.wideReportChange(control); @@ -231,9 +231,9 @@ OS_::wideReportChange(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -OS_::wideReportUtilize(Control& control) { +template +typename TA_::Utility +OS_::wideReportUtilize(Control& control) { const UP i = initial .deepReportUtilize(control); const Utility r = remaining.wideReportUtilize(control); @@ -242,9 +242,9 @@ OS_::wideReportUtilize(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -OS_::wideReportRandomize(Control& control) { +template +typename TA_::Utility +OS_::wideReportRandomize(Control& control) { const Utility i = initial .deepReportRandomize(control); const Utility r = remaining.wideReportRandomize(control); @@ -253,18 +253,18 @@ OS_::wideReportRandomize(Control& control) { //------------------------------------------------------------------------------ -template +template void -OS_::wideEnterRequested(PlanControl& control) { +OS_::wideEnterRequested(PlanControl& control) { initial .deepEnterRequested(control); remaining.wideEnterRequested(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideChangeToRequested(PlanControl& control) { +OS_::wideChangeToRequested(PlanControl& control) { initial .deepChangeToRequested(control); remaining.wideChangeToRequested(control); } @@ -273,11 +273,11 @@ OS_::wideChangeToRequested(PlanControl& control) { #ifdef HFSM_ENABLE_STRUCTURE_REPORT -template +template void -OS_::wideGetNames(const LongIndex parent, - const ShortIndex depth, - StructureStateInfos& _stateInfos) const +OS_::wideGetNames(const LongIndex parent, + const ShortIndex depth, + StructureStateInfos& _stateInfos) const { initial .deepGetNames(parent, StructureStateInfo::ORTHOGONAL, depth, _stateInfos); remaining.wideGetNames(parent, depth, _stateInfos); diff --git a/include/hfsm2/detail/structure/orthogonal_sub_2.inl b/include/hfsm2/detail/structure/orthogonal_sub_2.inl index c8dd7ea..1973437 100644 --- a/include/hfsm2/detail/structure/orthogonal_sub_2.inl +++ b/include/hfsm2/detail/structure/orthogonal_sub_2.inl @@ -3,20 +3,20 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template +template void -OS_::wideRegister(StateRegistry& stateRegistry, - const ForkID forkId) +OS_::wideRegister(StateRegistry& stateRegistry, + const ForkID forkId) { initial.deepRegister(stateRegistry, Parent{forkId, PRONG_INDEX}); } //------------------------------------------------------------------------------ -template +template bool -OS_::wideForwardEntryGuard(GuardControl& control, - const ProngConstBits prongs) +OS_::wideForwardEntryGuard(GuardControl& control, + const ProngConstBits prongs) { return prongs.get(PRONG_INDEX) ? initial.deepForwardEntryGuard(control) : false; @@ -24,61 +24,61 @@ OS_::wideForwardEntryGuard(GuardControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -OS_::wideForwardEntryGuard(GuardControl& control) { +OS_::wideForwardEntryGuard(GuardControl& control) { return initial.deepForwardEntryGuard(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -OS_::wideEntryGuard(GuardControl& control) { +OS_::wideEntryGuard(GuardControl& control) { return initial.deepEntryGuard(control); } //------------------------------------------------------------------------------ -template +template void -OS_::wideEnter(PlanControl& control) { +OS_::wideEnter(PlanControl& control) { initial.deepEnter(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideReenter(PlanControl& control) { +OS_::wideReenter(PlanControl& control) { initial.deepReenter(control); } //------------------------------------------------------------------------------ -template +template Status -OS_::wideUpdate(FullControl& control) { +OS_::wideUpdate(FullControl& control) { return initial.deepUpdate(control); } //------------------------------------------------------------------------------ -template +template template Status -OS_::wideReact(FullControl& control, - const TEvent& event) +OS_::wideReact(FullControl& control, + const TEvent& event) { return initial.deepReact(control, event); } //------------------------------------------------------------------------------ -template +template bool -OS_::wideForwardExitGuard(GuardControl& control, - const ProngConstBits prongs) +OS_::wideForwardExitGuard(GuardControl& control, + const ProngConstBits prongs) { return prongs.get(PRONG_INDEX) ? initial.deepForwardExitGuard(control) : false; @@ -86,35 +86,35 @@ OS_::wideForwardExitGuard(GuardControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -OS_::wideForwardExitGuard(GuardControl& control) { +OS_::wideForwardExitGuard(GuardControl& control) { return initial.deepForwardExitGuard(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -OS_::wideExitGuard(GuardControl& control) { +OS_::wideExitGuard(GuardControl& control) { return initial.deepExitGuard(control); } //------------------------------------------------------------------------------ -template +template void -OS_::wideExit(PlanControl& control) { +OS_::wideExit(PlanControl& control) { initial.deepExit(control); } //------------------------------------------------------------------------------ -template +template void -OS_::wideForwardActive(Control& control, - const RequestType request, - const ProngConstBits prongs) +OS_::wideForwardActive(Control& control, + const RequestType request, + const ProngConstBits prongs) { const RequestType local = prongs.get(PRONG_INDEX) ? request : Request::REMAIN; @@ -124,11 +124,11 @@ OS_::wideForwardActive(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideForwardRequest(Control& control, - const RequestType request, - const ProngConstBits prongs) +OS_::wideForwardRequest(Control& control, + const RequestType request, + const ProngConstBits prongs) { const RequestType local = prongs.get(PRONG_INDEX) ? request : Request::REMAIN; @@ -138,57 +138,57 @@ OS_::wideForwardRequest(Control& control, //------------------------------------------------------------------------------ -template +template void -OS_::wideRequestChange(Control& control) { +OS_::wideRequestChange(Control& control) { initial.deepRequestChange(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestRemain(StateRegistry& stateRegistry) { +OS_::wideRequestRemain(StateRegistry& stateRegistry) { initial.deepRequestRemain(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestRestart(StateRegistry& stateRegistry) { +OS_::wideRequestRestart(StateRegistry& stateRegistry) { initial.deepRequestRestart(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestResume(StateRegistry& stateRegistry) { +OS_::wideRequestResume(StateRegistry& stateRegistry) { initial.deepRequestResume(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestUtilize(Control& control) { +OS_::wideRequestUtilize(Control& control) { initial.deepRequestUtilize(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestRandomize(Control& control) { +OS_::wideRequestRandomize(Control& control) { initial.deepRequestRandomize(control); } //------------------------------------------------------------------------------ -template -typename TA::Utility -OS_::wideReportChange(Control& control) { +template +typename TA_::Utility +OS_::wideReportChange(Control& control) { const UP i = initial.deepReportChange(control); return i.utility; @@ -196,9 +196,9 @@ OS_::wideReportChange(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -OS_::wideReportUtilize(Control& control) { +template +typename TA_::Utility +OS_::wideReportUtilize(Control& control) { const UP i = initial.deepReportUtilize(control); return i.utility; @@ -206,9 +206,9 @@ OS_::wideReportUtilize(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -OS_::wideReportRandomize(Control& control) { +template +typename TA_::Utility +OS_::wideReportRandomize(Control& control) { const Utility i = initial.deepReportRandomize(control); return i; @@ -216,17 +216,17 @@ OS_::wideReportRandomize(Control& control) { //------------------------------------------------------------------------------ -template +template void -OS_::wideEnterRequested(PlanControl& control) { +OS_::wideEnterRequested(PlanControl& control) { initial.deepEnterRequested(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideChangeToRequested(PlanControl& control) { +OS_::wideChangeToRequested(PlanControl& control) { initial.deepChangeToRequested(control); } @@ -234,11 +234,11 @@ OS_::wideChangeToRequested(PlanControl& control) { #ifdef HFSM_ENABLE_STRUCTURE_REPORT -template +template void -OS_::wideGetNames(const LongIndex parent, - const ShortIndex depth, - StructureStateInfos& _stateInfos) const +OS_::wideGetNames(const LongIndex parent, + const ShortIndex depth, + StructureStateInfos& _stateInfos) const { initial.deepGetNames(parent, StructureStateInfo::ORTHOGONAL, depth, _stateInfos); } diff --git a/include/hfsm2/detail/structure/root.hpp b/include/hfsm2/detail/structure/root.hpp index e9a6ebb..4b0cfd6 100644 --- a/include/hfsm2/detail/structure/root.hpp +++ b/include/hfsm2/detail/structure/root.hpp @@ -257,18 +257,18 @@ class RW_ final // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -class RW_ <::hfsm2::ConfigT<::hfsm2::EmptyContext, TN, TU, TR, TP, NS, NT>, TApex> final - : public R_<::hfsm2::ConfigT<::hfsm2::EmptyContext, TN, TU, TR, TP, NS, NT>, TApex> +class RW_ <::hfsm2::ConfigT<::hfsm2::EmptyContext, TN_, TU_, TR_, TP_, NS, NT>, TApex> final + : public R_<::hfsm2::ConfigT<::hfsm2::EmptyContext, TN_, TU_, TR_, TP_, NS, NT>, TApex> , ::hfsm2::EmptyContext { - using Config_ = ::hfsm2::ConfigT<::hfsm2::EmptyContext, TN, TU, TR, TP, NS, NT>; + using Config_ = ::hfsm2::ConfigT<::hfsm2::EmptyContext, TN_, TU_, TR_, TP_, NS, NT>; using Context = typename Config_::Context; using Random_ = typename Config_::Random_; using Logger = typename Config_::Logger; @@ -286,18 +286,18 @@ class RW_ <::hfsm2::ConfigT<::hfsm2::EmptyContext, TN, TU, TR, TP, NS, NT>, T // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -class RW_ <::hfsm2::ConfigT, TP, NS, NT>, TApex> final - : public R_<::hfsm2::ConfigT, TP, NS, NT>, TApex> - , ::hfsm2::RandomT +class RW_ <::hfsm2::ConfigT, TP_, NS, NT>, TApex> final + : public R_<::hfsm2::ConfigT, TP_, NS, NT>, TApex> + , ::hfsm2::RandomT { - using Config_ = ::hfsm2::ConfigT, TP, NS, NT>; + using Config_ = ::hfsm2::ConfigT, TP_, NS, NT>; using Context = typename Config_::Context; using Random_ = typename Config_::Random_; using Logger = typename Config_::Logger; @@ -316,18 +316,18 @@ class RW_ <::hfsm2::ConfigT, TP, NS, NT>, TA // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -class RW_ <::hfsm2::ConfigT<::hfsm2::EmptyContext, TN, TU, ::hfsm2::RandomT, TP, NS, NT>, TApex> final - : public R_<::hfsm2::ConfigT<::hfsm2::EmptyContext, TN, TU, ::hfsm2::RandomT, TP, NS, NT>, TApex> +class RW_ <::hfsm2::ConfigT<::hfsm2::EmptyContext, TN_, TU_, ::hfsm2::RandomT, TP_, NS, NT>, TApex> final + : public R_<::hfsm2::ConfigT<::hfsm2::EmptyContext, TN_, TU_, ::hfsm2::RandomT, TP_, NS, NT>, TApex> , ::hfsm2::EmptyContext - , ::hfsm2::RandomT + , ::hfsm2::RandomT { - using Config_ = ::hfsm2::ConfigT<::hfsm2::EmptyContext, TN, TU, ::hfsm2::RandomT, TP, NS, NT>; + using Config_ = ::hfsm2::ConfigT<::hfsm2::EmptyContext, TN_, TU_, ::hfsm2::RandomT, TP_, NS, NT>; using Context = typename Config_::Context; using Random_ = typename Config_::Random_; using Logger = typename Config_::Logger; diff --git a/include/hfsm2/detail/structure/root.inl b/include/hfsm2/detail/structure/root.inl index f9452d7..5b3d937 100644 --- a/include/hfsm2/detail/structure/root.inl +++ b/include/hfsm2/detail/structure/root.inl @@ -3,10 +3,10 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template -R_::R_(Context& context, - Random_& random - HFSM_IF_LOGGER(, Logger* const logger)) +template +R_::R_(Context& context, + Random_& random + HFSM_IF_LOGGER(, Logger* const logger)) : _context{context} , _random{random} HFSM_IF_LOGGER(, _logger{logger}) @@ -20,8 +20,8 @@ R_::R_(Context& context, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -R_::~R_() { +template +R_::~R_() { PlanControl control{_context, _random, _stateRegistry, @@ -34,9 +34,9 @@ R_::~R_() { //------------------------------------------------------------------------------ -template +template void -R_::update() { +R_::update() { FullControl control(_context, _random, _stateRegistry, @@ -55,10 +55,10 @@ R_::update() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template template void -R_::react(const TEvent& event) { +R_::react(const TEvent& event) { FullControl control{_context, _random, _stateRegistry, @@ -77,9 +77,9 @@ R_::react(const TEvent& event) { //------------------------------------------------------------------------------ -template +template void -R_::changeTo(const StateID stateId) { +R_::changeTo(const StateID stateId) { const Request request{Request::Type::CHANGE, stateId}; _requests << request; @@ -88,10 +88,10 @@ R_::changeTo(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::changeTo(const StateID stateId, - const Payload& payload) +R_::changeTo(const StateID stateId, + const Payload& payload) { const Request request{Request::Type::CHANGE, stateId, payload}; _requests << request; @@ -101,9 +101,9 @@ R_::changeTo(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -R_::restart(const StateID stateId) { +R_::restart(const StateID stateId) { const Request request{Request::Type::RESTART, stateId}; _requests << request; @@ -112,10 +112,10 @@ R_::restart(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::restart(const StateID stateId, - const Payload& payload) +R_::restart(const StateID stateId, + const Payload& payload) { const Request request{Request::Type::RESTART, stateId, payload}; _requests << request; @@ -125,9 +125,9 @@ R_::restart(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -R_::resume(const StateID stateId) { +R_::resume(const StateID stateId) { const Request request{Request::Type::RESUME, stateId}; _requests << request; @@ -136,10 +136,10 @@ R_::resume(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::resume(const StateID stateId, - const Payload& payload) +R_::resume(const StateID stateId, + const Payload& payload) { const Request request{Request::Type::RESUME, stateId, payload}; _requests << request; @@ -149,9 +149,9 @@ R_::resume(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -R_::utilize(const StateID stateId) { +R_::utilize(const StateID stateId) { const Request request{Request::Type::UTILIZE, stateId}; _requests << request; @@ -160,10 +160,10 @@ R_::utilize(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::utilize(const StateID stateId, - const Payload& payload) +R_::utilize(const StateID stateId, + const Payload& payload) { const Request request{Request::Type::UTILIZE, stateId, payload}; _requests << request; @@ -173,9 +173,9 @@ R_::utilize(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -R_::randomize(const StateID stateId) { +R_::randomize(const StateID stateId) { const Request request{Request::Type::RANDOMIZE, stateId}; _requests << request; @@ -184,10 +184,10 @@ R_::randomize(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::randomize(const StateID stateId, - const Payload& payload) +R_::randomize(const StateID stateId, + const Payload& payload) { const Request request{Request::Type::RANDOMIZE, stateId, payload}; _requests << request; @@ -197,9 +197,9 @@ R_::randomize(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -R_::schedule(const StateID stateId) { +R_::schedule(const StateID stateId) { const Request request{Request::Type::SCHEDULE, stateId}; _requests << request; @@ -208,10 +208,10 @@ R_::schedule(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::schedule(const StateID stateId, - const Payload& payload) +R_::schedule(const StateID stateId, + const Payload& payload) { const Request request{Request::Type::SCHEDULE, stateId, payload}; _requests << request; @@ -221,9 +221,9 @@ R_::schedule(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -R_::resetStateData(const StateID stateId) { +R_::resetStateData(const StateID stateId) { HFSM_ASSERT(stateId < Payloads::CAPACITY); if (stateId < Payloads::CAPACITY) @@ -232,10 +232,10 @@ R_::resetStateData(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::setStateData(const StateID stateId, - const Payload& payload) +R_::setStateData(const StateID stateId, + const Payload& payload) { HFSM_ASSERT(stateId < Payloads::CAPACITY); @@ -247,9 +247,9 @@ R_::setStateData(const StateID stateId, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -R_::isStateDataSet(const StateID stateId) const { +R_::isStateDataSet(const StateID stateId) const { HFSM_ASSERT(stateId < Payloads::CAPACITY); return stateId < Payloads::CAPACITY ? @@ -258,9 +258,9 @@ R_::isStateDataSet(const StateID stateId) const { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -const typename R_::Payload* -R_::getStateData(const StateID stateId) const { +template +const typename R_::Payload* +R_::getStateData(const StateID stateId) const { HFSM_ASSERT(stateId < Payloads::CAPACITY); return stateId < Payloads::CAPACITY && _payloadsSet.get(stateId) ? @@ -269,9 +269,9 @@ R_::getStateData(const StateID stateId) const { //------------------------------------------------------------------------------ -template +template void -R_::initialEnter() { +R_::initialEnter() { Control control{_context, _random, _stateRegistry, @@ -324,9 +324,9 @@ R_::initialEnter() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::processTransitions() { +R_::processTransitions() { HFSM_ASSERT(_requests.count()); HFSM_IF_STRUCTURE(_lastTransitions.clear()); @@ -374,9 +374,9 @@ R_::processTransitions() { //------------------------------------------------------------------------------ -template +template bool -R_::applyRequests(Control& control) { +R_::applyRequests(Control& control) { bool changesMade = false; for (const Request& request : _requests) { @@ -410,9 +410,9 @@ R_::applyRequests(Control& control) { //------------------------------------------------------------------------------ -template +template bool -R_::cancelledByEntryGuards(const Requests& pendingRequests) { +R_::cancelledByEntryGuards(const Requests& pendingRequests) { GuardControl guardControl{_context, _random, _stateRegistry, @@ -431,9 +431,9 @@ R_::cancelledByEntryGuards(const Requests& pendingRequests) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -R_::cancelledByGuards(const Requests& pendingRequests) { +R_::cancelledByGuards(const Requests& pendingRequests) { GuardControl guardControl{_context, _random, _stateRegistry, @@ -458,9 +458,9 @@ R_::cancelledByGuards(const Requests& pendingRequests) { #ifdef HFSM_ENABLE_STRUCTURE_REPORT -template +template void -R_::getStateNames() { +R_::getStateNames() { _stateInfos.clear(); _apex.deepGetNames((LongIndex) -1, StructureStateInfo::COMPOSITE, 0, _stateInfos); @@ -536,9 +536,9 @@ R_::getStateNames() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::udpateActivity() { +R_::udpateActivity() { for (LongIndex s = 0, i = 0; s < _stateInfos.count(); ++s) if (_stateInfos[s].name[0] != L'\0') { _structure[i].isActive = isActive(s); @@ -563,9 +563,9 @@ R_::udpateActivity() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::recordRequestsAs(const Method method) { +R_::recordRequestsAs(const Method method) { for (const auto& request : _requests) _lastTransitions << TransitionInfo(request, method); } diff --git a/include/hfsm2/detail/structure/state.inl b/include/hfsm2/detail/structure/state.inl index 7e39954..779d929 100644 --- a/include/hfsm2/detail/structure/state.inl +++ b/include/hfsm2/detail/structure/state.inl @@ -5,10 +5,10 @@ namespace detail { namespace { -template +template struct RegisterT { - using StateParents = StaticArray; - using StateList = typename TA::StateList; + using StateParents = StaticArray; + using StateList = typename TA_::StateList; static constexpr StateID STATE_ID = NS; @@ -17,7 +17,7 @@ struct RegisterT { execute(StateParents& stateParents, const Parent parent) { - static constexpr auto HEAD_ID = StateList::template index(); + static constexpr auto HEAD_ID = StateList::template index(); StaticAssertEquality(); stateParents[STATE_ID] = parent; @@ -26,9 +26,9 @@ struct RegisterT { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -struct RegisterT> { - using StateParents = StaticArray; +template +struct RegisterT> { + using StateParents = StaticArray; static HFSM_INLINE void @@ -39,20 +39,20 @@ struct RegisterT> { //////////////////////////////////////////////////////////////////////////////// -template +template void -S_::deepRegister(StateRegistry& stateRegistry, +S_::deepRegister(StateRegistry& stateRegistry, const Parent parent) { - using Register = RegisterT; + using Register = RegisterT; Register::execute(stateRegistry.stateParents, parent); } //------------------------------------------------------------------------------ -template +template bool -S_::deepEntryGuard(GuardControl& control) { +S_::deepEntryGuard(GuardControl& control) { HFSM_LOG_STATE_METHOD(&Head::entryGuard, control.context(), Method::ENTRY_GUARD); @@ -69,9 +69,9 @@ S_::deepEntryGuard(GuardControl& control) { //------------------------------------------------------------------------------ -template +template void -S_::deepEnter(PlanControl& control) { +S_::deepEnter(PlanControl& control) { HFSM_ASSERT(!control.planData().tasksSuccesses.template get()); HFSM_ASSERT(!control.planData().tasksFailures .template get()); @@ -87,9 +87,9 @@ S_::deepEnter(PlanControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -S_::deepReenter(PlanControl& control) { +S_::deepReenter(PlanControl& control) { HFSM_ASSERT(!control.planData().tasksSuccesses.template get()); HFSM_ASSERT(!control.planData().tasksFailures .template get()); @@ -105,9 +105,9 @@ S_::deepReenter(PlanControl& control) { //------------------------------------------------------------------------------ -template +template Status -S_::deepUpdate(FullControl& control) { +S_::deepUpdate(FullControl& control) { HFSM_LOG_STATE_METHOD(&Head::update, control.context(), Method::UPDATE); @@ -122,10 +122,10 @@ S_::deepUpdate(FullControl& control) { //------------------------------------------------------------------------------ -template +template template Status -S_::deepReact(FullControl& control, +S_::deepReact(FullControl& control, const TEvent& event) { auto reaction = static_cast(&Head::react); @@ -143,9 +143,9 @@ S_::deepReact(FullControl& control, //------------------------------------------------------------------------------ -template +template bool -S_::deepExitGuard(GuardControl& control) { +S_::deepExitGuard(GuardControl& control) { HFSM_LOG_STATE_METHOD(&Head::exitGuard, control.context(), Method::EXIT_GUARD); @@ -162,9 +162,9 @@ S_::deepExitGuard(GuardControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -S_::deepExit(PlanControl& control) { +S_::deepExit(PlanControl& control) { HFSM_LOG_STATE_METHOD(&Head::exit, control.context(), Method::EXIT); @@ -185,9 +185,9 @@ S_::deepExit(PlanControl& control) { //------------------------------------------------------------------------------ -template +template void -S_::wrapPlanSucceeded(FullControl& control) { +S_::wrapPlanSucceeded(FullControl& control) { HFSM_LOG_STATE_METHOD(&Head::planSucceeded, control.context(), Method::PLAN_SUCCEEDED); @@ -199,9 +199,9 @@ S_::wrapPlanSucceeded(FullControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -S_::wrapPlanFailed(FullControl& control) { +S_::wrapPlanFailed(FullControl& control) { HFSM_LOG_STATE_METHOD(&Head::planFailed, control.context(), Method::PLAN_FAILED); @@ -213,9 +213,9 @@ S_::wrapPlanFailed(FullControl& control) { //------------------------------------------------------------------------------ -template -typename TA::Rank -S_::wrapRank(Control& control) { +template +typename TA_::Rank +S_::wrapRank(Control& control) { HFSM_LOG_STATE_METHOD(&Head::rank, control.context(), Method::RANK); @@ -225,9 +225,9 @@ S_::wrapRank(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -S_::wrapUtility(Control& control) { +template +typename TA_::Utility +S_::wrapUtility(Control& control) { HFSM_LOG_STATE_METHOD(&Head::utility, control.context(), Method::UTILITY); @@ -237,9 +237,9 @@ S_::wrapUtility(Control& control) { //------------------------------------------------------------------------------ -template -typename TA::UP -S_::deepReportChange(Control& control) { +template +typename TA_::UP +S_::deepReportChange(Control& control) { const Utility utility = wrapUtility(control); const Parent parent = stateParent(control); @@ -249,9 +249,9 @@ S_::deepReportChange(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -S_::deepReportUtilize(Control& control) { +template +typename TA_::UP +S_::deepReportUtilize(Control& control) { const Utility utility = wrapUtility(control); const Parent parent = stateParent(control); @@ -260,17 +260,17 @@ S_::deepReportUtilize(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Rank -S_::deepReportRank(Control& control) { +template +typename TA_::Rank +S_::deepReportRank(Control& control) { return wrapRank(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -S_::deepReportRandomize(Control& control) { +template +typename TA_::Utility +S_::deepReportRandomize(Control& control) { return wrapUtility(control); } @@ -278,9 +278,9 @@ S_::deepReportRandomize(Control& control) { #ifdef HFSM_ENABLE_STRUCTURE_REPORT -template +template const char* -S_::name() { +S_::name() { if (isBare()) return ""; else { @@ -314,9 +314,9 @@ S_::name() { //------------------------------------------------------------------------------ -template +template void -S_::deepGetNames(const LongIndex parent, +S_::deepGetNames(const LongIndex parent, const RegionType region, const ShortIndex depth, StructureStateInfos& _stateInfos) const diff --git a/include/hfsm2/machine.hpp b/include/hfsm2/machine.hpp index ed03127..3e568e1 100644 --- a/include/hfsm2/machine.hpp +++ b/include/hfsm2/machine.hpp @@ -252,16 +252,16 @@ end(const T(& a)[NCapacity]) { //////////////////////////////////////////////////////////////////////////////// -template +template struct Min { - static constexpr auto VALUE = N1 < N2 ? N1 : N2; + static constexpr auto VALUE = N1_ < N2_ ? N1_ : N2_; }; //------------------------------------------------------------------------------ -template +template struct Max { - static constexpr auto VALUE = N1 > N2 ? N1 : N2; + static constexpr auto VALUE = N1_ > N2_ ? N1_ : N2_; }; //------------------------------------------------------------------------------ @@ -524,16 +524,16 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template -StaticArray::StaticArray(const Item filler) { +template +StaticArray::StaticArray(const Item filler) { fill(filler); } //------------------------------------------------------------------------------ -template +template T& -StaticArray::operator[] (const LongIndex i) { +StaticArray::operator[] (const LongIndex i) { HFSM_ASSERT(0 <= i && i < CAPACITY); return _items[i]; @@ -541,9 +541,9 @@ StaticArray::operator[] (const LongIndex i) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template const T& -StaticArray::operator[] (const LongIndex i) const { +StaticArray::operator[] (const LongIndex i) const { HFSM_ASSERT(0 <= i && i < CAPACITY); return _items[i]; @@ -551,19 +551,19 @@ StaticArray::operator[] (const LongIndex i) const { //------------------------------------------------------------------------------ -template +template void -StaticArray::fill(const Item filler) { +StaticArray::fill(const Item filler) { for (LongIndex i = 0; i < CAPACITY; ++i) _items[i] = filler; } //////////////////////////////////////////////////////////////////////////////// -template +template template LongIndex -Array::operator << (TValue&& value) { +Array::operator << (TValue&& value) { HFSM_ASSERT(_count < CAPACITY); new (&_items[_count]) Item{std::move(value)}; @@ -573,9 +573,9 @@ Array::operator << (TValue&& value) { //------------------------------------------------------------------------------ -template +template T& -Array::operator[] (const LongIndex i) { +Array::operator[] (const LongIndex i) { HFSM_ASSERT(0 <= i && i < CAPACITY); return _items[i]; @@ -583,9 +583,9 @@ Array::operator[] (const LongIndex i) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template const T& -Array::operator[] (const LongIndex i) const { +Array::operator[] (const LongIndex i) const { HFSM_ASSERT(0 <= i && i < CAPACITY); return _items[i]; @@ -2172,9 +2172,9 @@ namespace detail { #ifdef HFSM_ENABLE_ASSERT -template +template void -PlanDataT>::verifyPlans() const { +PlanDataT>::verifyPlans() const { LongIndex planCount = 0; for (RegionID id = 0; id < REGION_COUNT; ++id) planCount += verifyPlan(id); @@ -2184,9 +2184,9 @@ PlanDataT>::verifyPlans() const //------------------------------------------------------------------------------ -template +template LongIndex -PlanDataT>::verifyPlan(const RegionID regionId) const { +PlanDataT>::verifyPlan(const RegionID regionId) const { LongIndex length = 0; const Bounds& bounds = tasksBounds[regionId]; @@ -3002,18 +3002,18 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template +template void -AllForksT::clear() { +AllForksT::clear() { compo.fill(INVALID_SHORT_INDEX); ortho.clear(); } //////////////////////////////////////////////////////////////////////////////// -template +template bool -StateRegistryT>::isActive(const StateID stateId) const { +StateRegistryT>::isActive(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) for (Parent parent = stateParents[stateId]; parent; @@ -3030,9 +3030,9 @@ StateRegistryT>::isActive(const // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -StateRegistryT>::isResumable(const StateID stateId) const { +StateRegistryT>::isResumable(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) for (Parent parent = stateParents[stateId]; parent; @@ -3049,9 +3049,9 @@ StateRegistryT>::isResumable(co //------------------------------------------------------------------------------ -template +template bool -StateRegistryT>::isPendingChange(const StateID stateId) const { +StateRegistryT>::isPendingChange(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) for (Parent parent = stateParents[stateId]; parent; @@ -3069,9 +3069,9 @@ StateRegistryT>::isPendingChang // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -StateRegistryT>::isPendingEnter(const StateID stateId) const { +StateRegistryT>::isPendingEnter(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) for (Parent parent = stateParents[stateId]; parent; @@ -3089,9 +3089,9 @@ StateRegistryT>::isPendingEnter // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -StateRegistryT>::isPendingExit(const StateID stateId) const { +StateRegistryT>::isPendingExit(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) for (Parent parent = stateParents[stateId]; parent; @@ -3109,9 +3109,9 @@ StateRegistryT>::isPendingExit( //------------------------------------------------------------------------------ -template +template const Parent& -StateRegistryT>::forkParent(const ForkID forkId) const { +StateRegistryT>::forkParent(const ForkID forkId) const { HFSM_ASSERT(forkId != 0); return forkId > 0 ? @@ -3121,9 +3121,9 @@ StateRegistryT>::forkParent(con //------------------------------------------------------------------------------ -template -typename StateRegistryT>::OrthoBits -StateRegistryT>::resumableOrthoFork(const ForkID forkId) { +template +typename StateRegistryT>::OrthoBits +StateRegistryT>::resumableOrthoFork(const ForkID forkId) { HFSM_ASSERT(forkId < 0); const Units& units = orthoUnits[-forkId - 1]; @@ -3132,9 +3132,9 @@ StateRegistryT>::resumableOrtho // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename StateRegistryT>::OrthoBits -StateRegistryT>::requestedOrthoFork(const ForkID forkId) { +template +typename StateRegistryT>::OrthoBits +StateRegistryT>::requestedOrthoFork(const ForkID forkId) { HFSM_ASSERT(forkId < 0); const Units& units = orthoUnits[-forkId - 1]; @@ -3143,9 +3143,9 @@ StateRegistryT>::requestedOrtho //------------------------------------------------------------------------------ -template +template bool -StateRegistryT>::requestImmediate(const Request request) { +StateRegistryT>::requestImmediate(const Request request) { if (request.stateId == 0) return false; else if (HFSM_CHECKED(request.stateId < STATE_COUNT)) { @@ -3197,9 +3197,9 @@ StateRegistryT>::requestImmedia // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -StateRegistryT>::requestScheduled(const StateID stateId) { +StateRegistryT>::requestScheduled(const StateID stateId) { if (HFSM_CHECKED(stateId < STATE_COUNT)) { const Parent parent = stateParents[stateId]; @@ -3214,18 +3214,18 @@ StateRegistryT>::requestSchedul //------------------------------------------------------------------------------ -template +template void -StateRegistryT>::clearRequests() { +StateRegistryT>::clearRequests() { compoRemains.clear(); requested.clear(); } //////////////////////////////////////////////////////////////////////////////// -template +template bool -StateRegistryT>::isActive(const StateID stateId) const { +StateRegistryT>::isActive(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) { if (Parent parent = stateParents[stateId]) { HFSM_ASSERT(parent.forkId > 0); @@ -3240,9 +3240,9 @@ StateRegistryT>::isActive(const Sta // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -StateRegistryT>::isResumable(const StateID stateId) const { +StateRegistryT>::isResumable(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) if (Parent parent = stateParents[stateId]) { HFSM_ASSERT(parent.forkId > 0); @@ -3255,9 +3255,9 @@ StateRegistryT>::isResumable(const //------------------------------------------------------------------------------ -template +template bool -StateRegistryT>::isPendingChange(const StateID stateId) const { +StateRegistryT>::isPendingChange(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) if (Parent parent = stateParents[stateId]) { HFSM_ASSERT(parent.forkId > 0); @@ -3271,9 +3271,9 @@ StateRegistryT>::isPendingChange(co // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -StateRegistryT>::isPendingEnter(const StateID stateId) const { +StateRegistryT>::isPendingEnter(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) if (Parent parent = stateParents[stateId]) { HFSM_ASSERT(parent.forkId > 0); @@ -3287,9 +3287,9 @@ StateRegistryT>::isPendingEnter(con // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -StateRegistryT>::isPendingExit(const StateID stateId) const { +StateRegistryT>::isPendingExit(const StateID stateId) const { if (HFSM_CHECKED(stateId < STATE_COUNT)) if (Parent parent = stateParents[stateId]) { HFSM_ASSERT(parent.forkId > 0); @@ -3303,9 +3303,9 @@ StateRegistryT>::isPendingExit(cons //------------------------------------------------------------------------------ -template +template const Parent& -StateRegistryT>::forkParent(const ForkID forkId) const { +StateRegistryT>::forkParent(const ForkID forkId) const { HFSM_ASSERT(forkId > 0); return compoParents[forkId - 1]; @@ -3313,9 +3313,9 @@ StateRegistryT>::forkParent(const F //------------------------------------------------------------------------------ -template +template bool -StateRegistryT>::requestImmediate(const Request request) { +StateRegistryT>::requestImmediate(const Request request) { if (request.stateId == 0) return false; else if (HFSM_CHECKED(request.stateId < STATE_COUNT)) { @@ -3353,9 +3353,9 @@ StateRegistryT>::requestImmediate(c // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -StateRegistryT>::requestScheduled(const StateID stateId) { +StateRegistryT>::requestScheduled(const StateID stateId) { HFSM_ASSERT(stateId < STATE_COUNT); if (stateId < STATE_COUNT) { @@ -3368,9 +3368,9 @@ StateRegistryT>::requestScheduled(c //------------------------------------------------------------------------------ -template +template void -StateRegistryT>::clearRequests() { +StateRegistryT>::clearRequests() { compoRemains.clear(); requested.clear(); } @@ -3870,9 +3870,9 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template -ControlT::Region::Region(ControlT& control_, - const RegionID id) +template +ControlT::Region::Region(ControlT& control_, + const RegionID id) : control{control_} , prevId{control._regionId} { @@ -3881,16 +3881,16 @@ ControlT::Region::Region(ControlT& control_, //------------------------------------------------------------------------------ -template -ControlT::Region::~Region() { +template +ControlT::Region::~Region() { control.resetRegion(prevId); } //////////////////////////////////////////////////////////////////////////////// -template +template void -ControlT::setRegion(const RegionID id) { +ControlT::setRegion(const RegionID id) { HFSM_ASSERT(_regionId <= id && id < RegionList::SIZE); _regionId = id; @@ -3898,9 +3898,9 @@ ControlT::setRegion(const RegionID id) { //------------------------------------------------------------------------------ -template +template void -ControlT::resetRegion(const RegionID id) { //-V524 +ControlT::resetRegion(const RegionID id) { //-V524 HFSM_ASSERT(id <= _regionId && _regionId < RegionList::SIZE); _regionId = id; @@ -3908,9 +3908,9 @@ ControlT::resetRegion(const RegionID id) { //-V524 //////////////////////////////////////////////////////////////////////////////// -template -PlanControlT::Origin::Origin(PlanControlT& control_, - const StateID id) +template +PlanControlT::Origin::Origin(PlanControlT& control_, + const StateID id) : control{control_} , prevId{control._originId} { @@ -3919,18 +3919,18 @@ PlanControlT::Origin::Origin(PlanControlT& control_, //------------------------------------------------------------------------------ -template -PlanControlT::Origin::~Origin() { +template +PlanControlT::Origin::~Origin() { control.resetOrigin(prevId); } //////////////////////////////////////////////////////////////////////////////// -template -PlanControlT::Region::Region(PlanControlT& control_, - const RegionID id, - const StateID index, - const LongIndex size) +template +PlanControlT::Region::Region(PlanControlT& control_, + const RegionID id, + const StateID index, + const LongIndex size) : control{control_} , prevId{control._regionId} , prevIndex{control._regionIndex} @@ -3941,8 +3941,8 @@ PlanControlT::Region::Region(PlanControlT& control_, //------------------------------------------------------------------------------ -template -PlanControlT::Region::~Region() { +template +PlanControlT::Region::~Region() { control.resetRegion(prevId, prevIndex, prevSize); control._status.clear(); @@ -3950,9 +3950,9 @@ PlanControlT::Region::~Region() { //////////////////////////////////////////////////////////////////////////////// -template +template void -PlanControlT::setOrigin(const StateID id) { +PlanControlT::setOrigin(const StateID id) { HFSM_ASSERT(_regionId + _regionSize <= StateList::SIZE); HFSM_ASSERT(_originId <= id && id < StateList::SIZE); @@ -3961,9 +3961,9 @@ PlanControlT::setOrigin(const StateID id) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -PlanControlT::resetOrigin(const StateID id) { //-V524 +PlanControlT::resetOrigin(const StateID id) { //-V524 HFSM_ASSERT(_regionId + _regionSize <= StateList::SIZE); HFSM_ASSERT(id <= _originId && _originId < StateList::SIZE); @@ -3972,11 +3972,11 @@ PlanControlT::resetOrigin(const StateID id) { //-V524 //------------------------------------------------------------------------------ -template +template void -PlanControlT::setRegion(const RegionID id, - const StateID index, - const LongIndex size) +PlanControlT::setRegion(const RegionID id, + const StateID index, + const LongIndex size) { HFSM_ASSERT(_regionId <= id && id < RegionList::SIZE); HFSM_ASSERT(_regionIndex <= index && index + size <= _regionIndex + _regionSize); @@ -3988,11 +3988,11 @@ PlanControlT::setRegion(const RegionID id, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -PlanControlT::resetRegion(const RegionID id, //-V524 - const StateID index, - const LongIndex size) +PlanControlT::resetRegion(const RegionID id, //-V524 + const StateID index, + const LongIndex size) { HFSM_ASSERT(id <= _regionId && _regionId < RegionList::SIZE); HFSM_ASSERT(index <= _regionIndex && _regionIndex + _regionSize <= index + size); @@ -4004,8 +4004,8 @@ PlanControlT::resetRegion(const RegionID id, //-V524 //////////////////////////////////////////////////////////////////////////////// -template -FullControlT::Lock::Lock(FullControlT& control_) +template +FullControlT::Lock::Lock(FullControlT& control_) : control(!control_._locked ? &control_ : nullptr) { if (control) @@ -4014,19 +4014,19 @@ FullControlT::Lock::Lock(FullControlT& control_) //------------------------------------------------------------------------------ -template -FullControlT::Lock::~Lock() { +template +FullControlT::Lock::~Lock() { if (control) control->_locked = false; } //////////////////////////////////////////////////////////////////////////////// -template +template template Status -FullControlT::updatePlan(TState& headState, - const Status subStatus) +FullControlT::updatePlan(TState& headState, + const Status subStatus) { using State = TState; static constexpr StateID STATE_ID = State::STATE_ID; @@ -4069,10 +4069,10 @@ FullControlT::updatePlan(TState& headState, //------------------------------------------------------------------------------ -template +template template Status -FullControlT::buildPlanStatus() { +FullControlT::buildPlanStatus() { using State = TState; static constexpr StateID STATE_ID = State::STATE_ID; @@ -4102,9 +4102,9 @@ FullControlT::buildPlanStatus() { //------------------------------------------------------------------------------ -template +template void -FullControlT::changeTo(const StateID stateId) { +FullControlT::changeTo(const StateID stateId) { if (!_locked) { const Request request{Request::Type::CHANGE, stateId}; _requests << request; @@ -4118,10 +4118,10 @@ FullControlT::changeTo(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -FullControlT::changeTo(const StateID stateId, - const Payload& payload) +FullControlT::changeTo(const StateID stateId, + const Payload& payload) { if (!_locked) { const Request request{Request::Type::CHANGE, stateId, payload}; @@ -4136,9 +4136,9 @@ FullControlT::changeTo(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -FullControlT::restart(const StateID stateId) { +FullControlT::restart(const StateID stateId) { if (!_locked) { const Request request{Request::Type::RESTART, stateId}; _requests << request; @@ -4152,10 +4152,10 @@ FullControlT::restart(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -FullControlT::restart(const StateID stateId, - const Payload& payload) +FullControlT::restart(const StateID stateId, + const Payload& payload) { if (!_locked) { const Request request{Request::Type::RESTART, stateId, payload}; @@ -4170,9 +4170,9 @@ FullControlT::restart(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -FullControlT::resume(const StateID stateId) { +FullControlT::resume(const StateID stateId) { if (!_locked) { const Request request{Request::Type::RESUME, stateId}; _requests << request; @@ -4186,10 +4186,10 @@ FullControlT::resume(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -FullControlT::resume(const StateID stateId, - const Payload& payload) +FullControlT::resume(const StateID stateId, + const Payload& payload) { if (!_locked) { const Request request{Request::Type::RESUME, stateId, payload}; @@ -4204,9 +4204,9 @@ FullControlT::resume(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -FullControlT::utilize(const StateID stateId) { +FullControlT::utilize(const StateID stateId) { if (!_locked) { const Request request{Request::Type::UTILIZE, stateId}; _requests << request; @@ -4220,10 +4220,10 @@ FullControlT::utilize(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -FullControlT::utilize(const StateID stateId, - const Payload& payload) +FullControlT::utilize(const StateID stateId, + const Payload& payload) { if (!_locked) { const Request request{Request::Type::UTILIZE, stateId, payload}; @@ -4238,9 +4238,9 @@ FullControlT::utilize(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -FullControlT::randomize(const StateID stateId) { +FullControlT::randomize(const StateID stateId) { if (!_locked) { const Request request{Request::Type::RANDOMIZE, stateId}; _requests << request; @@ -4254,10 +4254,10 @@ FullControlT::randomize(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -FullControlT::randomize(const StateID stateId, - const Payload& payload) +FullControlT::randomize(const StateID stateId, + const Payload& payload) { if (!_locked) { const Request request{Request::Type::RANDOMIZE, stateId, payload}; @@ -4272,9 +4272,9 @@ FullControlT::randomize(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -FullControlT::schedule(const StateID stateId) { +FullControlT::schedule(const StateID stateId) { const Request transition{Request::Type::SCHEDULE, stateId}; _requests << transition; @@ -4283,10 +4283,10 @@ FullControlT::schedule(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -FullControlT::schedule(const StateID stateId, - const Payload& payload) +FullControlT::schedule(const StateID stateId, + const Payload& payload) { const Request transition{Request::Type::SCHEDULE, stateId, payload}; _requests << transition; @@ -4296,9 +4296,9 @@ FullControlT::schedule(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -FullControlT::succeed() { +FullControlT::succeed() { _status.result = Status::SUCCESS; _planData.tasksSuccesses.set(_originId); @@ -4315,9 +4315,9 @@ FullControlT::succeed() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -FullControlT::fail() { +FullControlT::fail() { _status.result = Status::FAILURE; _planData.tasksFailures.set(_originId); @@ -4334,9 +4334,9 @@ FullControlT::fail() { //////////////////////////////////////////////////////////////////////////////// -template +template void -GuardControlT::cancelPendingTransitions() { +GuardControlT::cancelPendingTransitions() { _cancelled = true; HFSM_LOG_CANCELLED_PENDING(context(), _originId); @@ -4593,127 +4593,127 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template +template void -B_::widePreEntryGuard(typename TF::Context& context) { - TF::preEntryGuard(context); - B_::widePreEntryGuard(context); +B_::widePreEntryGuard(typename TF_::Context& context) { + TF_::preEntryGuard(context); + B_::widePreEntryGuard(context); } //------------------------------------------------------------------------------ -template +template void -B_::widePreEnter(typename TF::Context& context) { - TF::preEnter(context); - B_::widePreEnter(context); +B_::widePreEnter(typename TF_::Context& context) { + TF_::preEnter(context); + B_::widePreEnter(context); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -B_::widePreReenter(typename TF::Context& context) { - TF::preReenter(context); - B_::widePreReenter(context); +B_::widePreReenter(typename TF_::Context& context) { + TF_::preReenter(context); + B_::widePreReenter(context); } //------------------------------------------------------------------------------ -template +template void -B_::widePreUpdate(typename TF::Context& context) { - TF::preUpdate(context); - B_::widePreUpdate(context); +B_::widePreUpdate(typename TF_::Context& context) { + TF_::preUpdate(context); + B_::widePreUpdate(context); } //------------------------------------------------------------------------------ -template +template template void -B_::widePreReact(const TEvent& event, - typename TF::Context& context) +B_::widePreReact(const TEvent& event, + typename TF_::Context& context) { - TF::preReact(event, context); - B_::widePreReact(event, context); + TF_::preReact(event, context); + B_::widePreReact(event, context); } //------------------------------------------------------------------------------ -template +template void -B_::widePreExitGuard(typename TF::Context& context) { - TF::preExitGuard(context); - B_::widePreExitGuard(context); +B_::widePreExitGuard(typename TF_::Context& context) { + TF_::preExitGuard(context); + B_::widePreExitGuard(context); } //------------------------------------------------------------------------------ -template +template void -B_::widePostExit(typename TF::Context& context) { - TF::postExit(context); - B_::widePostExit(context); +B_::widePostExit(typename TF_::Context& context) { + TF_::postExit(context); + B_::widePostExit(context); } //////////////////////////////////////////////////////////////////////////////// -template +template void -B_::widePreEntryGuard(typename TF::Context& context) { - TF::preEntryGuard(context); +B_::widePreEntryGuard(typename TF_::Context& context) { + TF_::preEntryGuard(context); } //------------------------------------------------------------------------------ -template +template void -B_::widePreEnter(typename TF::Context& context) { - TF::preEnter(context); +B_::widePreEnter(typename TF_::Context& context) { + TF_::preEnter(context); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -B_::widePreReenter(typename TF::Context& context) { - TF::preReenter(context); +B_::widePreReenter(typename TF_::Context& context) { + TF_::preReenter(context); } //------------------------------------------------------------------------------ -template +template void -B_::widePreUpdate(typename TF::Context& context) { - TF::preUpdate(context); +B_::widePreUpdate(typename TF_::Context& context) { + TF_::preUpdate(context); } //------------------------------------------------------------------------------ -template +template template void -B_::widePreReact(const TEvent& event, - typename TF::Context& context) +B_::widePreReact(const TEvent& event, + typename TF_::Context& context) { - TF::preReact(event, context); + TF_::preReact(event, context); } //------------------------------------------------------------------------------ -template +template void -B_::widePreExitGuard(typename TF::Context& context) { - TF::preExitGuard(context); +B_::widePreExitGuard(typename TF_::Context& context) { + TF_::preExitGuard(context); } //------------------------------------------------------------------------------ -template +template void -B_::widePostExit(typename TF::Context& context) { - TF::postExit(context); +B_::widePostExit(typename TF_::Context& context) { + TF_::postExit(context); } //////////////////////////////////////////////////////////////////////////////// @@ -4762,23 +4762,23 @@ struct OSI_; template struct WrapT; -template -struct WrapT { - using Type = SI_; +template +struct WrapT { + using Type = SI_; }; -template -struct WrapT< CI_> { - using Type = CI_; +template +struct WrapT< CI_> { + using Type = CI_; }; -template -struct WrapT< OI_> { - using Type = OI_; +template +struct WrapT< OI_> { + using Type = OI_; }; -template -using Wrap = typename WrapT::Type; +template +using Wrap = typename WrapT::Type; //------------------------------------------------------------------------------ @@ -4972,33 +4972,33 @@ class RW_; template struct MaterialT; -template -struct MaterialT { - using Type = S_; +template +struct MaterialT { + using Type = S_; }; -template -struct MaterialT > { - using Type = C_, TS...>; +template +struct MaterialT > { + using Type = C_, TS_...>; }; -template -struct MaterialT > { - using Type = C_; +template +struct MaterialT > { + using Type = C_; }; -template -struct MaterialT > { - using Type = O_, TS...>; +template +struct MaterialT > { + using Type = O_, TS_...>; }; -template -struct MaterialT > { - using Type = O_; +template +struct MaterialT > { + using Type = O_; }; -template -using Material = typename MaterialT::Type; +template +using Material = typename MaterialT::Type; //------------------------------------------------------------------------------ @@ -5065,45 +5065,45 @@ struct RF_ final { //////////////////////////////////////////////////////////////////////////////// -template +template struct CSubMaterialT; -//template -//struct CSubMaterialT > { -// using Type = Material; +//template +//struct CSubMaterialT > { +// using Type = Material; //}; -template -struct CSubMaterialT> { - using Type = CS_; +template +struct CSubMaterialT> { + using Type = CS_; }; -template -using CSubMaterial = typename CSubMaterialT::Type; +template +using CSubMaterial = typename CSubMaterialT::Type; //------------------------------------------------------------------------------ template struct InfoT; -template -struct InfoT< S_> { - using Type = SI_< TH>; +template +struct InfoT> { + using Type = SI_< TH_>; }; -template -struct InfoT> { - using Type = CI_< TG, TH, TS...>; +template +struct InfoT> { + using Type = CI_< TG_, TH_, TS_...>; }; -template -struct InfoT> { - using Type = OI_< TH, TS...>; +template +struct InfoT> { + using Type = OI_< TH_, TS_...>; }; -template -struct InfoT> { - using Type = CSI_< TS...>; +template +struct InfoT> { + using Type = CSI_< TS_...>; }; //////////////////////////////////////////////////////////////////////////////// @@ -5115,46 +5115,46 @@ namespace hfsm2 { //------------------------------------------------------------------------------ -template , - typename TP = EmptyPayload, +template , + typename TP_ = EmptyPayload, LongIndex NS = 4, LongIndex NT = INVALID_LONG_INDEX> struct ConfigT { - using Context = TC; + using Context = TC_; - using Rank = TN; - using Utility = TU; - using Random_ = TG; + using Rank = TN_; + using Utility = TU_; + using Random_ = TG_; using Logger = LoggerInterfaceT; - using Payload = TP; + using Payload = TP_; static constexpr LongIndex SUBSTITUTION_LIMIT = NS; static constexpr LongIndex TASK_CAPACITY = NT; template - using ContextT = ConfigT< T, TN, TU, TG, TP, NS, NT>; + using ContextT = ConfigT< T, TN_, TU_, TG_, TP_, NS, NT>; template - using RankT = ConfigT; + using RankT = ConfigT; template - using UtilityT = ConfigT; + using UtilityT = ConfigT; template - using RandomT = ConfigT; + using RandomT = ConfigT; template - using PayloadT = ConfigT; + using PayloadT = ConfigT; template - using SubstitutionLimitN = ConfigT; + using SubstitutionLimitN = ConfigT; template - using TaskCapacityN = ConfigT; + using TaskCapacityN = ConfigT; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -5436,10 +5436,10 @@ namespace detail { namespace { -template +template struct RegisterT { - using StateParents = StaticArray; - using StateList = typename TA::StateList; + using StateParents = StaticArray; + using StateList = typename TA_::StateList; static constexpr StateID STATE_ID = NS; @@ -5448,7 +5448,7 @@ struct RegisterT { execute(StateParents& stateParents, const Parent parent) { - static constexpr auto HEAD_ID = StateList::template index(); + static constexpr auto HEAD_ID = StateList::template index(); StaticAssertEquality(); stateParents[STATE_ID] = parent; @@ -5457,9 +5457,9 @@ struct RegisterT { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -struct RegisterT> { - using StateParents = StaticArray; +template +struct RegisterT> { + using StateParents = StaticArray; static HFSM_INLINE void @@ -5470,20 +5470,20 @@ struct RegisterT> { //////////////////////////////////////////////////////////////////////////////// -template +template void -S_::deepRegister(StateRegistry& stateRegistry, +S_::deepRegister(StateRegistry& stateRegistry, const Parent parent) { - using Register = RegisterT; + using Register = RegisterT; Register::execute(stateRegistry.stateParents, parent); } //------------------------------------------------------------------------------ -template +template bool -S_::deepEntryGuard(GuardControl& control) { +S_::deepEntryGuard(GuardControl& control) { HFSM_LOG_STATE_METHOD(&Head::entryGuard, control.context(), Method::ENTRY_GUARD); @@ -5500,9 +5500,9 @@ S_::deepEntryGuard(GuardControl& control) { //------------------------------------------------------------------------------ -template +template void -S_::deepEnter(PlanControl& control) { +S_::deepEnter(PlanControl& control) { HFSM_ASSERT(!control.planData().tasksSuccesses.template get()); HFSM_ASSERT(!control.planData().tasksFailures .template get()); @@ -5518,9 +5518,9 @@ S_::deepEnter(PlanControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -S_::deepReenter(PlanControl& control) { +S_::deepReenter(PlanControl& control) { HFSM_ASSERT(!control.planData().tasksSuccesses.template get()); HFSM_ASSERT(!control.planData().tasksFailures .template get()); @@ -5536,9 +5536,9 @@ S_::deepReenter(PlanControl& control) { //------------------------------------------------------------------------------ -template +template Status -S_::deepUpdate(FullControl& control) { +S_::deepUpdate(FullControl& control) { HFSM_LOG_STATE_METHOD(&Head::update, control.context(), Method::UPDATE); @@ -5553,10 +5553,10 @@ S_::deepUpdate(FullControl& control) { //------------------------------------------------------------------------------ -template +template template Status -S_::deepReact(FullControl& control, +S_::deepReact(FullControl& control, const TEvent& event) { auto reaction = static_cast(&Head::react); @@ -5574,9 +5574,9 @@ S_::deepReact(FullControl& control, //------------------------------------------------------------------------------ -template +template bool -S_::deepExitGuard(GuardControl& control) { +S_::deepExitGuard(GuardControl& control) { HFSM_LOG_STATE_METHOD(&Head::exitGuard, control.context(), Method::EXIT_GUARD); @@ -5593,9 +5593,9 @@ S_::deepExitGuard(GuardControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -S_::deepExit(PlanControl& control) { +S_::deepExit(PlanControl& control) { HFSM_LOG_STATE_METHOD(&Head::exit, control.context(), Method::EXIT); @@ -5616,9 +5616,9 @@ S_::deepExit(PlanControl& control) { //------------------------------------------------------------------------------ -template +template void -S_::wrapPlanSucceeded(FullControl& control) { +S_::wrapPlanSucceeded(FullControl& control) { HFSM_LOG_STATE_METHOD(&Head::planSucceeded, control.context(), Method::PLAN_SUCCEEDED); @@ -5630,9 +5630,9 @@ S_::wrapPlanSucceeded(FullControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -S_::wrapPlanFailed(FullControl& control) { +S_::wrapPlanFailed(FullControl& control) { HFSM_LOG_STATE_METHOD(&Head::planFailed, control.context(), Method::PLAN_FAILED); @@ -5644,9 +5644,9 @@ S_::wrapPlanFailed(FullControl& control) { //------------------------------------------------------------------------------ -template -typename TA::Rank -S_::wrapRank(Control& control) { +template +typename TA_::Rank +S_::wrapRank(Control& control) { HFSM_LOG_STATE_METHOD(&Head::rank, control.context(), Method::RANK); @@ -5656,9 +5656,9 @@ S_::wrapRank(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -S_::wrapUtility(Control& control) { +template +typename TA_::Utility +S_::wrapUtility(Control& control) { HFSM_LOG_STATE_METHOD(&Head::utility, control.context(), Method::UTILITY); @@ -5668,9 +5668,9 @@ S_::wrapUtility(Control& control) { //------------------------------------------------------------------------------ -template -typename TA::UP -S_::deepReportChange(Control& control) { +template +typename TA_::UP +S_::deepReportChange(Control& control) { const Utility utility = wrapUtility(control); const Parent parent = stateParent(control); @@ -5680,9 +5680,9 @@ S_::deepReportChange(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -S_::deepReportUtilize(Control& control) { +template +typename TA_::UP +S_::deepReportUtilize(Control& control) { const Utility utility = wrapUtility(control); const Parent parent = stateParent(control); @@ -5691,17 +5691,17 @@ S_::deepReportUtilize(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Rank -S_::deepReportRank(Control& control) { +template +typename TA_::Rank +S_::deepReportRank(Control& control) { return wrapRank(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -S_::deepReportRandomize(Control& control) { +template +typename TA_::Utility +S_::deepReportRandomize(Control& control) { return wrapUtility(control); } @@ -5709,9 +5709,9 @@ S_::deepReportRandomize(Control& control) { #ifdef HFSM_ENABLE_STRUCTURE_REPORT -template +template const char* -S_::name() { +S_::name() { if (isBare()) return ""; else { @@ -5745,9 +5745,9 @@ S_::name() { //------------------------------------------------------------------------------ -template +template void -S_::deepGetNames(const LongIndex parent, +S_::deepGetNames(const LongIndex parent, const RegionType region, const ShortIndex depth, StructureStateInfos& _stateInfos) const @@ -5860,7 +5860,7 @@ struct CS_ { #if HFSM_EXPLICIT_MEMBER_SPECIALIZATION - template + template HFSM_INLINE void wideRequestChange (Control& control, const ShortIndex = INVALID_SHORT_INDEX); template <> @@ -6044,10 +6044,10 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template +template void -CS_::wideRegister(StateRegistry& stateRegistry, - const Parent parent) +CS_::wideRegister(StateRegistry& stateRegistry, + const Parent parent) { lHalf.wideRegister(stateRegistry, Parent{parent.forkId, L_PRONG}); rHalf.wideRegister(stateRegistry, Parent{parent.forkId, R_PRONG}); @@ -6055,10 +6055,10 @@ CS_::wideRegister(StateRegistry& stateRegistry, //------------------------------------------------------------------------------ -template +template bool -CS_::wideForwardEntryGuard(GuardControl& control, - const ShortIndex prong) +CS_::wideForwardEntryGuard(GuardControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -6070,10 +6070,10 @@ CS_::wideForwardEntryGuard(GuardControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -CS_::wideEntryGuard(GuardControl& control, - const ShortIndex prong) +CS_::wideEntryGuard(GuardControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -6085,10 +6085,10 @@ CS_::wideEntryGuard(GuardControl& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideEnter(PlanControl& control, - const ShortIndex prong) +CS_::wideEnter(PlanControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -6100,10 +6100,10 @@ CS_::wideEnter(PlanControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideReenter(PlanControl& control, - const ShortIndex prong) +CS_::wideReenter(PlanControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -6115,10 +6115,10 @@ CS_::wideReenter(PlanControl& control, //------------------------------------------------------------------------------ -template +template Status -CS_::wideUpdate(FullControl& control, - const ShortIndex prong) +CS_::wideUpdate(FullControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -6129,12 +6129,12 @@ CS_::wideUpdate(FullControl& control, //------------------------------------------------------------------------------ -template +template template Status -CS_::wideReact(FullControl& control, - const TEvent& event, - const ShortIndex prong) +CS_::wideReact(FullControl& control, + const TEvent& event, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -6145,10 +6145,10 @@ CS_::wideReact(FullControl& control, //------------------------------------------------------------------------------ -template +template bool -CS_::wideForwardExitGuard(GuardControl& control, - const ShortIndex prong) +CS_::wideForwardExitGuard(GuardControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -6160,10 +6160,10 @@ CS_::wideForwardExitGuard(GuardControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -CS_::wideExitGuard(GuardControl& control, - const ShortIndex prong) +CS_::wideExitGuard(GuardControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -6175,10 +6175,10 @@ CS_::wideExitGuard(GuardControl& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideExit(PlanControl& control, - const ShortIndex prong) +CS_::wideExit(PlanControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -6190,11 +6190,11 @@ CS_::wideExit(PlanControl& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideForwardActive(Control& control, - const RequestType request, - const ShortIndex prong) +CS_::wideForwardActive(Control& control, + const RequestType request, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -6206,11 +6206,11 @@ CS_::wideForwardActive(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideForwardRequest(Control& control, - const RequestType request, - const ShortIndex prong) +CS_::wideForwardRequest(Control& control, + const RequestType request, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -6222,18 +6222,18 @@ CS_::wideForwardRequest(Control& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideRequestChangeComposite(Control& control) { +CS_::wideRequestChangeComposite(Control& control) { lHalf.wideRequestChangeComposite(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideRequestChangeResumable(Control& control, - const ShortIndex prong) +CS_::wideRequestChangeResumable(Control& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -6245,26 +6245,26 @@ CS_::wideRequestChangeResumable(Control& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideRequestRemain(StateRegistry& stateRegistry) { +CS_::wideRequestRemain(StateRegistry& stateRegistry) { lHalf.wideRequestRemain(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideRequestRestart(StateRegistry& stateRegistry) { +CS_::wideRequestRestart(StateRegistry& stateRegistry) { lHalf.wideRequestRestart(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideRequestResume(StateRegistry& stateRegistry, - const ShortIndex prong) +CS_::wideRequestResume(StateRegistry& stateRegistry, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -6276,9 +6276,9 @@ CS_::wideRequestResume(StateRegistry& stateRegistry, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -CS_::wideReportUtilize(Control& control) { +template +typename TA_::UP +CS_::wideReportUtilize(Control& control) { const UP l = lHalf.wideReportUtilize(control); const UP r = rHalf.wideReportUtilize(control); @@ -6288,10 +6288,10 @@ CS_::wideReportUtilize(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Rank -CS_::wideReportRank(Control& control, - Rank* const ranks) +template +typename TA_::Rank +CS_::wideReportRank(Control& control, + Rank* const ranks) { HFSM_ASSERT(ranks); @@ -6304,12 +6304,12 @@ CS_::wideReportRank(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -CS_::wideReportRandomize(Control& control, - Utility* const options, - const Rank* const ranks, - const Rank top) +template +typename TA_::Utility +CS_::wideReportRandomize(Control& control, + Utility* const options, + const Rank* const ranks, + const Rank top) { HFSM_ASSERT(options && ranks); @@ -6321,18 +6321,18 @@ CS_::wideReportRandomize(Control& control, //------------------------------------------------------------------------------ -template -typename TA::UP -CS_::wideReportChangeComposite(Control& control) { +template +typename TA_::UP +CS_::wideReportChangeComposite(Control& control) { return lHalf.wideReportChangeComposite(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -CS_::wideReportChangeResumable(Control& control, - const ShortIndex prong) +template +typename TA_::UP +CS_::wideReportChangeResumable(Control& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -6344,9 +6344,9 @@ CS_::wideReportChangeResumable(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -CS_::wideReportChangeUtilitarian(Control& control) { +template +typename TA_::UP +CS_::wideReportChangeUtilitarian(Control& control) { const UP l = lHalf.wideReportChangeUtilitarian(control); const UP r = rHalf.wideReportChangeUtilitarian(control); @@ -6356,12 +6356,12 @@ CS_::wideReportChangeUtilitarian(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -CS_::wideReportChangeRandom(Control& control, - Utility* const options, - const Rank* const ranks, - const Rank top) +template +typename TA_::Utility +CS_::wideReportChangeRandom(Control& control, + Utility* const options, + const Rank* const ranks, + const Rank top) { HFSM_ASSERT(options && ranks); @@ -6373,10 +6373,10 @@ CS_::wideReportChangeRandom(Control& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideEnterRequested(PlanControl& control, - const ShortIndex prong) +CS_::wideEnterRequested(PlanControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -6388,10 +6388,10 @@ CS_::wideEnterRequested(PlanControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideChangeToRequested(PlanControl& control, - const ShortIndex prong) +CS_::wideChangeToRequested(PlanControl& control, + const ShortIndex prong) { HFSM_ASSERT(prong != INVALID_SHORT_INDEX); @@ -6405,12 +6405,12 @@ CS_::wideChangeToRequested(PlanControl& control, #ifdef HFSM_ENABLE_STRUCTURE_REPORT -template +template void -CS_::wideGetNames(const LongIndex parent, - const RegionType /*region*/, - const ShortIndex depth, - StructureStateInfos& _stateInfos) const +CS_::wideGetNames(const LongIndex parent, + const RegionType /*region*/, + const ShortIndex depth, + StructureStateInfos& _stateInfos) const { lHalf.wideGetNames(parent, StructureStateInfo::COMPOSITE, depth, _stateInfos); rHalf.wideGetNames(parent, StructureStateInfo::COMPOSITE, depth, _stateInfos); @@ -6427,20 +6427,20 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template +template void -CS_::wideRegister(StateRegistry& stateRegistry, - const Parent parent) +CS_::wideRegister(StateRegistry& stateRegistry, + const Parent parent) { state.deepRegister(stateRegistry, Parent{parent.forkId, PRONG_INDEX}); } //------------------------------------------------------------------------------ -template +template bool -CS_::wideForwardEntryGuard(GuardControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideForwardEntryGuard(GuardControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -6449,10 +6449,10 @@ CS_::wideForwardEntryGuard(GuardControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -CS_::wideEntryGuard(GuardControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideEntryGuard(GuardControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -6461,10 +6461,10 @@ CS_::wideEntryGuard(GuardControl& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideEnter(PlanControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideEnter(PlanControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -6473,10 +6473,10 @@ CS_::wideEnter(PlanControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideReenter(PlanControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideReenter(PlanControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -6485,10 +6485,10 @@ CS_::wideReenter(PlanControl& control, //------------------------------------------------------------------------------ -template +template Status -CS_::wideUpdate(FullControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideUpdate(FullControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -6497,12 +6497,12 @@ CS_::wideUpdate(FullControl& control, //------------------------------------------------------------------------------ -template +template template Status -CS_::wideReact(FullControl& control, - const TEvent& event, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideReact(FullControl& control, + const TEvent& event, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -6511,10 +6511,10 @@ CS_::wideReact(FullControl& control, //------------------------------------------------------------------------------ -template +template bool -CS_::wideForwardExitGuard(GuardControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideForwardExitGuard(GuardControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -6523,10 +6523,10 @@ CS_::wideForwardExitGuard(GuardControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -CS_::wideExitGuard(GuardControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideExitGuard(GuardControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -6535,10 +6535,10 @@ CS_::wideExitGuard(GuardControl& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideExit(PlanControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideExit(PlanControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -6547,11 +6547,11 @@ CS_::wideExit(PlanControl& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideForwardActive(Control& control, - const RequestType request, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideForwardActive(Control& control, + const RequestType request, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -6560,11 +6560,11 @@ CS_::wideForwardActive(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideForwardRequest(Control& control, - const RequestType request, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideForwardRequest(Control& control, + const RequestType request, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -6573,18 +6573,18 @@ CS_::wideForwardRequest(Control& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideRequestChangeComposite(Control& control) { +CS_::wideRequestChangeComposite(Control& control) { state.deepRequestChange(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideRequestChangeResumable(Control& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideRequestChangeResumable(Control& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -6593,26 +6593,26 @@ CS_::wideRequestChangeResumable(Control& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideRequestRemain(StateRegistry& stateRegistry) { +CS_::wideRequestRemain(StateRegistry& stateRegistry) { state.deepRequestRemain(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideRequestRestart(StateRegistry& stateRegistry) { +CS_::wideRequestRestart(StateRegistry& stateRegistry) { state.deepRequestRestart(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideRequestResume(StateRegistry& stateRegistry, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideRequestResume(StateRegistry& stateRegistry, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -6621,18 +6621,18 @@ CS_::wideRequestResume(StateRegistry& stateRegistry, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -CS_::wideReportUtilize(Control& control) { +template +typename TA_::UP +CS_::wideReportUtilize(Control& control) { return state.deepReportUtilize(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Rank -CS_::wideReportRank(Control& control, - Rank* const ranks) +template +typename TA_::Rank +CS_::wideReportRank(Control& control, + Rank* const ranks) { HFSM_ASSERT(ranks); @@ -6643,12 +6643,12 @@ CS_::wideReportRank(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -CS_::wideReportRandomize(Control& control, - Utility* const options, - const Rank* const ranks, - const Rank top) +template +typename TA_::Utility +CS_::wideReportRandomize(Control& control, + Utility* const options, + const Rank* const ranks, + const Rank top) { HFSM_ASSERT(options && ranks); @@ -6660,18 +6660,18 @@ CS_::wideReportRandomize(Control& control, //------------------------------------------------------------------------------ -template -typename TA::UP -CS_::wideReportChangeComposite(Control& control) { +template +typename TA_::UP +CS_::wideReportChangeComposite(Control& control) { return state.deepReportChange(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -CS_::wideReportChangeResumable(Control& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +template +typename TA_::UP +CS_::wideReportChangeResumable(Control& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -6680,20 +6680,20 @@ CS_::wideReportChangeResumable(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -CS_::wideReportChangeUtilitarian(Control& control) { +template +typename TA_::UP +CS_::wideReportChangeUtilitarian(Control& control) { return state.deepReportChange(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -CS_::wideReportChangeRandom(Control& control, - Utility* const options, - const Rank* const ranks, - const Rank top) +template +typename TA_::Utility +CS_::wideReportChangeRandom(Control& control, + Utility* const options, + const Rank* const ranks, + const Rank top) { HFSM_ASSERT(options && ranks); @@ -6705,10 +6705,10 @@ CS_::wideReportChangeRandom(Control& control, //------------------------------------------------------------------------------ -template +template void -CS_::wideEnterRequested(PlanControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideEnterRequested(PlanControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -6717,10 +6717,10 @@ CS_::wideEnterRequested(PlanControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -CS_::wideChangeToRequested(PlanControl& control, - const ShortIndex HFSM_IF_ASSERT(prong)) +CS_::wideChangeToRequested(PlanControl& control, + const ShortIndex HFSM_IF_ASSERT(prong)) { HFSM_ASSERT(prong == PRONG_INDEX); @@ -6731,12 +6731,12 @@ CS_::wideChangeToRequested(PlanControl& control, #ifdef HFSM_ENABLE_STRUCTURE_REPORT -template +template void -CS_::wideGetNames(const LongIndex parent, - const RegionType /*region*/, - const ShortIndex depth, - StructureStateInfos& _stateInfos) const +CS_::wideGetNames(const LongIndex parent, + const RegionType /*region*/, + const ShortIndex depth, + StructureStateInfos& _stateInfos) const { state.deepGetNames(parent, StructureStateInfo::COMPOSITE, depth, _stateInfos); } @@ -6855,7 +6855,7 @@ struct C_ { #if HFSM_EXPLICIT_MEMBER_SPECIALIZATION - template + template HFSM_INLINE void deepRequestChange (Control& control, const ShortIndex = INVALID_SHORT_INDEX); template <> @@ -6893,7 +6893,7 @@ struct C_ { #if HFSM_EXPLICIT_MEMBER_SPECIALIZATION - template + template HFSM_INLINE UP deepReportChange (Control& control); template <> @@ -6956,13 +6956,13 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template +template ShortIndex -C_::resolveRandom(Control& control, - const Utility(& options)[Info::WIDTH], - const Utility sum, - const Rank(& ranks)[Info::WIDTH], - const Rank top) +C_::resolveRandom(Control& control, + const Utility(& options)[Info::WIDTH], + const Utility sum, + const Rank(& ranks)[Info::WIDTH], + const Rank top) { const Utility random = control._random.next(); HFSM_ASSERT(0.0f <= random && random < 1.0f); @@ -6988,10 +6988,10 @@ C_::resolveRandom(Control& control, //------------------------------------------------------------------------------ -template +template void -C_::deepRegister(StateRegistry& stateRegistry, - const Parent parent) +C_::deepRegister(StateRegistry& stateRegistry, + const Parent parent) { stateRegistry.compoParents[COMPO_INDEX] = parent; @@ -7001,9 +7001,9 @@ C_::deepRegister(StateRegistry& stateRegistry, //------------------------------------------------------------------------------ -template +template bool -C_::deepForwardEntryGuard(GuardControl& control) { +C_::deepForwardEntryGuard(GuardControl& control) { const ShortIndex active = compoActive (control); const ShortIndex requested = compoRequested(control); @@ -7019,9 +7019,9 @@ C_::deepForwardEntryGuard(GuardControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -C_::deepEntryGuard(GuardControl& control) { +C_::deepEntryGuard(GuardControl& control) { const ShortIndex requested = compoRequested(control); HFSM_ASSERT(requested != INVALID_SHORT_INDEX); @@ -7033,9 +7033,9 @@ C_::deepEntryGuard(GuardControl& control) { //------------------------------------------------------------------------------ -template +template void -C_::deepEnter(PlanControl& control) { +C_::deepEnter(PlanControl& control) { ShortIndex& active = compoActive (control); ShortIndex& resumable = compoResumable(control); ShortIndex& requested = compoRequested(control); @@ -7059,9 +7059,9 @@ C_::deepEnter(PlanControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepReenter(PlanControl& control) { +C_::deepReenter(PlanControl& control) { ShortIndex& active = compoActive (control); ShortIndex& resumable = compoResumable(control); ShortIndex& requested = compoRequested(control); @@ -7091,9 +7091,9 @@ C_::deepReenter(PlanControl& control) { //------------------------------------------------------------------------------ -template +template Status -C_::deepUpdate(FullControl& control) { +C_::deepUpdate(FullControl& control) { const ShortIndex active = compoActive(control); HFSM_ASSERT(active != INVALID_SHORT_INDEX); @@ -7119,11 +7119,11 @@ C_::deepUpdate(FullControl& control) { //------------------------------------------------------------------------------ -template +template template Status -C_::deepReact(FullControl& control, - const TEvent& event) +C_::deepReact(FullControl& control, + const TEvent& event) { const ShortIndex active = compoActive(control); HFSM_ASSERT(active != INVALID_SHORT_INDEX); @@ -7150,9 +7150,9 @@ C_::deepReact(FullControl& control, //------------------------------------------------------------------------------ -template +template bool -C_::deepForwardExitGuard(GuardControl& control) { +C_::deepForwardExitGuard(GuardControl& control) { const ShortIndex active = compoActive(control); HFSM_ASSERT(active != INVALID_SHORT_INDEX); @@ -7166,9 +7166,9 @@ C_::deepForwardExitGuard(GuardControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -C_::deepExitGuard(GuardControl& control) { +C_::deepExitGuard(GuardControl& control) { const ShortIndex active = compoActive(control); HFSM_ASSERT(active != INVALID_SHORT_INDEX); @@ -7180,9 +7180,9 @@ C_::deepExitGuard(GuardControl& control) { //------------------------------------------------------------------------------ -template +template void -C_::deepExit(PlanControl& control) { +C_::deepExit(PlanControl& control) { ShortIndex& active = compoActive (control); ShortIndex& resumable = compoResumable(control); @@ -7200,10 +7200,10 @@ C_::deepExit(PlanControl& control) { //------------------------------------------------------------------------------ -template +template void -C_::deepForwardActive(Control& control, - const RequestType request) +C_::deepForwardActive(Control& control, + const RequestType request) { HFSM_ASSERT(control._stateRegistry.isActive(HEAD_ID)); @@ -7219,10 +7219,10 @@ C_::deepForwardActive(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepForwardRequest(Control& control, - const RequestType request) +C_::deepForwardRequest(Control& control, + const RequestType request) { const ShortIndex requested = compoRequested(control); @@ -7234,10 +7234,10 @@ C_::deepForwardRequest(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequest(Control& control, - const RequestType request) +C_::deepRequest(Control& control, + const RequestType request) { switch (request) { case Request::REMAIN: @@ -7273,9 +7273,9 @@ C_::deepRequest(Control& control, #if !HFSM_EXPLICIT_MEMBER_SPECIALIZATION -template +template void -C_::deepRequestChange(Control& control) +C_::deepRequestChange(Control& control) { switch (STRATEGY) { case Strategy::Composite: @@ -7303,9 +7303,9 @@ C_::deepRequestChange(Control& control) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequestChangeComposite(Control& control) { +C_::deepRequestChangeComposite(Control& control) { ShortIndex& requested = compoRequested(control); requested = 0; @@ -7315,9 +7315,9 @@ C_::deepRequestChangeComposite(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequestChangeResumable(Control& control) { +C_::deepRequestChangeResumable(Control& control) { const ShortIndex resumable = compoResumable(control); ShortIndex& requested = compoRequested(control); @@ -7329,9 +7329,9 @@ C_::deepRequestChangeResumable(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequestChangeUtilitarian(Control& control) { +C_::deepRequestChangeUtilitarian(Control& control) { const UP s = _subStates.wideReportChangeUtilitarian(control); HFSM_ASSERT(s.prong != INVALID_SHORT_INDEX); @@ -7343,9 +7343,9 @@ C_::deepRequestChangeUtilitarian(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequestChangeRandom(Control& control) { +C_::deepRequestChangeRandom(Control& control) { Rank ranks[Info::WIDTH]; Rank top = _subStates.wideReportRank(control, ranks); @@ -7359,9 +7359,9 @@ C_::deepRequestChangeRandom(Control& control) { //------------------------------------------------------------------------------ -template +template void -C_::deepRequestRemain(StateRegistry& stateRegistry) { +C_::deepRequestRemain(StateRegistry& stateRegistry) { const ShortIndex active = compoActive (stateRegistry); ShortIndex& requested = compoRequested(stateRegistry); @@ -7373,9 +7373,9 @@ C_::deepRequestRemain(StateRegistry& stateRegistry) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequestRestart(StateRegistry& stateRegistry) { +C_::deepRequestRestart(StateRegistry& stateRegistry) { ShortIndex& requested = compoRequested(stateRegistry); requested = 0; @@ -7385,9 +7385,9 @@ C_::deepRequestRestart(StateRegistry& stateRegistry) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequestResume(StateRegistry& stateRegistry) { +C_::deepRequestResume(StateRegistry& stateRegistry) { const ShortIndex resumable = compoResumable(stateRegistry); ShortIndex& requested = compoRequested(stateRegistry); @@ -7399,9 +7399,9 @@ C_::deepRequestResume(StateRegistry& stateRegistry) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequestUtilize(Control& control) { +C_::deepRequestUtilize(Control& control) { const UP s = _subStates.wideReportUtilize(control); ShortIndex& requested = compoRequested(control); @@ -7412,9 +7412,9 @@ C_::deepRequestUtilize(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepRequestRandomize(Control& control) { +C_::deepRequestRandomize(Control& control) { Rank ranks[Info::WIDTH]; Rank top = _subStates.wideReportRank(control, ranks); @@ -7430,9 +7430,9 @@ C_::deepRequestRandomize(Control& control) { #if !HFSM_EXPLICIT_MEMBER_SPECIALIZATION -template -typename TA::UP -C_::deepReportChange(Control& control) { +template +typename TA_::UP +C_::deepReportChange(Control& control) { switch (STRATEGY) { case Strategy::Composite: return deepReportChangeComposite (control); @@ -7456,9 +7456,9 @@ C_::deepReportChange(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -C_::deepReportChangeComposite(Control& control) { +template +typename TA_::UP +C_::deepReportChangeComposite(Control& control) { ShortIndex& requested = compoRequested(control); requested = 0; @@ -7473,9 +7473,9 @@ C_::deepReportChangeComposite(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -C_::deepReportChangeResumable(Control& control) { +template +typename TA_::UP +C_::deepReportChangeResumable(Control& control) { const ShortIndex resumable = compoResumable(control); ShortIndex& requested = compoRequested(control); @@ -7493,9 +7493,9 @@ C_::deepReportChangeResumable(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -C_::deepReportChangeUtilitarian(Control& control) { +template +typename TA_::UP +C_::deepReportChangeUtilitarian(Control& control) { const UP h = _headState.deepReportChange(control); const UP s = _subStates.wideReportChangeUtilitarian(control); @@ -7512,9 +7512,9 @@ C_::deepReportChangeUtilitarian(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -C_::deepReportChangeRandom(Control& control) { +template +typename TA_::UP +C_::deepReportChangeRandom(Control& control) { const UP h = _headState.deepReportChange(control); Rank ranks[Info::WIDTH]; @@ -7535,9 +7535,9 @@ C_::deepReportChangeRandom(Control& control) { //------------------------------------------------------------------------------ -template -typename TA::UP -C_::deepReportUtilize(Control& control) { +template +typename TA_::UP +C_::deepReportUtilize(Control& control) { const UP h = _headState.deepReportUtilize(control); const UP s = _subStates.wideReportUtilize(control); @@ -7554,17 +7554,17 @@ C_::deepReportUtilize(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Rank -C_::deepReportRank(Control& control) { +template +typename TA_::Rank +C_::deepReportRank(Control& control) { return _headState.wrapRank(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -C_::deepReportRandomize(Control& control) { +template +typename TA_::Utility +C_::deepReportRandomize(Control& control) { const Utility h = _headState.wrapUtility(control); Rank ranks[Info::WIDTH]; @@ -7582,9 +7582,9 @@ C_::deepReportRandomize(Control& control) { //------------------------------------------------------------------------------ -template +template void -C_::deepEnterRequested(PlanControl& control) { +C_::deepEnterRequested(PlanControl& control) { ShortIndex& active = compoActive (control); ShortIndex& requested = compoRequested(control); @@ -7600,9 +7600,9 @@ C_::deepEnterRequested(PlanControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -C_::deepChangeToRequested(PlanControl& control) { +C_::deepChangeToRequested(PlanControl& control) { ShortIndex& active = compoActive (control); ShortIndex& resumable = compoResumable(control); ShortIndex& requested = compoRequested(control); @@ -7636,12 +7636,12 @@ C_::deepChangeToRequested(PlanControl& control) { #ifdef HFSM_ENABLE_STRUCTURE_REPORT -template +template void -C_::deepGetNames(const LongIndex parent, - const RegionType region, - const ShortIndex depth, - StructureStateInfos& _stateInfos) const +C_::deepGetNames(const LongIndex parent, + const RegionType region, + const ShortIndex depth, + StructureStateInfos& _stateInfos) const { _headState.deepGetNames(parent, region, depth, _stateInfos); _subStates.wideGetNames(_stateInfos.count() - 1, StructureStateInfo::COMPOSITE, depth + 1, _stateInfos); @@ -7889,10 +7889,10 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template +template void -OS_::wideRegister(StateRegistry& stateRegistry, - const ForkID forkId) +OS_::wideRegister(StateRegistry& stateRegistry, + const ForkID forkId) { initial .deepRegister(stateRegistry, Parent{forkId, PRONG_INDEX}); remaining.wideRegister(stateRegistry, forkId); @@ -7900,10 +7900,10 @@ OS_::wideRegister(StateRegistry& stateRegistry, //------------------------------------------------------------------------------ -template +template bool -OS_::wideForwardEntryGuard(GuardControl& control, - const ProngConstBits prongs) +OS_::wideForwardEntryGuard(GuardControl& control, + const ProngConstBits prongs) { const bool i = prongs.get(PRONG_INDEX) ? initial .deepForwardEntryGuard(control) : false; @@ -7915,9 +7915,9 @@ OS_::wideForwardEntryGuard(GuardControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -OS_::wideForwardEntryGuard(GuardControl& control) { +OS_::wideForwardEntryGuard(GuardControl& control) { const bool i = initial .deepForwardEntryGuard(control); const bool r = remaining.wideForwardEntryGuard(control); @@ -7926,9 +7926,9 @@ OS_::wideForwardEntryGuard(GuardControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -OS_::wideEntryGuard(GuardControl& control) { +OS_::wideEntryGuard(GuardControl& control) { const bool i = initial .deepEntryGuard(control); const bool r = remaining.wideEntryGuard(control); @@ -7937,37 +7937,37 @@ OS_::wideEntryGuard(GuardControl& control) { //------------------------------------------------------------------------------ -template +template void -OS_::wideEnter(PlanControl& control) { +OS_::wideEnter(PlanControl& control) { initial .deepEnter(control); remaining.wideEnter(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideReenter(PlanControl& control) { +OS_::wideReenter(PlanControl& control) { initial .deepReenter(control); remaining.wideReenter(control); } //------------------------------------------------------------------------------ -template +template Status -OS_::wideUpdate(FullControl& control) { +OS_::wideUpdate(FullControl& control) { const auto status = initial .deepUpdate(control); return combine(status, remaining.wideUpdate(control)); } //------------------------------------------------------------------------------ -template +template template Status -OS_::wideReact(FullControl& control, +OS_::wideReact(FullControl& control, const TEvent& event) { const auto status = initial .deepReact(control, event); @@ -7976,10 +7976,10 @@ OS_::wideReact(FullControl& control, //------------------------------------------------------------------------------ -template +template bool -OS_::wideForwardExitGuard(GuardControl& control, - const ProngConstBits prongs) +OS_::wideForwardExitGuard(GuardControl& control, + const ProngConstBits prongs) { const bool i = prongs.get(PRONG_INDEX) ? initial .deepForwardExitGuard(control) : false; @@ -7991,9 +7991,9 @@ OS_::wideForwardExitGuard(GuardControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -OS_::wideForwardExitGuard(GuardControl& control) { +OS_::wideForwardExitGuard(GuardControl& control) { const bool i = initial .deepForwardExitGuard(control); const bool r = remaining.wideForwardExitGuard(control); @@ -8002,9 +8002,9 @@ OS_::wideForwardExitGuard(GuardControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -OS_::wideExitGuard(GuardControl& control) { +OS_::wideExitGuard(GuardControl& control) { const bool i = initial .deepExitGuard(control); const bool r = remaining.wideExitGuard(control); @@ -8013,20 +8013,20 @@ OS_::wideExitGuard(GuardControl& control) { //------------------------------------------------------------------------------ -template +template void -OS_::wideExit(PlanControl& control) { +OS_::wideExit(PlanControl& control) { initial .deepExit(control); remaining.wideExit(control); } //------------------------------------------------------------------------------ -template +template void -OS_::wideForwardActive(Control& control, - const RequestType request, - const ProngConstBits prongs) +OS_::wideForwardActive(Control& control, + const RequestType request, + const ProngConstBits prongs) { const RequestType local = prongs.get(PRONG_INDEX) ? request : Request::REMAIN; @@ -8037,11 +8037,11 @@ OS_::wideForwardActive(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideForwardRequest(Control& control, - const RequestType request, - const ProngConstBits prongs) +OS_::wideForwardRequest(Control& control, + const RequestType request, + const ProngConstBits prongs) { const RequestType local = prongs.get(PRONG_INDEX) ? request : Request::REMAIN; @@ -8052,63 +8052,63 @@ OS_::wideForwardRequest(Control& control, //------------------------------------------------------------------------------ -template +template void -OS_::wideRequestChange(Control& control) { +OS_::wideRequestChange(Control& control) { initial .deepRequestChange(control); remaining.wideRequestChange(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestRemain(StateRegistry& stateRegistry) { +OS_::wideRequestRemain(StateRegistry& stateRegistry) { initial .deepRequestRemain(stateRegistry); remaining.wideRequestRemain(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestRestart(StateRegistry& stateRegistry) { +OS_::wideRequestRestart(StateRegistry& stateRegistry) { initial .deepRequestRestart(stateRegistry); remaining.wideRequestRestart(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestResume(StateRegistry& stateRegistry) { +OS_::wideRequestResume(StateRegistry& stateRegistry) { initial .deepRequestResume(stateRegistry); remaining.wideRequestResume(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestUtilize(Control& control) { +OS_::wideRequestUtilize(Control& control) { initial .deepRequestUtilize(control); remaining.wideRequestUtilize(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestRandomize(Control& control) { +OS_::wideRequestRandomize(Control& control) { initial .deepRequestRandomize(control); remaining.wideRequestRandomize(control); } //------------------------------------------------------------------------------ -template -typename TA::Utility -OS_::wideReportChange(Control& control) { +template +typename TA_::Utility +OS_::wideReportChange(Control& control) { const UP i = initial .deepReportChange(control); const Utility r = remaining.wideReportChange(control); @@ -8117,9 +8117,9 @@ OS_::wideReportChange(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -OS_::wideReportUtilize(Control& control) { +template +typename TA_::Utility +OS_::wideReportUtilize(Control& control) { const UP i = initial .deepReportUtilize(control); const Utility r = remaining.wideReportUtilize(control); @@ -8128,9 +8128,9 @@ OS_::wideReportUtilize(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -OS_::wideReportRandomize(Control& control) { +template +typename TA_::Utility +OS_::wideReportRandomize(Control& control) { const Utility i = initial .deepReportRandomize(control); const Utility r = remaining.wideReportRandomize(control); @@ -8139,18 +8139,18 @@ OS_::wideReportRandomize(Control& control) { //------------------------------------------------------------------------------ -template +template void -OS_::wideEnterRequested(PlanControl& control) { +OS_::wideEnterRequested(PlanControl& control) { initial .deepEnterRequested(control); remaining.wideEnterRequested(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideChangeToRequested(PlanControl& control) { +OS_::wideChangeToRequested(PlanControl& control) { initial .deepChangeToRequested(control); remaining.wideChangeToRequested(control); } @@ -8159,11 +8159,11 @@ OS_::wideChangeToRequested(PlanControl& control) { #ifdef HFSM_ENABLE_STRUCTURE_REPORT -template +template void -OS_::wideGetNames(const LongIndex parent, - const ShortIndex depth, - StructureStateInfos& _stateInfos) const +OS_::wideGetNames(const LongIndex parent, + const ShortIndex depth, + StructureStateInfos& _stateInfos) const { initial .deepGetNames(parent, StructureStateInfo::ORTHOGONAL, depth, _stateInfos); remaining.wideGetNames(parent, depth, _stateInfos); @@ -8180,20 +8180,20 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template +template void -OS_::wideRegister(StateRegistry& stateRegistry, - const ForkID forkId) +OS_::wideRegister(StateRegistry& stateRegistry, + const ForkID forkId) { initial.deepRegister(stateRegistry, Parent{forkId, PRONG_INDEX}); } //------------------------------------------------------------------------------ -template +template bool -OS_::wideForwardEntryGuard(GuardControl& control, - const ProngConstBits prongs) +OS_::wideForwardEntryGuard(GuardControl& control, + const ProngConstBits prongs) { return prongs.get(PRONG_INDEX) ? initial.deepForwardEntryGuard(control) : false; @@ -8201,61 +8201,61 @@ OS_::wideForwardEntryGuard(GuardControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -OS_::wideForwardEntryGuard(GuardControl& control) { +OS_::wideForwardEntryGuard(GuardControl& control) { return initial.deepForwardEntryGuard(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -OS_::wideEntryGuard(GuardControl& control) { +OS_::wideEntryGuard(GuardControl& control) { return initial.deepEntryGuard(control); } //------------------------------------------------------------------------------ -template +template void -OS_::wideEnter(PlanControl& control) { +OS_::wideEnter(PlanControl& control) { initial.deepEnter(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideReenter(PlanControl& control) { +OS_::wideReenter(PlanControl& control) { initial.deepReenter(control); } //------------------------------------------------------------------------------ -template +template Status -OS_::wideUpdate(FullControl& control) { +OS_::wideUpdate(FullControl& control) { return initial.deepUpdate(control); } //------------------------------------------------------------------------------ -template +template template Status -OS_::wideReact(FullControl& control, - const TEvent& event) +OS_::wideReact(FullControl& control, + const TEvent& event) { return initial.deepReact(control, event); } //------------------------------------------------------------------------------ -template +template bool -OS_::wideForwardExitGuard(GuardControl& control, - const ProngConstBits prongs) +OS_::wideForwardExitGuard(GuardControl& control, + const ProngConstBits prongs) { return prongs.get(PRONG_INDEX) ? initial.deepForwardExitGuard(control) : false; @@ -8263,35 +8263,35 @@ OS_::wideForwardExitGuard(GuardControl& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -OS_::wideForwardExitGuard(GuardControl& control) { +OS_::wideForwardExitGuard(GuardControl& control) { return initial.deepForwardExitGuard(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -OS_::wideExitGuard(GuardControl& control) { +OS_::wideExitGuard(GuardControl& control) { return initial.deepExitGuard(control); } //------------------------------------------------------------------------------ -template +template void -OS_::wideExit(PlanControl& control) { +OS_::wideExit(PlanControl& control) { initial.deepExit(control); } //------------------------------------------------------------------------------ -template +template void -OS_::wideForwardActive(Control& control, - const RequestType request, - const ProngConstBits prongs) +OS_::wideForwardActive(Control& control, + const RequestType request, + const ProngConstBits prongs) { const RequestType local = prongs.get(PRONG_INDEX) ? request : Request::REMAIN; @@ -8301,11 +8301,11 @@ OS_::wideForwardActive(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideForwardRequest(Control& control, - const RequestType request, - const ProngConstBits prongs) +OS_::wideForwardRequest(Control& control, + const RequestType request, + const ProngConstBits prongs) { const RequestType local = prongs.get(PRONG_INDEX) ? request : Request::REMAIN; @@ -8315,57 +8315,57 @@ OS_::wideForwardRequest(Control& control, //------------------------------------------------------------------------------ -template +template void -OS_::wideRequestChange(Control& control) { +OS_::wideRequestChange(Control& control) { initial.deepRequestChange(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestRemain(StateRegistry& stateRegistry) { +OS_::wideRequestRemain(StateRegistry& stateRegistry) { initial.deepRequestRemain(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestRestart(StateRegistry& stateRegistry) { +OS_::wideRequestRestart(StateRegistry& stateRegistry) { initial.deepRequestRestart(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestResume(StateRegistry& stateRegistry) { +OS_::wideRequestResume(StateRegistry& stateRegistry) { initial.deepRequestResume(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestUtilize(Control& control) { +OS_::wideRequestUtilize(Control& control) { initial.deepRequestUtilize(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideRequestRandomize(Control& control) { +OS_::wideRequestRandomize(Control& control) { initial.deepRequestRandomize(control); } //------------------------------------------------------------------------------ -template -typename TA::Utility -OS_::wideReportChange(Control& control) { +template +typename TA_::Utility +OS_::wideReportChange(Control& control) { const UP i = initial.deepReportChange(control); return i.utility; @@ -8373,9 +8373,9 @@ OS_::wideReportChange(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -OS_::wideReportUtilize(Control& control) { +template +typename TA_::Utility +OS_::wideReportUtilize(Control& control) { const UP i = initial.deepReportUtilize(control); return i.utility; @@ -8383,9 +8383,9 @@ OS_::wideReportUtilize(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -OS_::wideReportRandomize(Control& control) { +template +typename TA_::Utility +OS_::wideReportRandomize(Control& control) { const Utility i = initial.deepReportRandomize(control); return i; @@ -8393,17 +8393,17 @@ OS_::wideReportRandomize(Control& control) { //------------------------------------------------------------------------------ -template +template void -OS_::wideEnterRequested(PlanControl& control) { +OS_::wideEnterRequested(PlanControl& control) { initial.deepEnterRequested(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -OS_::wideChangeToRequested(PlanControl& control) { +OS_::wideChangeToRequested(PlanControl& control) { initial.deepChangeToRequested(control); } @@ -8411,11 +8411,11 @@ OS_::wideChangeToRequested(PlanControl& control) { #ifdef HFSM_ENABLE_STRUCTURE_REPORT -template +template void -OS_::wideGetNames(const LongIndex parent, - const ShortIndex depth, - StructureStateInfos& _stateInfos) const +OS_::wideGetNames(const LongIndex parent, + const ShortIndex depth, + StructureStateInfos& _stateInfos) const { initial.deepGetNames(parent, StructureStateInfo::ORTHOGONAL, depth, _stateInfos); } @@ -8569,10 +8569,10 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template +template void -O_::deepRegister(StateRegistry& stateRegistry, - const Parent parent) +O_::deepRegister(StateRegistry& stateRegistry, + const Parent parent) { stateRegistry.orthoParents[ORTHO_INDEX] = parent; stateRegistry.orthoUnits[ORTHO_INDEX] = Units{ORTHO_UNIT, WIDTH}; @@ -8583,9 +8583,9 @@ O_::deepRegister(StateRegistry& stateRegistry, //------------------------------------------------------------------------------ -template +template bool -O_::deepForwardEntryGuard(GuardControl& control) { +O_::deepForwardEntryGuard(GuardControl& control) { const ProngConstBits requested = orthoRequested(static_cast(control)); ScopedRegion region{control, REGION_ID, HEAD_ID, REGION_SIZE}; @@ -8598,9 +8598,9 @@ O_::deepForwardEntryGuard(GuardControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -O_::deepEntryGuard(GuardControl& control) { +O_::deepEntryGuard(GuardControl& control) { ScopedRegion region{control, REGION_ID, HEAD_ID, REGION_SIZE}; return _headState.deepEntryGuard(control) || @@ -8609,9 +8609,9 @@ O_::deepEntryGuard(GuardControl& control) { //------------------------------------------------------------------------------ -template +template void -O_::deepEnter(PlanControl& control) { +O_::deepEnter(PlanControl& control) { ProngBits requested = orthoRequested(control); requested.clear(); @@ -8623,9 +8623,9 @@ O_::deepEnter(PlanControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepReenter(PlanControl& control) { +O_::deepReenter(PlanControl& control) { ProngBits requested = orthoRequested(control); requested.clear(); @@ -8637,9 +8637,9 @@ O_::deepReenter(PlanControl& control) { //------------------------------------------------------------------------------ -template +template Status -O_::deepUpdate(FullControl& control) { +O_::deepUpdate(FullControl& control) { ScopedRegion outer{control, REGION_ID, HEAD_ID, REGION_SIZE}; if (const auto headStatus = _headState.deepUpdate(control)) { @@ -8662,11 +8662,11 @@ O_::deepUpdate(FullControl& control) { //------------------------------------------------------------------------------ -template +template template Status -O_::deepReact(FullControl& control, - const TEvent& event) +O_::deepReact(FullControl& control, + const TEvent& event) { ScopedRegion outer{control, REGION_ID, HEAD_ID, REGION_SIZE}; @@ -8690,9 +8690,9 @@ O_::deepReact(FullControl& control, //------------------------------------------------------------------------------ -template +template bool -O_::deepForwardExitGuard(GuardControl& control) { +O_::deepForwardExitGuard(GuardControl& control) { const ProngConstBits requested = orthoRequested(static_cast(control)); ScopedRegion region{control, REGION_ID, HEAD_ID, REGION_SIZE}; @@ -8705,9 +8705,9 @@ O_::deepForwardExitGuard(GuardControl& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -O_::deepExitGuard(GuardControl& control) { +O_::deepExitGuard(GuardControl& control) { ScopedRegion region{control, REGION_ID, HEAD_ID, REGION_SIZE}; return _headState.deepExitGuard(control) || @@ -8716,19 +8716,19 @@ O_::deepExitGuard(GuardControl& control) { //------------------------------------------------------------------------------ -template +template void -O_::deepExit(PlanControl& control) { +O_::deepExit(PlanControl& control) { _subStates.wideExit(control); _headState.deepExit(control); } //------------------------------------------------------------------------------ -template +template void -O_::deepForwardActive(Control& control, - const RequestType request) +O_::deepForwardActive(Control& control, + const RequestType request) { HFSM_ASSERT(control._stateRegistry.isActive(HEAD_ID)); @@ -8740,10 +8740,10 @@ O_::deepForwardActive(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepForwardRequest(Control& control, - const RequestType request) +O_::deepForwardRequest(Control& control, + const RequestType request) { const ProngConstBits requested = orthoRequested(static_cast(control)); @@ -8755,10 +8755,10 @@ O_::deepForwardRequest(Control& control, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepRequest(Control& control, - const RequestType request) +O_::deepRequest(Control& control, + const RequestType request) { switch (request) { case Request::REMAIN: @@ -8792,57 +8792,57 @@ O_::deepRequest(Control& control, //------------------------------------------------------------------------------ -template +template void -O_::deepRequestChange(Control& control) { +O_::deepRequestChange(Control& control) { _subStates.wideRequestChange(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepRequestRemain(StateRegistry& stateRegistry) { +O_::deepRequestRemain(StateRegistry& stateRegistry) { _subStates.wideRequestRemain(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepRequestRestart(StateRegistry& stateRegistry) { +O_::deepRequestRestart(StateRegistry& stateRegistry) { _subStates.wideRequestRestart(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepRequestResume(StateRegistry& stateRegistry) { +O_::deepRequestResume(StateRegistry& stateRegistry) { _subStates.wideRequestResume(stateRegistry); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepRequestUtilize(Control& control) { +O_::deepRequestUtilize(Control& control) { _subStates.wideRequestUtilize(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepRequestRandomize(Control& control) { +O_::deepRequestRandomize(Control& control) { _subStates.wideRequestRandomize(control); } //------------------------------------------------------------------------------ -template -typename TA::UP -O_::deepReportChange(Control& control) { +template +typename TA_::UP +O_::deepReportChange(Control& control) { const UP h = _headState.deepReportChange(control); const Utility s = _subStates.wideReportChange(control); @@ -8858,9 +8858,9 @@ O_::deepReportChange(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::UP -O_::deepReportUtilize(Control& control) { +template +typename TA_::UP +O_::deepReportUtilize(Control& control) { const UP h = _headState.deepReportUtilize(control); const Utility s = _subStates.wideReportUtilize(control); @@ -8876,17 +8876,17 @@ O_::deepReportUtilize(Control& control) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Rank -O_::deepReportRank(Control& control) { +template +typename TA_::Rank +O_::deepReportRank(Control& control) { return _headState.wrapRank(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -typename TA::Utility -O_::deepReportRandomize(Control& control) { +template +typename TA_::Utility +O_::deepReportRandomize(Control& control) { const Utility h = _headState.wrapUtility(control); const Utility s = _subStates.wideReportRandomize(control); @@ -8899,18 +8899,18 @@ O_::deepReportRandomize(Control& control) { //------------------------------------------------------------------------------ -template +template void -O_::deepEnterRequested(PlanControl& control) { +O_::deepEnterRequested(PlanControl& control) { _headState.deepEnter (control); _subStates.wideEnterRequested(control); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -O_::deepChangeToRequested(PlanControl& control) { +O_::deepChangeToRequested(PlanControl& control) { _subStates.wideChangeToRequested(control); } @@ -8918,12 +8918,12 @@ O_::deepChangeToRequested(PlanControl& control) { #ifdef HFSM_ENABLE_STRUCTURE_REPORT -template +template void -O_::deepGetNames(const LongIndex parent, - const RegionType region, - const ShortIndex depth, - StructureStateInfos& _stateInfos) const +O_::deepGetNames(const LongIndex parent, + const RegionType region, + const ShortIndex depth, + StructureStateInfos& _stateInfos) const { _headState.deepGetNames(parent, region, depth, _stateInfos); _subStates.wideGetNames(_stateInfos.count() - 1, depth + 1, _stateInfos); @@ -9194,18 +9194,18 @@ class RW_ final // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -class RW_ <::hfsm2::ConfigT<::hfsm2::EmptyContext, TN, TU, TR, TP, NS, NT>, TApex> final - : public R_<::hfsm2::ConfigT<::hfsm2::EmptyContext, TN, TU, TR, TP, NS, NT>, TApex> +class RW_ <::hfsm2::ConfigT<::hfsm2::EmptyContext, TN_, TU_, TR_, TP_, NS, NT>, TApex> final + : public R_<::hfsm2::ConfigT<::hfsm2::EmptyContext, TN_, TU_, TR_, TP_, NS, NT>, TApex> , ::hfsm2::EmptyContext { - using Config_ = ::hfsm2::ConfigT<::hfsm2::EmptyContext, TN, TU, TR, TP, NS, NT>; + using Config_ = ::hfsm2::ConfigT<::hfsm2::EmptyContext, TN_, TU_, TR_, TP_, NS, NT>; using Context = typename Config_::Context; using Random_ = typename Config_::Random_; using Logger = typename Config_::Logger; @@ -9223,18 +9223,18 @@ class RW_ <::hfsm2::ConfigT<::hfsm2::EmptyContext, TN, TU, TR, TP, NS, NT>, T // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -class RW_ <::hfsm2::ConfigT, TP, NS, NT>, TApex> final - : public R_<::hfsm2::ConfigT, TP, NS, NT>, TApex> - , ::hfsm2::RandomT +class RW_ <::hfsm2::ConfigT, TP_, NS, NT>, TApex> final + : public R_<::hfsm2::ConfigT, TP_, NS, NT>, TApex> + , ::hfsm2::RandomT { - using Config_ = ::hfsm2::ConfigT, TP, NS, NT>; + using Config_ = ::hfsm2::ConfigT, TP_, NS, NT>; using Context = typename Config_::Context; using Random_ = typename Config_::Random_; using Logger = typename Config_::Logger; @@ -9253,18 +9253,18 @@ class RW_ <::hfsm2::ConfigT, TP, NS, NT>, TA // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -class RW_ <::hfsm2::ConfigT<::hfsm2::EmptyContext, TN, TU, ::hfsm2::RandomT, TP, NS, NT>, TApex> final - : public R_<::hfsm2::ConfigT<::hfsm2::EmptyContext, TN, TU, ::hfsm2::RandomT, TP, NS, NT>, TApex> +class RW_ <::hfsm2::ConfigT<::hfsm2::EmptyContext, TN_, TU_, ::hfsm2::RandomT, TP_, NS, NT>, TApex> final + : public R_<::hfsm2::ConfigT<::hfsm2::EmptyContext, TN_, TU_, ::hfsm2::RandomT, TP_, NS, NT>, TApex> , ::hfsm2::EmptyContext - , ::hfsm2::RandomT + , ::hfsm2::RandomT { - using Config_ = ::hfsm2::ConfigT<::hfsm2::EmptyContext, TN, TU, ::hfsm2::RandomT, TP, NS, NT>; + using Config_ = ::hfsm2::ConfigT<::hfsm2::EmptyContext, TN_, TU_, ::hfsm2::RandomT, TP_, NS, NT>; using Context = typename Config_::Context; using Random_ = typename Config_::Random_; using Logger = typename Config_::Logger; @@ -9290,10 +9290,10 @@ namespace detail { //////////////////////////////////////////////////////////////////////////////// -template -R_::R_(Context& context, - Random_& random - HFSM_IF_LOGGER(, Logger* const logger)) +template +R_::R_(Context& context, + Random_& random + HFSM_IF_LOGGER(, Logger* const logger)) : _context{context} , _random{random} HFSM_IF_LOGGER(, _logger{logger}) @@ -9307,8 +9307,8 @@ R_::R_(Context& context, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -R_::~R_() { +template +R_::~R_() { PlanControl control{_context, _random, _stateRegistry, @@ -9321,9 +9321,9 @@ R_::~R_() { //------------------------------------------------------------------------------ -template +template void -R_::update() { +R_::update() { FullControl control(_context, _random, _stateRegistry, @@ -9342,10 +9342,10 @@ R_::update() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template template void -R_::react(const TEvent& event) { +R_::react(const TEvent& event) { FullControl control{_context, _random, _stateRegistry, @@ -9364,9 +9364,9 @@ R_::react(const TEvent& event) { //------------------------------------------------------------------------------ -template +template void -R_::changeTo(const StateID stateId) { +R_::changeTo(const StateID stateId) { const Request request{Request::Type::CHANGE, stateId}; _requests << request; @@ -9375,10 +9375,10 @@ R_::changeTo(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::changeTo(const StateID stateId, - const Payload& payload) +R_::changeTo(const StateID stateId, + const Payload& payload) { const Request request{Request::Type::CHANGE, stateId, payload}; _requests << request; @@ -9388,9 +9388,9 @@ R_::changeTo(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -R_::restart(const StateID stateId) { +R_::restart(const StateID stateId) { const Request request{Request::Type::RESTART, stateId}; _requests << request; @@ -9399,10 +9399,10 @@ R_::restart(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::restart(const StateID stateId, - const Payload& payload) +R_::restart(const StateID stateId, + const Payload& payload) { const Request request{Request::Type::RESTART, stateId, payload}; _requests << request; @@ -9412,9 +9412,9 @@ R_::restart(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -R_::resume(const StateID stateId) { +R_::resume(const StateID stateId) { const Request request{Request::Type::RESUME, stateId}; _requests << request; @@ -9423,10 +9423,10 @@ R_::resume(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::resume(const StateID stateId, - const Payload& payload) +R_::resume(const StateID stateId, + const Payload& payload) { const Request request{Request::Type::RESUME, stateId, payload}; _requests << request; @@ -9436,9 +9436,9 @@ R_::resume(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -R_::utilize(const StateID stateId) { +R_::utilize(const StateID stateId) { const Request request{Request::Type::UTILIZE, stateId}; _requests << request; @@ -9447,10 +9447,10 @@ R_::utilize(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::utilize(const StateID stateId, - const Payload& payload) +R_::utilize(const StateID stateId, + const Payload& payload) { const Request request{Request::Type::UTILIZE, stateId, payload}; _requests << request; @@ -9460,9 +9460,9 @@ R_::utilize(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -R_::randomize(const StateID stateId) { +R_::randomize(const StateID stateId) { const Request request{Request::Type::RANDOMIZE, stateId}; _requests << request; @@ -9471,10 +9471,10 @@ R_::randomize(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::randomize(const StateID stateId, - const Payload& payload) +R_::randomize(const StateID stateId, + const Payload& payload) { const Request request{Request::Type::RANDOMIZE, stateId, payload}; _requests << request; @@ -9484,9 +9484,9 @@ R_::randomize(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -R_::schedule(const StateID stateId) { +R_::schedule(const StateID stateId) { const Request request{Request::Type::SCHEDULE, stateId}; _requests << request; @@ -9495,10 +9495,10 @@ R_::schedule(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::schedule(const StateID stateId, - const Payload& payload) +R_::schedule(const StateID stateId, + const Payload& payload) { const Request request{Request::Type::SCHEDULE, stateId, payload}; _requests << request; @@ -9508,9 +9508,9 @@ R_::schedule(const StateID stateId, //------------------------------------------------------------------------------ -template +template void -R_::resetStateData(const StateID stateId) { +R_::resetStateData(const StateID stateId) { HFSM_ASSERT(stateId < Payloads::CAPACITY); if (stateId < Payloads::CAPACITY) @@ -9519,10 +9519,10 @@ R_::resetStateData(const StateID stateId) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::setStateData(const StateID stateId, - const Payload& payload) +R_::setStateData(const StateID stateId, + const Payload& payload) { HFSM_ASSERT(stateId < Payloads::CAPACITY); @@ -9534,9 +9534,9 @@ R_::setStateData(const StateID stateId, // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -R_::isStateDataSet(const StateID stateId) const { +R_::isStateDataSet(const StateID stateId) const { HFSM_ASSERT(stateId < Payloads::CAPACITY); return stateId < Payloads::CAPACITY ? @@ -9545,9 +9545,9 @@ R_::isStateDataSet(const StateID stateId) const { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template -const typename R_::Payload* -R_::getStateData(const StateID stateId) const { +template +const typename R_::Payload* +R_::getStateData(const StateID stateId) const { HFSM_ASSERT(stateId < Payloads::CAPACITY); return stateId < Payloads::CAPACITY && _payloadsSet.get(stateId) ? @@ -9556,9 +9556,9 @@ R_::getStateData(const StateID stateId) const { //------------------------------------------------------------------------------ -template +template void -R_::initialEnter() { +R_::initialEnter() { Control control{_context, _random, _stateRegistry, @@ -9611,9 +9611,9 @@ R_::initialEnter() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::processTransitions() { +R_::processTransitions() { HFSM_ASSERT(_requests.count()); HFSM_IF_STRUCTURE(_lastTransitions.clear()); @@ -9661,9 +9661,9 @@ R_::processTransitions() { //------------------------------------------------------------------------------ -template +template bool -R_::applyRequests(Control& control) { +R_::applyRequests(Control& control) { bool changesMade = false; for (const Request& request : _requests) { @@ -9697,9 +9697,9 @@ R_::applyRequests(Control& control) { //------------------------------------------------------------------------------ -template +template bool -R_::cancelledByEntryGuards(const Requests& pendingRequests) { +R_::cancelledByEntryGuards(const Requests& pendingRequests) { GuardControl guardControl{_context, _random, _stateRegistry, @@ -9718,9 +9718,9 @@ R_::cancelledByEntryGuards(const Requests& pendingRequests) { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template bool -R_::cancelledByGuards(const Requests& pendingRequests) { +R_::cancelledByGuards(const Requests& pendingRequests) { GuardControl guardControl{_context, _random, _stateRegistry, @@ -9745,9 +9745,9 @@ R_::cancelledByGuards(const Requests& pendingRequests) { #ifdef HFSM_ENABLE_STRUCTURE_REPORT -template +template void -R_::getStateNames() { +R_::getStateNames() { _stateInfos.clear(); _apex.deepGetNames((LongIndex) -1, StructureStateInfo::COMPOSITE, 0, _stateInfos); @@ -9823,9 +9823,9 @@ R_::getStateNames() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::udpateActivity() { +R_::udpateActivity() { for (LongIndex s = 0, i = 0; s < _stateInfos.count(); ++s) if (_stateInfos[s].name[0] != L'\0') { _structure[i].isActive = isActive(s); @@ -9850,9 +9850,9 @@ R_::udpateActivity() { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -template +template void -R_::recordRequestsAs(const Method method) { +R_::recordRequestsAs(const Method method) { for (const auto& request : _requests) _lastTransitions << TransitionInfo(request, method); } diff --git a/include/hfsm2/machine_dev.hpp b/include/hfsm2/machine_dev.hpp index dffe00a..24b4411 100644 --- a/include/hfsm2/machine_dev.hpp +++ b/include/hfsm2/machine_dev.hpp @@ -85,46 +85,46 @@ namespace hfsm2 { //------------------------------------------------------------------------------ -template , - typename TP = EmptyPayload, +template , + typename TP_ = EmptyPayload, LongIndex NS = 4, LongIndex NT = INVALID_LONG_INDEX> struct ConfigT { - using Context = TC; + using Context = TC_; - using Rank = TN; - using Utility = TU; - using Random_ = TG; + using Rank = TN_; + using Utility = TU_; + using Random_ = TG_; using Logger = LoggerInterfaceT; - using Payload = TP; + using Payload = TP_; static constexpr LongIndex SUBSTITUTION_LIMIT = NS; static constexpr LongIndex TASK_CAPACITY = NT; template - using ContextT = ConfigT< T, TN, TU, TG, TP, NS, NT>; + using ContextT = ConfigT< T, TN_, TU_, TG_, TP_, NS, NT>; template - using RankT = ConfigT; + using RankT = ConfigT; template - using UtilityT = ConfigT; + using UtilityT = ConfigT; template - using RandomT = ConfigT; + using RandomT = ConfigT; template - using PayloadT = ConfigT; + using PayloadT = ConfigT; template - using SubstitutionLimitN = ConfigT; + using SubstitutionLimitN = ConfigT; template - using TaskCapacityN = ConfigT; + using TaskCapacityN = ConfigT; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -