Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/modules/ROOT/pages/back-back-end.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

The back-end contains the library engine and defines the performance and functionality trade-offs. There are, at the moment, three back-ends:

- `msm::back` is using {cpp}03
- `msm::back11` is using {cpp}11 and should be used by default if possible as it removes some pre-{cpp}11 limitations (mpl::vector of limited size)
- `msm::backmp11` is using {cpp}17 (it is still experimental at the moment and further described in a xref:./backmp11-back-end.adoc[separate page])
- `msm::back` is using {cpp}03 and is kept for backwards compatibility
- `msm::back11` is using {cpp}11 and should be preferred over `msm::back` where possible, as it removes some pre-{cpp}11 limitations (mpl::vector of limited size)
- `msm::backmp11` is using {cpp}17 and should be used by default if possible. It provides additional features and significantly better compile times and runtime performance. It is further described in a xref:./backmp11-back-end.adoc[separate page]

The currently available back-ends implement most of the functionality
defined by the UML 2.0 standard at very high runtime speed, in exchange
Expand Down
5 changes: 2 additions & 3 deletions doc/modules/ROOT/pages/backmp11-back-end.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
= Backmp11 back-end (C{plus}{plus}17, experimental)
= Backmp11 back-end (C{plus}{plus}17)

The `backmp11` back-end requires C{plus}{plus}17 and is mostly backwards-compatible with `back`.
It is currently in an **experimental** stage - it is functionally mature, though some details about its API and compatibility to less used functionality might change (feedback welcome!).
It is named after the metaprogramming library https://www.boost.org/library/latest/mp11/[Boost.Mp11], the main contributor to the optimizations.
Use of MPL is replaced with Mp11 to eliminate the costly C{plus}{plus}03 emulation of variadic templates.

Expand Down Expand Up @@ -644,7 +643,7 @@ Calls to the old APIs can be replaced as follows:
| 1.91 / 1.92
a| The API `process_event` automatically enqueues events when the state machine is already processing. This requires instantiating `enqueue_event` for every event type, even though most instantiations are never invoked. They are only needed when `process_event` is called in actions.

*Change:* The API `process_event` will reject an event and return `HANDLED_FALSE` when called during event processing instead of automatically enqueueing it.
*Change:* The API `process_event` will reject an event and return `discarded` when called during event processing instead of automatically enqueueing it.

Calls to `process_event` in actions must be replaced with `enqueue_event`.

Expand Down
4 changes: 4 additions & 0 deletions doc/modules/ROOT/pages/version-history.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

== Boost 1.93

* The `backmp11` back-end is no longer experimental. Its API is considered stable from this release on, after the cleanup listed below
* **Breaking changes (`backmp11`)**:
** The active state switch policy can no longer be configured; the active state is now always set after source exit, in compliance with the UML specification (https://github.com/boostorg/msm/issues/222[#222])
** The deprecated `HANDLED_`-prefixed values are removed from the `process_result` enum, use `discarded`, `consumed`, `rejected` and `deferred` instead (https://github.com/boostorg/msm/issues/242[#242])
* fix(back11): Dropped transition depending on transition table row order (https://github.com/boostorg/msm/issues/252[#252])

== Boost 1.92
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/ROOT/partials/toc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
** xref:back-back-end.adoc[`back` & `back11` back-end]
*** xref:back-back-end/examples.adoc[Examples]
*** xref:back-back-end/performance-compilers.adoc[Performance / Compilers]
** xref:backmp11-back-end.adoc[`backmp11` back-end (C++17, experimental)]
** xref:backmp11-back-end.adoc[`backmp11` back-end (C++17)]
*** xref:backmp11-back-end/examples.adoc[Examples]
** xref:internals.adoc[Internals]
** xref:acknowledgements.adoc[Acknowledgements]
Expand Down
6 changes: 0 additions & 6 deletions include/boost/msm/backmp11/common_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ enum class process_result : uint8_t
rejected = 2,
/// The event will be re-evaluated after the next transition.
deferred = 4,

/// Deprecated enum values.
HANDLED_FALSE [[deprecated("Use discarded")]] = 0,
HANDLED_TRUE [[deprecated("Use accepted")]] = 1,
HANDLED_GUARD_REJECT [[deprecated("Use rejected")]] = 2,
HANDLED_DEFERRED [[deprecated("Use deferred")]] = 4
};

constexpr process_result operator|(process_result lhs, process_result rhs)
Expand Down
31 changes: 4 additions & 27 deletions include/boost/msm/backmp11/detail/transition_table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include <boost/assert.hpp>

#include <boost/msm/active_state_switching_policies.hpp>
#include <boost/msm/back/common_types.hpp>
#include <boost/msm/row_tags.hpp>

Expand Down Expand Up @@ -160,12 +159,6 @@ struct transition_table_impl
using derived_t = typename StateMachine::derived_t;
using state_set = typename StateMachine::state_set;

template<typename T>
using get_active_state_switch_policy = typename T::active_state_switch_policy;
using active_state_switching =
boost::mp11::mp_eval_or<active_state_switch_after_exit,
get_active_state_switch_policy, front_end_t>;

template <typename Row, bool HasGuard, typename Event, typename Source,
typename Target>
static bool call_guard_or_true(StateMachine& sm, const Event& event,
Expand Down Expand Up @@ -305,36 +298,20 @@ struct transition_table_impl
// guard rejected the event, we stay in the current one
return process_result::rejected;
}
if constexpr (std::is_same_v<active_state_switching,
active_state_switch_before_transition>)
{
state_id = next_state_id;
}

// first call the exit method of the current state
source.on_exit(event, sm.get_fsm_argument());
if constexpr (std::is_same_v<active_state_switching,
active_state_switch_after_exit>)
{
state_id = next_state_id;
}

// set the new active state id after source exit and
// before target entry (UML 14.2.3.4.5 & 14.2.3.4.6)
state_id = next_state_id;

// then call the action method
process_result res =
call_action_or_true<Row, HasAction>(sm, event, source, target);
if constexpr (std::is_same_v<active_state_switching,
active_state_switch_after_transition_action>)
{
state_id = next_state_id;
}

// and finally the entry method of the new state
call_entry<Row>(sm, event, target);
if constexpr (std::is_same_v<active_state_switching,
active_state_switch_after_entry>)
{
state_id = next_state_id;
}

// Give a chance to handle completion transitions.
sm.on_state_entry_completed(target, region_id);
Expand Down
Loading