diff --git a/doc/HTML/ch03.html b/doc/HTML/ch03.html index b9be081..47ab578 100644 --- a/doc/HTML/ch03.html +++ b/doc/HTML/ch03.html @@ -5,9 +5,9 @@ Attributes / Function call
MSM is divided between front–ends and back-ends. At the moment, there is just one back-end. On the front-end side, you will find three of them which are as many state machine description languages, with many more possible. For potential diff --git a/doc/HTML/ch03s06.html b/doc/HTML/ch03s06.html index 845cc62..084e816 100644 --- a/doc/HTML/ch03s06.html +++ b/doc/HTML/ch03s06.html @@ -1,14 +1,16 @@
-There is, at the moment, one back-end. This back-end contains the library - engine and defines the performance and functionality trade-offs. The currently - available back-end implements most of the functionality defined by the UML 2.0 - standard at very high runtime speed, in exchange for longer compile-time. The - runtime speed is due to a constant-time double-dispatch and self-adapting - capabilities allowing the framework to adapt itself to the features used by a - given concrete state machine. All unneeded features either disable themselves or - can be manually disabled. See section 5.1 for a complete description of the - run-to-completion algorithm.
MSM being divided between front and back-end, one needs to first define a +
There are, at the moment, two back-ends. msm::back is using C++03, msm::back11 + is using C++11 and should be used by default if possible as it removes some + pre-C++11 limitations (mpl::vector of limited size). This back-end contains the + library engine and defines the performance and functionality trade-offs. The + currently available back-end implements most of the functionality defined by the + UML 2.0 standard at very high runtime speed, in exchange for longer + compile-time. The runtime speed is due to a constant-time double-dispatch and + self-adapting capabilities allowing the framework to adapt itself to the + features used by a given concrete state machine. All unneeded features either + disable themselves or can be manually disabled. See section 5.1 for a complete + description of the run-to-completion algorithm.
MSM being divided between front and back-end, one needs to first define a front-end. Then, to create a real state machine, the back-end must be declared:
typedef msm::back11::state_machine<my_front_end> my_fsm;
We now have a fully functional state machine type. The next sections will @@ -41,7 +43,7 @@ some_event e1; fsm.process_event(e1)
Creating an event on the fly will b alternative. If you need to know what state is active, const int* current_state() will return an array of state ids. Please refer to the internals section to - know how state ids are generated.
The FSM template argument passed to functors or entry/exit actions is the + know how state ids are generated.
The FSM template argument passed to functors or entry/exit actions is the current state machine, which might not be what is wanted as th upper state machine makes more sense. The back-end provides a get_upper() function returning a pointer to the upper state machine, which is usually what you @@ -213,8 +215,8 @@ player p(boost::ref(data),3); where some data is passed:
player p( back::states_ << Playing(back::states_ << Song1(some_Song1_data)) ,
boost::ref(data),3);It is also possible to replace a given state by a new instance at any time
using set_states() and the same syntax, for example:
-
p.set_states( back::states_ << state_1 << ... << state_n );
An example making intensive use of this capability is provided.
MSM is optimized for run-time speed at the cost of longer compile-time. +
p.set_states( back::states_ << state_1 << ... << state_n );
An example making intensive use of this capability is provided.
MSM is optimized for run-time speed at the cost of longer compile-time. This can become a problem with older compilers and big state machines, especially if you don't really care about run-time speed that much and would be satisfied by a performance roughly the same as most state machine @@ -222,7 +224,7 @@ player p(boost::ref(data),3); it, if you are using a VC compiler, deactivate the /Gm compiler option (default for debug builds). This option can cause builds to be 3 times longer... If the compile-time still is a problem, read further. MSM offers a - policy which will speed up compiling in two main cases:
many transition conflicts
submachines
The back-end msm::back11::state_machine has a policy argument
+ policy which will speed up compiling in two main cases:
many transition conflicts
submachines
Important warningmsm::back11 is not supporting this feature yet.
The back-end msm::back::state_machine has a policy argument
(first is the front-end, then the history policy) defaulting to
favor_runtime_speed. To switch to
favor_compile_time, which is declared in
@@ -244,7 +246,7 @@ BOOST_MSM_BACK_GENERATE_PROCESS_EVENT(mysubmachine)
-
A MSM state machine being a metaprogram, it is only logical that cheking +
A MSM state machine being a metaprogram, it is only logical that cheking for the validity of a concrete state machine happens compile-time. To this aim, using the compile-time graph library mpl_graph (delivered at the moment with MSM) from Gordon Woodhull, MSM provides several compile-time checks:
Check that orthogonal regions ar truly orthogonal.
Check that all states are either reachable from the initial @@ -258,14 +260,14 @@ BOOST_MSM_BACK_GENERATE_PROCESS_EVENT(mysubmachine)
The author's advice is to enable the checks after any state machine structure change and disable it again after sucessful analysis.
The following example provokes an assertion if one of the first two lines - of the transition table is used.
Calling process_event(Event const&) will immediately
process the event with run-to-completion semantics. You can also enqueue the
events and delay their processing by calling enqueue_event(Event
const&) instead. Calling execute_queued_events()
will then process all enqueued events (in FIFO order). Calling
execute_single_queued_event() will execute the oldest
- enqueued event.
You can query the queue size by calling get_message_queue_size().
MSM uses by default a std::deque for its queues (one message queue for + enqueued event.
You can query the queue size by calling get_message_queue_size().
MSM uses by default a std::deque for its queues (one message queue for
events generated during run-to-completion or with
enqueue_event, one for deferred events). Unfortunately, on some
STL implementations, it is a very expensive container in size and copying
@@ -276,14 +278,14 @@ BOOST_MSM_BACK_GENERATE_PROCESS_EVENT(mysubmachine)
MSM uses Boost.Parameter to allow easier definition of + common):
fsm.get_message_queue().set_capacity(1);
MSM uses Boost.Parameter to allow easier definition of back11::state_machine<> policy arguments (all except the front-end). This allows you to define policy arguments (history, compile-time / run-time, state machine analysis, container for the queues) at any position, in any number. For example:
typedef msm::back11::state_machine< player_,msm::back::mpl_graph_fsm_check> player; typedef msm::back11::state_machine< player_,msm::back::AlwaysHistory> player; typedef msm::back11::state_machine< player_,msm::back::mpl_graph_fsm_check,msm::back::AlwaysHistory> player; - typedef msm::back11::state_machine< player_,msm::back::AlwaysHistory,msm::back::mpl_graph_fsm_check> player;
The UML Standard is silent about a very important question: when a transition fires, at which exact point is the target state the new active state of a state machine? At the end of the transition? After the source diff --git a/doc/HTML/ch04.html b/doc/HTML/ch04.html index 3ea5cff..afddb1e 100644 --- a/doc/HTML/ch04.html +++ b/doc/HTML/ch04.html @@ -1,6 +1,6 @@
-Table of Contents
Tests were made on different PCs running Windows XP and Vista and compiled with +
Table of Contents
Tests were made on different PCs running Windows XP and Vista and compiled with VC9 SP1 or Ubuntu and compiled with g++ 4.2 and 4.3. For these tests, the same player state machine was written using Boost.Statechart, as a state machine with only simple states and as a state machine with a composite @@ -9,5 +9,5 @@ the simple one also with functors and with eUML. As these simple machines need no terminate/interrupt states, no message queue and have no-throw guarantee on their actions, the MSM state machines are defined with minimum functionality. Test machine is a Q6600 2.4GHz, Vista - 64.
VC9:
The simple test completes 90 times faster with MSM than with + 64.
There are some worries that MSM generates huge code. Is it true? The 2 +
There are some worries that MSM generates huge code. Is it true? The 2 compilers I tested disagree with this claim. On VC9, the test state machines used in the performance section produce executables of 14kB (for simple and eUML) and 21kB (for the composite). This includes the test code and iostreams. diff --git a/doc/HTML/ch04s03.html b/doc/HTML/ch04s03.html index d25c5d4..6ed403e 100644 --- a/doc/HTML/ch04s03.html +++ b/doc/HTML/ch04s03.html @@ -1,6 +1,6 @@
-For a current status, have a look at the regression tests.
MSM was successfully tested with:
VC8 (partly), VC9, VC10
g++ 4.0.1 and higher
Intel 10.1 and higher
Clang 2.9
Green Hills Software MULTI for ARM v5.0.5 patch 4416 (Simple and +
For a current status, have a look at the regression tests.
MSM was successfully tested with:
VC8 (partly), VC9, VC10
g++ 4.0.1 and higher
Intel 10.1 and higher
Clang 2.9
Green Hills Software MULTI for ARM v5.0.5 patch 4416 (Simple and Composite tutorials)
Partial support for IBM compiler
VC8 and to some lesser extent VC9 suffer from a bug. Enabling the option "Enable Minimal Rebuild" (/Gm) will cause much higher compile-time (up to three times with VC8!). This option being activated per default in Debug mode, this diff --git a/doc/HTML/ch04s04.html b/doc/HTML/ch04s04.html index cc80271..fc2eb57 100644 --- a/doc/HTML/ch04s04.html +++ b/doc/HTML/ch04s04.html @@ -1,6 +1,6 @@
-+
Compilation times of state machines with > 80 transitions that are going to make you storm the CFO's office and make sure you get a shiny octocore with 12GB RAM by next week, unless he's interested in diff --git a/doc/HTML/ch04s05.html b/doc/HTML/ch04s05.html index 58024a3..e8827e1 100644 --- a/doc/HTML/ch04s05.html +++ b/doc/HTML/ch04s05.html @@ -1,6 +1,6 @@
-Compilers are sometimes full of surprises and such strange errors happened in +
Compilers are sometimes full of surprises and such strange errors happened in the course of the development that I wanted to list the most fun for readers’ entertainment.
VC8:
template <class StateType>
typename ::boost::enable_if<
diff --git a/doc/HTML/ch05.html b/doc/HTML/ch05.html
index 40f54ce..19b0ee0 100644
--- a/doc/HTML/ch05.html
+++ b/doc/HTML/ch05.html
@@ -1,6 +1,6 @@
- Chapter 5. Questions & Answers, tips Where should I define a state machine?: The
+
Chapter 5. Questions & Answers, tips Where should I define a state machine?: The
tutorials are implemented in a simple cpp source file for simplicity. I want to
model dynamic behavior of a class as a state machine, how should I define the state
machine?
Answer: Usually you'll want to implement the
diff --git a/doc/HTML/ch06.html b/doc/HTML/ch06.html
index 67845ce..f3027f9 100644
--- a/doc/HTML/ch06.html
+++ b/doc/HTML/ch06.html
@@ -1,9 +1,9 @@
- Chapter 6. Internals Table of Contents
- Backend: Run To Completion
- Frontend / Backend
+
Chapter 6. Internals Table of Contents
This chapter describes the internal machinery of the back-end, which can be useful
for UML experts but can be safely ignored for most users. For implementers, the
- interface between front- and back- end is also described in detail.
The back-end implements the following run-to completion algorithm:
Check if one region of the concrete state machine is in a
+ interface between front- and back- end is also described in detail.
The back-end implements the following run-to completion algorithm:
Check if one region of the concrete state machine is in a
terminate or interrupt state. If yes, event processing is disabled
while the condition lasts (forever for a terminate pseudo-state,
while active for an interrupt pseudo-state).
If the message queue feature is enabled and if the state machine
diff --git a/doc/HTML/ch06s02.html b/doc/HTML/ch06s02.html
index 56266fe..fe55cd1 100644
--- a/doc/HTML/ch06s02.html
+++ b/doc/HTML/ch06s02.html
@@ -1,7 +1,7 @@
Frontend / Backend interface The design of MSM tries to make front-ends and back-ends (later) to be as
interchangeable as possible. Of course, no back-end will ever implement every
feature defined by any possible front-end and inversely, but the goal is to make
diff --git a/doc/HTML/ch06s03.html b/doc/HTML/ch06s03.html
index f94d0fd..76c3f25 100644
--- a/doc/HTML/ch06s03.html
+++ b/doc/HTML/ch06s03.html
@@ -1,6 +1,6 @@
- Generated state ids Normally, one does not need to know the ids are generated for all the states
+
Generated state ids Normally, one does not need to know the ids are generated for all the states
of a state machine, unless for debugging purposes, like the pstate function does
in the tutorials in order to display the name of the current state. This section
will show how to automatically display typeid-generated names, but these are not
diff --git a/doc/HTML/ch06s04.html b/doc/HTML/ch06s04.html
index 34c7bdc..9da030e 100644
--- a/doc/HTML/ch06s04.html
+++ b/doc/HTML/ch06s04.html
@@ -1,6 +1,6 @@
- Metaprogramming tools We can find for the transition table more uses than what we have seen so far.
+
Metaprogramming tools We can find for the transition table more uses than what we have seen so far.
Let's suppose you need to write a coverage tool. A state machine would be
perfect for such a job, if only it could provide some information about its
structure. Thanks to the transition table and Boost.MPL, it does.
What is needed for a coverage tool? You need to know how many states are
diff --git a/doc/HTML/ch07.html b/doc/HTML/ch07.html
index c0109d7..ed50bc4 100644
--- a/doc/HTML/ch07.html
+++ b/doc/HTML/ch07.html
@@ -1,6 +1,6 @@
- Chapter 7. Acknowledgements I am in debt to the following people who helped MSM along the way.
+
Chapter 7. Acknowledgements I am in debt to the following people who helped MSM along the way.
Thanks to Dave Abrahams for managing the review
Thanks to Eric Niebler for his patience correcting my grammar
errors
Special thanks to Joel de Guzman who gave me very good ideas at
the BoostCon09. These ideas were the starting point of the redesign.
diff --git a/doc/HTML/ch07s02.html b/doc/HTML/ch07s02.html
index e244f1a..0223ecb 100644
--- a/doc/HTML/ch07s02.html
+++ b/doc/HTML/ch07s02.html
@@ -1,6 +1,6 @@
- MSM v1
+
MSM v1
The original version of this framework is based on the brilliant
work of David Abrahams and Aleksey Gurtovoy who laid down the base
and the principles of the framework in their excellent book, “C++
diff --git a/doc/HTML/ch08.html b/doc/HTML/ch08.html
index bbea223..2d593d5 100644
--- a/doc/HTML/ch08.html
+++ b/doc/HTML/ch08.html
@@ -1,6 +1,6 @@
- Chapter 8. Version history Table of Contents
+
Chapter 8. Version history Table of Contents
\ No newline at end of file
diff --git a/doc/HTML/ch08s02.html b/doc/HTML/ch08s02.html
index 181d721..cafca0e 100644
--- a/doc/HTML/ch08s02.html
+++ b/doc/HTML/ch08s02.html
@@ -1,5 +1,5 @@
- Boost 1.72
+
Boost 1.72
\ No newline at end of file
diff --git a/doc/HTML/ch08s03.html b/doc/HTML/ch08s03.html
index 0a8255c..2a5954a 100644
--- a/doc/HTML/ch08s03.html
+++ b/doc/HTML/ch08s03.html
@@ -1,6 +1,6 @@
- Boost 1.57
+
Boost 1.57
Fixed BOOST_MSM_EUML_EVENT_WITH_ATTRIBUTES (broken in
1.56).
Fixed execute_queued_events, added
execute_single_queued_event
Fixed warnings for unused variables
diff --git a/doc/HTML/ch08s04.html b/doc/HTML/ch08s04.html
index dc6f979..bb9e846 100644
--- a/doc/HTML/ch08s04.html
+++ b/doc/HTML/ch08s04.html
@@ -1,5 +1,5 @@
- Boost 1.56
+
Boost 1.56
Bugfix: no_transition in case of an exception.
Bugfix: Trac 9280
Bugfix: incomplete namespace names in eUML
\ No newline at end of file
diff --git a/doc/HTML/ch08s05.html b/doc/HTML/ch08s05.html
index 42f9e54..5ac592a 100644
--- a/doc/HTML/ch08s05.html
+++ b/doc/HTML/ch08s05.html
@@ -1,6 +1,6 @@
- Boost 1.55
+
Boost 1.55
New feature: interrupt states now support a sequence of events to
end the interruption
Bugfix: Trac 8686.
\ No newline at end of file
diff --git a/doc/HTML/ch08s06.html b/doc/HTML/ch08s06.html
index 78406bb..7af813b 100644
--- a/doc/HTML/ch08s06.html
+++ b/doc/HTML/ch08s06.html
@@ -1,6 +1,6 @@
- Boost 1.54
+
Boost 1.54
Bugfix: Exit points broken for the favor_compile_time
policy.
Bugfix: copy breaks exit points of subsubmachines.
Bugfix: Trac 8046.
\ No newline at end of file
diff --git a/doc/HTML/ch08s07.html b/doc/HTML/ch08s07.html
index 8269ed8..bddfe64 100644
--- a/doc/HTML/ch08s07.html
+++ b/doc/HTML/ch08s07.html
@@ -1,6 +1,6 @@
- From V2.23 to V2.24 (Boost 1.51)
+
From V2.23 to V2.24 (Boost 1.51)
Support for boost::any
or kleene as an
acceptable event.
Bugfix: compiler error with fsm internal table and
diff --git a/doc/HTML/ch08s08.html b/doc/HTML/ch08s08.html
index 8b7f348..acab270 100644
--- a/doc/HTML/ch08s08.html
+++ b/doc/HTML/ch08s08.html
@@ -1,6 +1,6 @@
- From V2.22 to V2.23 (Boost 1.50)
+
From V2.22 to V2.23 (Boost 1.50)
eUML : better syntax
for front-ends defined with eUML as transititon table only. Caution:
Breaking Change!
Bugfix: graph building was only working if
diff --git a/doc/HTML/ch08s09.html b/doc/HTML/ch08s09.html
index 6bde9ab..7905c83 100644
--- a/doc/HTML/ch08s09.html
+++ b/doc/HTML/ch08s09.html
@@ -1,6 +1,6 @@
- From V2.21 to V2.22 (Boost 1.48)
+
From V2.21 to V2.22 (Boost 1.48)
eUML: added easier event reprocessing:
process(event_) and reprocess()
Rewrite of internal transition tables. There were a few bugs
(failing recursivity in internal transition tables of sub-sub
diff --git a/doc/HTML/ch08s10.html b/doc/HTML/ch08s10.html
index b1ca051..e40b170 100644
--- a/doc/HTML/ch08s10.html
+++ b/doc/HTML/ch08s10.html
@@ -1,6 +1,6 @@
- From V2.20 to V2.21 (Boost 1.47)
+
From V2.20 to V2.21 (Boost 1.47)
Added a stop()
method in the back-end.
Added the possibility to choose when state switching
diff --git a/doc/HTML/ch08s11.html b/doc/HTML/ch08s11.html
index d40537d..35b9ed6 100644
--- a/doc/HTML/ch08s11.html
+++ b/doc/HTML/ch08s11.html
@@ -1,6 +1,6 @@
- From V2.12 to V2.20 (Boost 1.46)
+
From V2.12 to V2.20 (Boost 1.46)
Compile-time state machine analysis using mpl_graph:
Boost.Parameter interface definition for
msm::back::state_machine<> template arguments.
Possibility to provide a
diff --git a/doc/HTML/ch08s12.html b/doc/HTML/ch08s12.html
index 9d51ada..a3539bd 100644
--- a/doc/HTML/ch08s12.html
+++ b/doc/HTML/ch08s12.html
@@ -1,6 +1,6 @@
- From V2.10 to V2.12 (Boost 1.45)
+
From V2.10 to V2.12 (Boost 1.45)
Support for serialization
Possibility to use
normal functors (from functor front-end) in
eUML.
New constructors where substates / submachines can be taken as
diff --git a/doc/HTML/ch08s13.html b/doc/HTML/ch08s13.html
index 139e5c0..b300916 100644
--- a/doc/HTML/ch08s13.html
+++ b/doc/HTML/ch08s13.html
@@ -1,6 +1,6 @@
- From V2.0 to V2.12 (Boost 1.44)
+
From V2.0 to V2.12 (Boost 1.44)
New documentation
Internal transitions. Either as part of the transition table or
using a state's internal transition table
increased dispatch and copy speed
new row types for the
basic front-end
new eUML syntax, better attribute support, macros to ease
diff --git a/doc/HTML/ch09.html b/doc/HTML/ch09.html
index b03fde4..5ae2287 100644
--- a/doc/HTML/ch09.html
+++ b/doc/HTML/ch09.html
@@ -1,4 +1,4 @@
- Chapter 9. External references to MSM An interesting mapping UML <-> MSM from Takatoshi Kondo can be found at
+
Chapter 9. External references to MSM An interesting mapping UML <-> MSM from Takatoshi Kondo can be found at
Redboltz.
\ No newline at end of file
diff --git a/doc/HTML/ch10.html b/doc/HTML/ch10.html
index 321713d..222bfec 100644
--- a/doc/HTML/ch10.html
+++ b/doc/HTML/ch10.html
@@ -1,7 +1,7 @@
- Chapter 10. eUML operators and basic helpers The following table lists the supported operators:
-
Table 10.1. Operators and state machine helpers
eUML function / operator Description Functor && Calls lazily Action1&& Action2 And_ || Calls lazily Action1|| Action2 Or_ ! Calls lazily !Action1 Not_ != Calls lazily Action1 != Action2 NotEqualTo_ == Calls lazily Action1 == Action2 EqualTo_ > Calls lazily Action1 > Action2 Greater_ >= Calls lazily Action1 >= Action2 Greater_Equal_ < Calls lazily Action1 < Action2 Less_ <= Calls lazily Action1 <= Action2 Less_Equal_ & Calls lazily Action1 & Action2 Bitwise_And_ | Calls lazily Action1 | Action2 Bitwise_Or_ ^ Calls lazily Action1 ^ Action2 Bitwise_Xor_ -- Calls lazily --Action1 / Action1-- Pre_Dec_ / Post_Dec_ ++ Calls lazily ++Action1 / Action1++ Pre_Inc_ / Post_Inc_ / Calls lazily Action1 / Action2 Divides_ /= Calls lazily Action1 /= Action2 Divides_Assign_ * Calls lazily Action1 * Action2 Multiplies_ *= Calls lazily Action1 *= Action2 Multiplies_Assign_ + (binary) Calls lazily Action1 + Action2 Plus_ + (unary) Calls lazily +Action1 Unary_Plus_ += Calls lazily Action1 += Action2 Plus_Assign_ - (binary) Calls lazily Action1 - Action2 Minus_ - (unary) Calls lazily -Action1 Unary_Minus_ -= Calls lazily Action1 -= Action2 Minus_Assign_ % Calls lazily Action1 % Action2 Modulus_ %= Calls lazily Action1 %= Action2 Modulus_Assign_ >> Calls lazily Action1 >> Action2 ShiftRight_ >>= Calls lazily Action1 >>= Action2 ShiftRight_Assign_ << Calls lazily Action1 << Action2 ShiftLeft_ <<= Calls lazily Action1 <<= Action2 ShiftLeft_Assign_ [] (works on vector, map, arrays) Calls lazily Action1 [Action2] Subscript_ if_then_else_(Condition,Action1,Action2) Returns either the result of calling Action1 or the result of
+ Chapter 10. eUML operators and basic helpers The following table lists the supported operators:
+
Table 10.1. Operators and state machine helpers
eUML function / operator Description Functor && Calls lazily Action1&& Action2 And_ || Calls lazily Action1|| Action2 Or_ ! Calls lazily !Action1 Not_ != Calls lazily Action1 != Action2 NotEqualTo_ == Calls lazily Action1 == Action2 EqualTo_ > Calls lazily Action1 > Action2 Greater_ >= Calls lazily Action1 >= Action2 Greater_Equal_ < Calls lazily Action1 < Action2 Less_ <= Calls lazily Action1 <= Action2 Less_Equal_ & Calls lazily Action1 & Action2 Bitwise_And_ | Calls lazily Action1 | Action2 Bitwise_Or_ ^ Calls lazily Action1 ^ Action2 Bitwise_Xor_ -- Calls lazily --Action1 / Action1-- Pre_Dec_ / Post_Dec_ ++ Calls lazily ++Action1 / Action1++ Pre_Inc_ / Post_Inc_ / Calls lazily Action1 / Action2 Divides_ /= Calls lazily Action1 /= Action2 Divides_Assign_ * Calls lazily Action1 * Action2 Multiplies_ *= Calls lazily Action1 *= Action2 Multiplies_Assign_ + (binary) Calls lazily Action1 + Action2 Plus_ + (unary) Calls lazily +Action1 Unary_Plus_ += Calls lazily Action1 += Action2 Plus_Assign_ - (binary) Calls lazily Action1 - Action2 Minus_ - (unary) Calls lazily -Action1 Unary_Minus_ -= Calls lazily Action1 -= Action2 Minus_Assign_ % Calls lazily Action1 % Action2 Modulus_ %= Calls lazily Action1 %= Action2 Modulus_Assign_ >> Calls lazily Action1 >> Action2 ShiftRight_ >>= Calls lazily Action1 >>= Action2 ShiftRight_Assign_ << Calls lazily Action1 << Action2 ShiftLeft_ <<= Calls lazily Action1 <<= Action2 ShiftLeft_Assign_ [] (works on vector, map, arrays) Calls lazily Action1 [Action2] Subscript_ if_then_else_(Condition,Action1,Action2) Returns either the result of calling Action1 or the result of
calling Action2 If_Else_ if_then_(Condition,Action) Returns the result of calling Action if Condition If_Then_ while_(Condition, Body) While Condition(), calls Body(). Returns nothing While_Do_ do_while_(Condition, Body) Calls Body() while Condition(). Returns nothing Do_While_ for_(Begin,Stop,EndLoop,Body) Calls for(Begin;Stop;EndLoop){Body;} For_Loop_ process_(Event [,fsm1] [,fsm2] [,fsm3] [,fsm4]) Processes Event on the current state machine (if no fsm
specified) or on up to 4 state machines returned by an
appropriate functor. Process_ process2_(Event, Data [,fsm1] [,fsm2] [,fsm3]) Processes Event on the current state machine (if no fsm
diff --git a/doc/HTML/ch11.html b/doc/HTML/ch11.html
index 74fd907..a4a4a3b 100644
--- a/doc/HTML/ch11.html
+++ b/doc/HTML/ch11.html
@@ -1,33 +1,33 @@
Chapter 11. Functional programming Prev Part II. Reference Next
To use these functions, you need to include:
#include <msm/front/euml/stl.hpp>
or the specified header in the following tables.
The following tables list the supported STL algorithms:
Table 11.1. STL algorithms
STL algorithms in querying.hpp Functor find_(first, last, value) Find_ find_if_(first, last, value) FindIf_ lower_bound_(first, last, value [,opᵃ]) LowerBound_ upper_bound_(first, last, value [,opᵃ]) UpperBound_ equal_range_(first, last, value [,opᵃ]) EqualRange_ binary_search_(first, last, value [,opᵃ]) BinarySearch_ min_element_(first, last[,opᵃ]) MinElement_ max_element_(first, last[,opᵃ]) MaxElement_ adjacent_find_(first, last[,opᵃ]) AdjacentFind_ find_end_( first1, last1, first2, last2 [,op ᵃ]) FindEnd_ find_first_of_( first1, last1, first2, last2 [,op ᵃ]) FindFirstOf_ equal_( first1, last1, first2 [,op ᵃ]) Equal_ search_( first1, last1, first2, last2 [,op ᵃ]) Search_ includes_( first1, last1, first2, last2 [,op ᵃ]) Includes_ lexicographical_compare_ ( first1, last1, first2, last2 [,op
+ Table 11.1. STL algorithms
STL algorithms in querying.hpp Functor find_(first, last, value) Find_ find_if_(first, last, value) FindIf_ lower_bound_(first, last, value [,opᵃ]) LowerBound_ upper_bound_(first, last, value [,opᵃ]) UpperBound_ equal_range_(first, last, value [,opᵃ]) EqualRange_ binary_search_(first, last, value [,opᵃ]) BinarySearch_ min_element_(first, last[,opᵃ]) MinElement_ max_element_(first, last[,opᵃ]) MaxElement_ adjacent_find_(first, last[,opᵃ]) AdjacentFind_ find_end_( first1, last1, first2, last2 [,op ᵃ]) FindEnd_ find_first_of_( first1, last1, first2, last2 [,op ᵃ]) FindFirstOf_ equal_( first1, last1, first2 [,op ᵃ]) Equal_ search_( first1, last1, first2, last2 [,op ᵃ]) Search_ includes_( first1, last1, first2, last2 [,op ᵃ]) Includes_ lexicographical_compare_ ( first1, last1, first2, last2 [,op
ᵃ]) LexicographicalCompare_ count_(first, last, value [,size]) Count_ count_if_(first, last, op ᵃ [,size]) CountIf_ distance_(first, last) Distance_ mismatch _( first1, last1, first2 [,op ᵃ]) Mismatch_
Table 11.2. STL algorithms
STL algorithms in iteration.hpp Functor for_each_(first,last, unary opᵃ) ForEach_ accumulate_first, last, init [,opᵃ]) Accumulate_
+
Table 11.2. STL algorithms
STL algorithms in iteration.hpp Functor for_each_(first,last, unary opᵃ) ForEach_ accumulate_first, last, init [,opᵃ]) Accumulate_
Table 11.3. STL algorithms
STL algorithms in transformation.hpp Functor copy_(first, last, result) Copy_ copy_backward_(first, last, result) CopyBackward_ reverse_(first, last) Reverse_ reverse_copy_(first, last , result) ReverseCopy_ remove_(first, last, value) Remove_ remove_if_(first, last , opᵃ) RemoveIf_ remove_copy_(first, last , output, value) RemoveCopy_ remove_copy_if_(first, last, output, opᵃ) RemoveCopyIf_ fill_(first, last, value) Fill_ fill_n_(first, size, value)ᵇ FillN_ generate_(first, last, generatorᵃ) Generate_ generate_(first, size, generatorᵃ)ᵇ GenerateN_ unique_(first, last [,opᵃ]) Unique_ unique_copy_(first, last, output [,opᵃ]) UniqueCopy_ random_shuffle_(first, last [,opᵃ]) RandomShuffle_ rotate_copy_(first, middle, last, output) RotateCopy_ partition_ (first, last [,opᵃ]) Partition_ stable_partition_ (first, last [,opᵃ]) StablePartition_ stable_sort_(first, last [,opᵃ]) StableSort_ sort_(first, last [,opᵃ]) Sort_ partial_sort_(first, middle, last [,opᵃ]) PartialSort_ partial_sort_copy_ (first, last, res_first, res_last [,opᵃ]) PartialSortCopy_ nth_element_(first, nth, last [,opᵃ]) NthElement_ merge_( first1, last1, first2, last2, output [,op ᵃ]) Merge_ inplace_merge_(first, middle, last [,opᵃ]) InplaceMerge_ set_union_(first1, last1, first2, last2, output [,op
+ Table 11.3. STL algorithms
STL algorithms in transformation.hpp Functor copy_(first, last, result) Copy_ copy_backward_(first, last, result) CopyBackward_ reverse_(first, last) Reverse_ reverse_copy_(first, last , result) ReverseCopy_ remove_(first, last, value) Remove_ remove_if_(first, last , opᵃ) RemoveIf_ remove_copy_(first, last , output, value) RemoveCopy_ remove_copy_if_(first, last, output, opᵃ) RemoveCopyIf_ fill_(first, last, value) Fill_ fill_n_(first, size, value)ᵇ FillN_ generate_(first, last, generatorᵃ) Generate_ generate_(first, size, generatorᵃ)ᵇ GenerateN_ unique_(first, last [,opᵃ]) Unique_ unique_copy_(first, last, output [,opᵃ]) UniqueCopy_ random_shuffle_(first, last [,opᵃ]) RandomShuffle_ rotate_copy_(first, middle, last, output) RotateCopy_ partition_ (first, last [,opᵃ]) Partition_ stable_partition_ (first, last [,opᵃ]) StablePartition_ stable_sort_(first, last [,opᵃ]) StableSort_ sort_(first, last [,opᵃ]) Sort_ partial_sort_(first, middle, last [,opᵃ]) PartialSort_ partial_sort_copy_ (first, last, res_first, res_last [,opᵃ]) PartialSortCopy_ nth_element_(first, nth, last [,opᵃ]) NthElement_ merge_( first1, last1, first2, last2, output [,op ᵃ]) Merge_ inplace_merge_(first, middle, last [,opᵃ]) InplaceMerge_ set_union_(first1, last1, first2, last2, output [,op
ᵃ]) SetUnion_ push_heap_(first, last [,op ᵃ]) PushHeap_ pop_heap_(first, last [,op ᵃ]) PopHeap_ make_heap_(first, last [,op ᵃ]) MakeHeap_ sort_heap_(first, last [,op ᵃ]) SortHeap_ next_permutation_(first, last [,op ᵃ]) NextPermutation_ prev_permutation_(first, last [,op ᵃ]) PrevPermutation_ inner_product_(first1, last1, first2, init [,op1ᵃ] [,op2ᵃ]) InnerProduct_ partial_sum_(first, last, output [,opᵃ]) PartialSum_ adjacent_difference_(first, last, output [,opᵃ]) AdjacentDifference_ replace_(first, last, old_value, new_value) Replace_ replace_if_(first, last, opᵃ, new_value) ReplaceIf_ replace_copy_(first, last, result, old_value,
new_value) ReplaceCopy_ replace_copy_if_(first, last, result, opᵃ, new_value) ReplaceCopyIf_ rotate_(first, middle, last)ᵇ Rotate_
Table 11.4. STL container methods
STL container methods(common) in container.hpp Functor container::reference front_(container) Front_ container::reference back_(container) Back_ container::iterator begin_(container) Begin_ container::iterator end_(container) End_ container::reverse_iterator rbegin_(container) RBegin_ container::reverse_iterator rend_(container) REnd_ void push_back_(container, value) Push_Back_ void pop_back_(container, value) Pop_Back_ void push_front_(container, value) Push_Front_ void pop_front_(container, value) Pop_Front_ void clear_(container) Clear_ size_type capacity_(container) Capacity_ size_type size_(container) Size_ size_type max_size_(container) Max_Size_ void reserve_(container, value) Reserve _ void resize_(container, value) Resize _ iterator insert_(container, pos, value) Insert_ void insert_( container , pos, first, last) Insert_ void insert_( container , pos, number, value) Insert_ void swap_( container , other_container) Swap_ void erase_( container , pos) Erase_ void erase_( container , first, last) Erase_ bool empty_( container) Empty_
+
Table 11.4. STL container methods
STL container methods(common) in container.hpp Functor container::reference front_(container) Front_ container::reference back_(container) Back_ container::iterator begin_(container) Begin_ container::iterator end_(container) End_ container::reverse_iterator rbegin_(container) RBegin_ container::reverse_iterator rend_(container) REnd_ void push_back_(container, value) Push_Back_ void pop_back_(container, value) Pop_Back_ void push_front_(container, value) Push_Front_ void pop_front_(container, value) Pop_Front_ void clear_(container) Clear_ size_type capacity_(container) Capacity_ size_type size_(container) Size_ size_type max_size_(container) Max_Size_ void reserve_(container, value) Reserve _ void resize_(container, value) Resize _ iterator insert_(container, pos, value) Insert_ void insert_( container , pos, first, last) Insert_ void insert_( container , pos, number, value) Insert_ void swap_( container , other_container) Swap_ void erase_( container , pos) Erase_ void erase_( container , first, last) Erase_ bool empty_( container) Empty_
-
Table 11.5. STL list methods
std::list methods in container.hpp Functor void list_remove_(container, value) ListRemove_ void list_remove_if_(container, opᵃ) ListRemove_If_ void list_merge_(container, other_list) ListMerge_ void list_merge_(container, other_list, opᵃ) ListMerge_ void splice_(container, iterator, other_list) Splice_ void splice_(container, iterator, other_list,
+ Table 11.5. STL list methods
std::list methods in container.hpp Functor void list_remove_(container, value) ListRemove_ void list_remove_if_(container, opᵃ) ListRemove_If_ void list_merge_(container, other_list) ListMerge_ void list_merge_(container, other_list, opᵃ) ListMerge_ void splice_(container, iterator, other_list) Splice_ void splice_(container, iterator, other_list,
iterator) Splice_ void splice_(container, iterator, other_list, first,
last) Splice_ void list_reverse_(container) ListReverse_ void list_unique_(container) ListUnique_ void list_unique_(container, opᵃ) ListUnique_ void list_sort_(container) ListSort_ void list_sort_(container, opᵃ) ListSort_
-
Table 11.6. STL associative container methods
Associative container methods in container.hpp Functor iterator insert_(container, pos, value) Insert_ void insert_( container , first, last) Insert_ pair<iterator, bool> insert_( container , value) Insert_ void associative_erase_( container , pos) Associative_Erase_ void associative_erase_( container , first, last) Associative_Erase_ size_type associative_erase_( container , key) Associative_Erase_ iterator associative_find_( container , key) Associative_Find_ size_type associative_count_( container , key) AssociativeCount_ iterator associative_lower_bound_( container , key) Associative_Lower_Bound_ iterator associative_upper_bound_( container , key) Associative_Upper_Bound_ pair<iterator, iterator> associative_equal_range_(
+ Table 11.6. STL associative container methods
Associative container methods in container.hpp Functor iterator insert_(container, pos, value) Insert_ void insert_( container , first, last) Insert_ pair<iterator, bool> insert_( container , value) Insert_ void associative_erase_( container , pos) Associative_Erase_ void associative_erase_( container , first, last) Associative_Erase_ size_type associative_erase_( container , key) Associative_Erase_ iterator associative_find_( container , key) Associative_Find_ size_type associative_count_( container , key) AssociativeCount_ iterator associative_lower_bound_( container , key) Associative_Lower_Bound_ iterator associative_upper_bound_( container , key) Associative_Upper_Bound_ pair<iterator, iterator> associative_equal_range_(
container , key) Associative_Equal_Range_
-
Table 11.7. STL pair
std::pair in container.hpp Functor first_type first_(pair<T1, T2>) First_ second_type second_(pair<T1, T2>) Second_
+
Table 11.7. STL pair
std::pair in container.hpp Functor first_type first_(pair<T1, T2>) First_ second_type second_(pair<T1, T2>) Second_
-
Table 11.8. STL string
(Fsm& fsm,Event const&
evt,SourceState&,TargetState,AllStates&)
- ; ActionSequence_
This functor calls every element of the template Sequence (which are also
callable functors) in turn. It is also the underlying implementation of the
- eUML sequence grammar (action1,action2,...).
methods
This helper functor is made for use in a transition table and in a
+ eUML sequence grammar (action1,action2,...).
methods
This helper functor is made for use in a transition table and in a
state behavior and therefore implements an operator() with 3 and with 4
arguments:
template <class Evt,class Fsm,class
@@ -65,13 +65,13 @@
template <class Evt,class Fsm,class State>
operator()();
Evt const&, Fsm&, State&;
-
msm/front/internal_row.hpp
This header implements the internal transition rows for use inside an
+ TargetState&;
msm/front/internal_row.hpp
This header implements the internal transition rows for use inside an
internal_transition_table. All these row types have no source or target state,
as the backend will recognize internal transitions from this
- internal_transition_table.
methods
Like any other front-end, the following transition row types implements
+ internal_transition_table.
methods
Like any other front-end, the following transition row types implements
the two necessary static functions for action and guard call. Each function
receives as parameter the (deepest-level) state machine processsing the
event, the event itself, the source and target states and all the states
@@ -83,30 +83,30 @@
class AllStates> static bool guard_call(
);
(Fsm& fsm,Event const&
evt,SourceState&,TargetState,AllStates&)
- ; a_internal
g_internal
This is an internal transition with a guard called before the transition
- and allowing the transition if returning true.
internal
This is an internal transition with a guard called before the transition
and allowing the transition if returning true. It also calls an action
- called during the transition.
definition
template< class Event, class CalledForAction, void
+ called during the transition.definition
template< class Event, class CalledForAction, void
(CalledForAction::*action)(Event const&), class
CalledForGuard, bool (CalledForGuard::*guard)(Event const&)>
- internal {
}
template parameters
Event: the event triggering the internal transition
CalledForAction: the type on which the action method will
be called. It can be either a state of the containing state
machine or the state machine itself.
action: a pointer to the method which CalledForAction
@@ -114,15 +114,15 @@
called. It can be either a state of the containing state
machine or the state machine itself.
guard: a pointer to the method which CalledForGuard
provides.
-
msm/front/row2.hpp
This header contains the variants of row2, which are an extension of the
standard row transitions for use in the transition table. They offer the
possibility to define action and guard not only in the state machine, but in any
state of the state machine. They can also be used in internal transition tables
- through their irow2 variants.
methods
Like any other front-end, the following transition row types implements
+ through their irow2 variants.
methods
Like any other front-end, the following transition row types implements
the two necessary static functions for action and guard call. Each function
receives as parameter the (deepest-level) state machine processsing the
event, the event itself, the source and target states and all the states
@@ -134,28 +134,28 @@
class AllStates> static bool guard_call(
);
(Fsm& fsm,Event const&
evt,SourceState&,TargetState,AllStates&)
- ; a_row2
This is a transition with action and without guard.
definition
template< class Source, class Event, class Target,
{
}
class CalledForAction, void
- (CalledForAction::*action)(Event const&) > _row2 {
}
template parameters
Event: the event triggering the transition.
Source: the source state of the transition.
Target: the target state of the transition.
CalledForAction: the type on which the action method will
be called. It can be either a state of the containing state
machine or the state machine itself.
action: a pointer to the method which CalledForAction
provides.
-
g_row2
This is a transition with guard and without action.
definition
template< class Source, class Event, class Target,
{
}
class CalledForGuard, bool (CalledForGuard::*guard)(Event
- const&) > _row2 {
}
template parameters
Event: the event triggering the transition.
Source: the source state of the transition.
Target: the target state of the transition.
CalledForGuard: the type on which the guard method will be
called. It can be either a state of the containing state
machine or the state machine itself.
guard: a pointer to the method which CalledForGuard
provides.
-
row2
This is a transition with guard and action.
definition
template< class Source, class Event, class Target,
{
}
class CalledForAction, void
(CalledForAction::*action)(Event const&), {
}
class CalledForGuard, bool (CalledForGuard::*guard)(Event
- const&) > _row2 {
}
template parameters
Event: the event triggering the transition.
Source: the source state of the transition.
Target: the target state of the transition.
CalledForAction: the type on which the action method will
be called. It can be either a state of the containing state
machine or the state machine itself.
action: a pointer to the method which CalledForAction
@@ -163,24 +163,24 @@
called. It can be either a state of the containing state
machine or the state machine itself.
guard: a pointer to the method which CalledForGuard
provides.
-
a_irow2
This is an internal transition for use inside a transition table, with
- action and without guard.
a_irow2
This is an internal transition for use inside a transition table, with
+ action and without guard.
definition
template< class Source, class Event, {
}
class CalledForAction, void
+ (CalledForAction::*action)(Event const&) > _row2 {
}
template parameters
Event: the event triggering the transition.
Source: the source state of the transition.
CalledForAction: the type on which the action method will
be called. It can be either a state of the containing state
machine or the state machine itself.
action: a pointer to the method which CalledForAction
provides.
-
g_irow2
This is an internal transition for use inside a transition table, with
- guard and without action.
g_irow2
This is an internal transition for use inside a transition table, with
+ guard and without action.
definition
template< class Source, class Event, {
}
class CalledForGuard, bool (CalledForGuard::*guard)(Event
+ const&) > _row2 {
}
template parameters
Event: the event triggering the transition.
Source: the source state of the transition.
CalledForGuard: the type on which the guard method will be
called. It can be either a state of the containing state
machine or the state machine itself.
guard: a pointer to the method which CalledForGuard
provides.
-
irow2
This is an internal transition for use inside a transition table, with
+ guard and action.
definition
template< class Source, class Event, {
}
class CalledForAction, void
(CalledForAction::*action)(Event const&), {
}
class CalledForGuard, bool (CalledForGuard::*guard)(Event
- const&) > _row2 {
}
template parameters
Event: the event triggering the transition.
Source: the source state of the transition.
CalledForAction: the type on which the action method will
be called. It can be either a state of the containing state
machine or the state machine itself.
action: a pointer to the method which CalledForAction
@@ -188,16 +188,16 @@
called. It can be either a state of the containing state
machine or the state machine itself.
guard: a pointer to the method which CalledForGuard
provides.
-
msm/front/state_machine_def.hpp
This header provides the implementation of the basic front-end. It contains one
- type, state_machine_def
msm/front/state_machine_def.hpp
This header provides the implementation of the basic front-end. It contains one
+ type, state_machine_def
state_machine_def definition
This type is the basic class for a basic (or possibly any other)
front-end. It provides the standard row types (which includes internal
transitions) and a default implementation of the required methods and
typedefs.
template <class Derived,class BaseState =
- default_base_state> state_machine_def {
}
typedefs
+ default_base_state> state_machine_def {
}
typedefs
flag_list: by default, no flag is set in the state
machine
deferred_events: by default, no event is deferred.
configuration: by default, no configuration customization
is done.
-
row methods
Like any other front-end, the following transition row types
implements the two necessary static functions for action and guard call.
Each function receives as parameter the (deepest-level) state machine
processsing the event, the event itself, the source and target states
@@ -209,30 +209,30 @@
class AllStates> static bool guard_call(
);
(Fsm& fsm,Event const&
evt,SourceState&,TargetState,AllStates&)
- ; a_row
This is a transition with action and without guard.
template< class Source, class Event, class Target,
+ ;
a_row
This is a transition with action and without guard.
template< class Source, class Event, class Target,
void (Derived::*action)(Event const&) > a_row
Event: the event triggering the transition.
Source: the source state of the transition.
Target: the target state of the transition.
action: a pointer to the method provided by the concrete
- front-end (represented by Derived).
g_row
This is a transition with guard and without action.
template< class Source, class Event, class Target,
+ front-end (represented by Derived).
g_row
This is a transition with guard and without action.
template< class Source, class Event, class Target,
bool (Derived::*guard)(Event const&) > g_row
Event: the event triggering the transition.
Source: the source state of the transition.
Target: the target state of the transition.
guard: a pointer to the method provided by the concrete
- front-end (represented by Derived).
row
This is a transition with guard and action.
template< class Source, class Event, class Target,
+ front-end (represented by Derived).
row
This is a transition with guard and action.
template< class Source, class Event, class Target,
void (Derived::*action)(Event const&), bool
(Derived::*guard)(Event const&) > row
Event: the event triggering the transition.
Source: the source state of the transition.
Target: the target state of the transition.
action: a pointer to the method provided by the concrete
front-end (represented by Derived).
guard: a pointer to the method provided by the concrete
- front-end (represented by Derived).
_row
This is a transition without action or guard. The state machine only
+ front-end (represented by Derived).
_row
This is a transition without action or guard. The state machine only
changes active state.
template< class Source, class Event, class Target >
- _row
Event: the event triggering the transition.
Source: the source state of the transition.
Target: the target state of the transition.
a_irow
This is an internal transition for use inside a transition table, with
+ _row
Event: the event triggering the transition.
Source: the source state of the transition.
Target: the target state of the transition.
a_irow
This is an internal transition for use inside a transition table, with
action and without guard.
template< class Source, class Event, void
(Derived::*action)(Event const&) > a_irow
Event: the event triggering the transition.
Source: the source state of the transition.
action: a pointer to the method provided by the concrete
- front-end (represented by Derived).
g_irow
This is an internal transition for use inside a transition table, with
+ front-end (represented by Derived).
g_irow
This is an internal transition for use inside a transition table, with
guard and without action.
template< class Source, class Event, bool
(Derived::*guard)(Event const&) > g_irow
Event: the event triggering the transition.
Source: the source state of the transition.
guard: a pointer to the method provided by the concrete
- front-end (represented by Derived).
irow
This is an internal transition for use inside a transition table, with
+ front-end (represented by Derived).
irow
This is an internal transition for use inside a transition table, with
guard and action.
template< class Source, class Event, void
(Derived::*action)(Event const&), bool
(Derived::*guard)(Event const&) > irow
Event: the event triggering the transition.
Source: the source state of the transition.
action: a pointer to the method provided by the concrete
front-end (represented by Derived).
guard: a pointer to the method provided by the concrete
- front-end (represented by Derived).
_irow
This is an internal transition without action or guard. As it does
+ front-end (represented by Derived).
_irow
This is an internal transition without action or guard. As it does
nothing, it means "ignore event".
template< class Source, class Event >
- _irow
Event: the event triggering the transition.
Source: the source state of the transition.
methods
state_machine_def provides a default implementation in
+ _irow
Event: the event triggering the transition.
Source: the source state of the transition.
methods
state_machine_def provides a default implementation in
case of an event which cannot be processed by a state machine (no
transition found). The implementation is using a
BOOST_ASSERT so that the error will only be noticed in
@@ -256,19 +256,19 @@
(Event const& ,Fsm&,
std::exception&)
;
-
msm/front/states.hpp
This header provides the different states (except state machines) for the
- basic front-end (or mixed with other front-ends).
msm/front/states.hpp
This header provides the different states (except state machines) for the
+ basic front-end (or mixed with other front-ends).
types
This header provides the following types:
no_sm_ptr
deprecated: default policy for states. It means that states do not
+ need to save a pointer to their containing state machine.
sm_ptr
deprecated: state policy. It means that states need to save a pointer
to their containing state machine. When seeing this flag, the back-end
- will call set_sm_ptr(fsm*) and give itself as argument.
state
Basic type for simple states. Inherit from this type to define a
+ will call set_sm_ptr(fsm*) and give itself as argument.
state
Basic type for simple states. Inherit from this type to define a
simple state. The first argument is needed if you want your state (and
all others used in a concrete state machine) to inherit a basic type for
logging or providing a common behavior.
template<class Base = default_base_state,class
- SMPtrPolicy = no_sm_ptr> state {
}
terminate_state
Basic type for terminate states. Inherit from this type to define a
+ SMPtrPolicy = no_sm_ptr> state {
}
terminate_state
Basic type for terminate states. Inherit from this type to define a
terminate state. The first argument is needed if you want your state
(and all others used in a concrete state machine) to inherit a basic
type for logging or providing a common behavior.
template<class Base = default_base_state,class
- SMPtrPolicy = no_sm_ptr> terminate_state {
}
interrupt_state
Basic type for interrupt states. Interrupt states prevent any further
+ SMPtrPolicy = no_sm_ptr> terminate_state {
}
interrupt_state
Basic type for interrupt states. Interrupt states prevent any further
event handling until EndInterruptEvent is sent. Inherit from this type
to define a terminate state. The first argument is the name of the event
ending the interrupt. The second argument is needed if you want your
@@ -276,11 +276,11 @@
basic type for logging or providing a common behavior.
The EndInterruptEvent can also be a sequence of events:
mpl::vector<EndInterruptEvent,EndInterruptEvent2>.
template<class EndInterruptEvent,class Base =
default_base_state, {
}
class SMPtrPolicy = no_sm_ptr>
- interrupt_state {
}
explicit_entry
Inherit from this type in
addition to the desired state type to enable this state
for direct entering. The template parameter gives the region id of the
state (regions are numbered in the order of the
- initial_state typedef).
template <int ZoneIndex=-1> explicit_entry {
}
entry_pseudo_state
Basic type for entry pseudo states. Entry pseudo states are an
+ initial_state typedef).
template <int ZoneIndex=-1> explicit_entry {
}
entry_pseudo_state
Basic type for entry pseudo states. Entry pseudo states are an
predefined entry into a submachine and connect two transitions. The
first argument is the id of the region entered by this state (regions
are numbered in the order of the initial_state typedef).
@@ -288,7 +288,7 @@
used in a concrete state machine) to inherit a basic type for logging or
providing a common behavior.
template<int RegionIndex=-1,class Base =
default_base_state, {
}
class SMPtrPolicy = no_sm_ptr>
- entry_pseudo_state {
}
exit_pseudo_state
Basic type for exit pseudo states. Exit pseudo states are an
+ entry_pseudo_state {
}
exit_pseudo_state
Basic type for exit pseudo states. Exit pseudo states are an
predefined exit from a submachine and connect two transitions. The first
argument is the name of the event which will be "thrown" out of the exit
point. This event does not need to be the same as the one sent by the
@@ -297,32 +297,32 @@
machine) to inherit a basic type for logging or providing a common
behavior.
template<class Event,class Base =
default_base_state, {
}
class SMPtrPolicy = no_sm_ptr>
- exit_pseudo_state {
}
msm/front/euml/stl.hpp
This header includes all the functors for STL support in eUML. These tables show a full description.
msm/front/euml/algorithm.hpp
This header includes all the functors for STL algorithms support in eUML.
+ exit_pseudo_state {
}
msm/front/euml/stl.hpp
This header includes all the functors for STL support in eUML. These tables show a full description.
msm/front/euml/algorithm.hpp
This header includes all the functors for STL algorithms support in eUML.
These tables show a full
- description.
msm/front/euml/iteration.hpp
This header includes iteration functors for STL support in eUML. This tables shows a full
- description.
msm/front/euml/querying.hpp
This header includes querying functors for STL support in eUML. This tables shows a full
- description.
msm/front/euml/transformation.hpp
This header includes transformation functors for STL support in eUML. This
+ description.
msm/front/euml/iteration.hpp
This header includes iteration functors for STL support in eUML. This tables shows a full
+ description.
msm/front/euml/querying.hpp
This header includes querying functors for STL support in eUML. This tables shows a full
+ description.
msm/front/euml/transformation.hpp
This header includes transformation functors for STL support in eUML. This
tables shows a full
- description.
msm/front/euml/container.hpp
This header includes container functors for STL support in eUML (functors
+ description.
msm/front/euml/container.hpp
This header includes container functors for STL support in eUML (functors
calling container methods). This tables shows a full description. It also provides npos for
- strings.
msm/front/euml/stt_grammar.hpp
This header provides the transition table grammars. This includes internal
- transition tables.
msm/front/euml/stt_grammar.hpp
This header provides the transition table grammars. This includes internal
+ transition tables.
functions
build_stt
The function build_stt evaluates the grammar-conform expression as
parameter. It returns a transition table, which is a mpl::vector of
transitions (rows) or, if the expression is ill-formed (does not match
the grammar), the type invalid_type, which will lead to a
compile-time static assertion when this transition table is passed to a
state machine.
template<class Expr> [mpl::vector<...> /
- msm::front::euml::invalid_type] build_stt();
Expr const& expr; );
Expr const& expr; build_internal_stt
The function build_internal_stt evaluates the grammar-conform
expression as parameter. It returns a transition table, which is a
mpl::vector of transitions (rows) or, if the expression is ill-formed
(does not match the grammar), the type invalid_type, which
will lead to a compile-time static assertion when this transition table
is passed to a state machine.
template<class Expr> [mpl::vector<...> /
- msm::front::euml::invalid_type] build_internal_stt();
Expr const& expr; );
Expr const& expr; grammars
transition
table
The transition table accepts the following grammar:
Stt := Row | (Stt ',' Stt)
Row := (Target '==' (SourcePlusEvent)) /* first syntax*/
| ( (SourcePlusEvent) '==' Target ) /* second syntax*/
@@ -347,15 +347,15 @@ target == source + event / action,
source + event /action == target,
source / action == target, /*anonymous transition*/
target == source / action, /*anonymous transition*/
-source + event /action, /* internal transition*/msm/front/euml/guard_grammar.hpp
This header contains the Guard grammar used in the previous
section. This grammar is long but pretty simple:
Guard := action_tag | (Guard '&&' Guard)
| (Guard '||' Guard) | ... /* operators*/
| (if_then_else_(Guard,Guard,Guard)) | (function (Action,...Action))Most C++ operators are supported (address-of is not). With
function is meant any eUML predefined function or any self-made
(using MSM_EUML_METHOD or MSM_EUML_FUNCTION). Action
- is a grammar defined in state_grammar.hpp.
msm/front/euml/state_grammar.hpp
This header provides the grammar for actions and the different grammars and
- functions to build states using eUML.
action grammar
Like the guard grammar, this grammar supports relevant C++ operators and
+ is a grammar defined in state_grammar.hpp.
msm/front/euml/state_grammar.hpp
This header provides the grammar for actions and the different grammars and
+ functions to build states using eUML.
action grammar
Like the guard grammar, this grammar supports relevant C++ operators and
eUML functions:
Action := action_tag | (Action '+' Action)
| ('--' Action) | ... /* operators*/
| if_then_else_(Guard,Action,Action) | if_then_(Action)
@@ -364,10 +364,10 @@ source + event /action, /* internal transition*/attributes
This grammar is used to add attributes to states (or state machines) or
+ ^(bitwise), +=, -=, *=, /=, %=, <<=, >>=, <<, >>, =, [].
attributes
This grammar is used to add attributes to states (or state machines) or
events: It evaluates to a fusion::map. You can use two forms:
attributes_ << no_attributes_
attributes_ << attribute_1 << ... <<
attribute_n
Attributes can be of any default-constructible type (fusion
- requirement).
configure
This grammar also has two forms:
configure_ << no_configure_
configure_ << type_1 << ... <<
+ requirement).
configure
This grammar also has two forms:
configure_ << no_configure_
configure_ << type_1 << ... <<
type_n
This grammar is used to create inside one syntax:
flags: configure_ << some_flag where
some_flag inherits from euml_flag<some_flag> or
is defined using BOOST_MSM_EUML_FLAG.
deferred events: configure_ << some_event
@@ -379,12 +379,12 @@ ActionSequence := Action | (Action ',' Action)
Relevant operators are: +
some_config inherits from
euml_config<some_config>. At the moment,
three predefined objects exist (in msm//front/euml/common.hpp):
no_exception: disable catching exceptions
no_msg_queue: disable message queue
deferred_events: manually enable handling of
- deferred events
initial states
The grammar to define initial states for a state machine is: init_
<< state_1 << ... << state_n where
state_1...state_n inherit from euml_state or is defined using
BOOST_MSM_EUML_STATE, BOOST_MSM_EUML_INTERRUPT_STATE,
BOOST_MSM_EUML_TERMINATE_STATE, BOOST_MSM_EUML_EXPLICIT_ENTRY_STATE,
- BOOST_MSM_EUML_ENTRY_STATE or BOOST_MSM_EUML_EXIT_STATE.
functions
build_sm
This function has several overloads. The return type is not relevant
+ BOOST_MSM_EUML_ENTRY_STATE or BOOST_MSM_EUML_EXIT_STATE.
functions
build_sm
This function has several overloads. The return type is not relevant
to you as only decltype (return type) is what one needs.
Defines a state machine without entry or exit:
template <class StateNameTag,class Stt,class Init>
func_state_machine<...> build_sm();
Stt ,Init; Defines a state machine with entry behavior:
template <class StateNameTag,class Stt,class Init,class
Expr1> func_state_machine<...> build_sm();
Stt ,Init,Expr1 const&; Defines a state machine with entry and exit behaviors:
template <class StateNameTag,class Stt,class Init,class
@@ -403,7 +403,7 @@ ActionSequence := Action | (Action ',' Action)Relevant operators are: +
Base> func_state_machine<...> build_sm(
);
Stt ,Init,Expr1 const&, Expr2 const&, Attributes
const&, Configure const&, Base; Notice that this function requires the extra parameter class
StateNameTag to disambiguate state machines having the same parameters
- but still being different.
build_state
This function has several overloads. The return type is not relevant
+ but still being different.
build_state
This function has several overloads. The return type is not relevant
to you as only decltype (return type) is what one needs.
Defines a simple state without entry or exit:
func_state<class StateNameTag,...> build_state();
; Defines a simple state with entry behavior:
template <class StateNameTag,class Expr1>
func_state<...> build_state();
Expr1 const&; Defines a simple state with entry and exit behaviors:
template <class StateNameTag,class Expr1, class Expr2>
func_state<...> build_state();
Expr1 const&,Expr2 const&; Defines a simple state with entry, exit behaviors and
@@ -419,7 +419,7 @@ ActionSequence := Action | (Action ',' Action)
Relevant operators are: +
func_state<...> build_state(
);
Expr1 const&, Expr2 const&, Attributes const&,
Configure const&, Base; Notice that this function requires the extra parameter class
StateNameTag to disambiguate states having the same parameters but still
- being different.
build_interrupt_state
This function has several overloads. The return type is not relevant
+ being different.
build_interrupt_state
This function has several overloads. The return type is not relevant
to you as only decltype (return type) is what one needs.
Defines an interrupt state without entry or exit:
template <class StateNameTag,class EndInterruptEvent>
func_state<...> build_interrupt_state();
EndInterruptEvent const&; Defines an interrupt state with entry behavior:
template <class StateNameTag,class
EndInterruptEvent,class Expr1> func_state<...>
@@ -444,7 +444,7 @@ ActionSequence := Action | (Action ',' Action)Relevant operators are: +
const&, Attributes const&, Configure const&,
Base
; Notice that this function requires the extra parameter class
StateNameTag to disambiguate states having the same parameters but still
- being different.
build_entry_state
This function has several overloads. The return type is not relevant
+ being different.
build_entry_state
This function has several overloads. The return type is not relevant
to you as only decltype (return type) is what one needs.
Defines an entry pseudo state without entry or exit:
template <class StateNameTag,int RegionIndex>
entry_func_state<...> build_entry_state();
; Defines an entry pseudo state with entry behavior:
template <class StateNameTag,int RegionIndex,class
Expr1> entry_func_state<...> build_entry_state();
Expr1 const&; Defines an entry pseudo state with entry and exit behaviors:
template <class StateNameTag,int RegionIndex,class
@@ -463,7 +463,7 @@ ActionSequence := Action | (Action ',' Action)Relevant operators are: +
Base> entry_func_state<...> build_entry_state(
);
Expr1 const&, Expr2 const&, Attributes const&,
Configure const&, Base; Notice that this function requires the extra parameter class
StateNameTag to disambiguate states having the same parameters but still
- being different.
build_exit_state
This function has several overloads. The return type is not relevant
+ being different.
build_exit_state
This function has several overloads. The return type is not relevant
to you as only decltype (return type) is what one needs.
Defines an exit pseudo state without entry or exit:
template <class StateNameTag,class Event>
exit_func_state<...> build_exit_state();
Event const&; Defines an exit pseudo state with entry behavior:
template <class StateNameTag,class Event,class Expr1>
exit_func_state<...> build_exit_state();
Event const&,Expr1 const&; Defines an exit pseudo state with entry and exit behaviors:
template <class StateNameTag,class Event,class Expr1,
@@ -482,8 +482,8 @@ ActionSequence := Action | (Action ',' Action)Relevant operators are: +
exit_func_state<...> build_exit_state(
);
Event const&,Expr1 const&, Expr2 const&,
Attributes const&, Configure const&, Base; Notice that this function requires the extra parameter class
StateNameTag to disambiguate states having the same parameters but still
- being different.
build_explicit_entry_state
This function has the same overloads as build_entry_state and
- explicit_entry_func_state as return type.
msm/front/euml/common.hpp
msm/front/euml/common.hpp
types
euml_event
The basic type for events with eUML.
template <class EventName> euml_event; {
}
struct play : euml_event<play>{};euml_state
The basic type for states with eUML. You will usually not use this
type directly as it is easier to use BOOST_MSM_EUML_STATE,
BOOST_MSM_EUML_INTERRUPT_STATE, BOOST_MSM_EUML_TERMINATE_STATE,
BOOST_MSM_EUML_EXPLICIT_ENTRY_STATE, BOOST_MSM_EUML_ENTRY_STATE or
@@ -494,7 +494,7 @@ ActionSequence := Action | (Action ',' Action)
Relevant operators are: +
void foo() {...}
template <class Event,class Fsm>
void on_entry(Event const& evt,Fsm& fsm){...}
-};
euml_flag
The basic type for flags with eUML.
template <class FlagName> euml_flag; {
}
struct PlayingPaused: euml_flag<PlayingPaused>{};euml_flag
The basic type for flags with eUML.
template <class FlagName> euml_flag; {
}
struct PlayingPaused: euml_flag<PlayingPaused>{};euml_action
The basic type for state or transition behaviors and guards with
eUML.
template <class AcionName> euml_action; {
}
struct close_drawer : euml_action<close_drawer>
{
template <class Fsm,class Evt,class SourceState,class TargetState>
@@ -503,41 +503,41 @@ ActionSequence := Action | (Action ',' Action)Relevant operators are: +
{
template <class Event,class Fsm,class State>
void operator()(Event const&,Fsm& fsm,State& ){...}
-};
euml_config
The basic type for configuration possibilities with eUML.
template <class ConfigName> euml_config; {
}
You normally do not use this type directly but instead the instances
+};
euml_config
The basic type for configuration possibilities with eUML.
template <class ConfigName> euml_config; {
}
You normally do not use this type directly but instead the instances
of predefined configuration:
no_exception: disable catching exceptions
no_msg_queue: disable message queue. The message queue
allows you to send an event for procesing while in an event
processing.
deferred_events: manually enable handling of deferred
- events
invalid_type
Type returned by grammar parsers if the grammar is invalid. Seeing
- this type will result in a static assertion.
no_action
Placeholder type for use in entry/exit or transition behaviors, which
- does absolutely nothing.
source_
Generic object or function for the source state of a given transition:
as object: returns by reference the source state of a
+ events
invalid_type
Type returned by grammar parsers if the grammar is invalid. Seeing
+ this type will result in a static assertion.
no_action
Placeholder type for use in entry/exit or transition behaviors, which
+ does absolutely nothing.
source_
Generic object or function for the source state of a given transition:
as object: returns by reference the source state of a
transition, usually to be used by another function (usually
one created by MSM_EUML_METHOD or MSM_EUML_FUNCTION).
Example:
some_user_function_(source_)
as function: returns by reference the attribute passed as
parameter.
Example:
-
source_(m_counter)++
target_
Generic object or function for the target state of a given transition:
as object: returns by reference the target state of a
+
source_(m_counter)++
target_
Generic object or function for the target state of a given transition:
as object: returns by reference the target state of a
transition, usually to be used by another function (usually
one created by MSM_EUML_METHOD or MSM_EUML_FUNCTION).
Example:
some_user_function_(target_)
as function: returns by reference the attribute passed as
parameter.
Example:
-
target_(m_counter)++
state_
Generic object or function for the state of a given entry / exit
behavior. state_ means source_ while in the context of an exit behavior
and target_ in the context of an entry behavior:
as object: returns by reference the current state, usually
to be used by another function (usually one created by
MSM_EUML_METHOD or MSM_EUML_FUNCTION).
Example:
some_user_function_(state_) // calls some_user_function on the current state
as function: returns by reference the attribute passed as
parameter.
Example:
-
state_(m_counter)++
event_
Generic object or function for the event triggering a given transition
(valid in a transition behavior, as well as in state entry/exit behaviors):
as object: returns by reference the event of a transition,
usually to be used by another function (usually one created
by MSM_EUML_METHOD or MSM_EUML_FUNCTION).
Example:
some_user_function_(event_)
as function: returns by reference the attribute passed as
parameter.
Example:
-
event_(m_counter)++
fsm_
Generic object or function for the state machine containing a given transition:
as object: returns by reference the event of a transition,
+
event_(m_counter)++
fsm_
Generic object or function for the state machine containing a given transition:
as object: returns by reference the event of a transition,
usually to be used by another function (usually one created
by MSM_EUML_METHOD or MSM_EUML_FUNCTION).
Example:
some_user_function_(fsm_)
as function: returns by reference the attribute passed as
parameter.
Example:
-
fsm_(m_counter)++
substate_
Generic object or function returning a state of a given state machine:
with 1 parameter: returns by reference the state passed as
+
fsm_(m_counter)++
substate_
Generic object or function returning a state of a given state machine:
with 1 parameter: returns by reference the state passed as
parameter, usually to be used by another function (usually
one created by MSM_EUML_METHOD or MSM_EUML_FUNCTION).
Example:
some_user_function_(substate_(my_state))
with 2 parameters: returns by reference the state passed
@@ -545,46 +545,46 @@ ActionSequence := Action | (Action ',' Action)
Relevant operators are: +
parameter, usually to be used by another function (usually
one created by MSM_EUML_METHOD or MSM_EUML_FUNCTION). This
makes sense when used in combination with attribute_.
Example (equivalent to the previous example):
-
some_user_function_(substate_(my_state,fsm_))
attribute_
Generic object or function returning the attribute passed (by name) as
+
some_user_function_(substate_(my_state,fsm_))
attribute_
Generic object or function returning the attribute passed (by name) as
second parameter of the thing passed as first (a state, event or state
machine). Example:
attribute_(substate_(my_state),cd_name_attribute)++
-
True_
Functor returning true for transition or state behaviors. Like all
constants, only the functor form exists, so parenthesis are necessary.
Example:
if_then_(True_(),/* some action always called*/)
-
False_
Functor returning false for transition or state behaviors. Like all
constants, only the functor form exists, so parenthesis are necessary.
Example:
if_then_(False_(),/* some action never called */)
-
Int_<int value>
Functor returning an integer value for transition or state behaviors.
Like all constants, only the functor form exists, so parenthesis are
necessary. Example:
target_(m_ringing_cpt) = Int_<RINGING_TIME>() // RINGING_TIME is a constant
-
Char_<char value>
Functor returning a char value for transition or state behaviors. Like
all constants, only the functor form exists, so parenthesis are
necessary. Example:
// look for 'S' in event.m_song
[string_find_(event_(m_song),Char_<'S'>(),Size_t_<0>()) != Npos_<string>()]
-
Size_t_<size_t value>
Functor returning a size_t value for transition or state behaviors.
Like all constants, only the functor form exists, so parenthesis are
necessary. Example:
substr_(event_(m_song),Size_t_<1>()) // returns a substring of event.m_song
-
String_ < mpl::string >
Functor returning a string for transition or state behaviors. Like all
constants, only the functor form exists, so parenthesis are necessary.
Requires boost >= 1.40 for mpl::string.
Example:
// adds "Let it be" to fsm.m_src_container
push_back_(fsm_(m_src_container), String_<mpl::string<'Let','it ','be'> >())
-
Predicate_ < some_stl_compatible_functor >
This functor eUML-enables a STL functor (for use in an algorithm).
+
Predicate_ < some_stl_compatible_functor >
This functor eUML-enables a STL functor (for use in an algorithm).
This is necessary because all what is in the transition table must be a
eUML terminal.
Example:
//equivalent to:
//std::accumulate(fsm.m_vec.begin(),fsm.m_vec.end(),1,std::plus<int>())== 1
accumulate_(begin_(fsm_(m_vec)),end_(fsm_(m_vec)),Int_<1>(),
- Predicate_<std::plus<int> >()) == Int_<1>())
process_
This function sends an event to up to 4 state machines by calling
+ Predicate_<std::plus<int> >()) == Int_<1>())
process_
This function sends an event to up to 4 state machines by calling
process_event on them:
process_(some_event) : processes an event in
the current (containing) state machine.
process_(some_event [,fsm1...fsm4] ) :
processes the same event in the 1-4 state machines passed as
- argument.
process2_
This function sends an event to up to 3 state machines by calling
process_event on them and copy-constructing the event
from the data passed as second parameter:
process2_(some_event, some_data) : processes
an event in the current (containing) state machine.
process2_(some_event, some_data [,fsm1...fsm3]
@@ -594,24 +594,24 @@ accumulate_(begin_(fsm_(m_vec)),end_(fsm_(m_vec)),Int_<1>(),
// copy-constructed with event.m_song
process2_(NotFound,event_(m_song))
With the following definitions:
BOOST_MSM_EUML_DECLARE_ATTRIBUTE(std::string,m_song)//declaration of m_song
-NotFound (const string& data) // copy-constructor of NotFound
is_flag_
This function tells if a flag is active by calling
+NotFound (const string& data) // copy-constructor of NotFound
is_flag_
This function tells if a flag is active by calling
is_flag_active on the current state machine or one
passed as parameter:
is_flag_(some_flag) : calls
is_flag_active on the current (containing)
state machine.
is_flag_(some_flag, some_fsm) :calls
is_flag_active on the state machine.passed
- as argument.
defer_
This object defers the current event by calling
defer_event on the current state machine.
- Example:
Empty() + play() / defer_
explicit_(submachine-name,state-name)
Used as transition's target, causes an explicit entry into the given
+ Example:
Empty() + play() / defer_
explicit_(submachine-name,state-name)
Used as transition's target, causes an explicit entry into the given
state from the given submachine. Several explicit_ as targets, separated
by commas, means a fork. The state must have been declared as such using
- BOOST_MSM_EUML_EXPLICIT_ENTRY_STATE.
entry_pt_(submachine-name,state-name)
Used as transition's target from a containing state machine, causes
+ BOOST_MSM_EUML_EXPLICIT_ENTRY_STATE.
entry_pt_(submachine-name,state-name)
Used as transition's target from a containing state machine, causes
submachine-name to be entered using the given entry pseudo-state. This
state must have been declared as pseudo entry using
- BOOST_MSM_EUML_ENTRY_STATE.
exit_pt_(submachine-name,state-name)
Used as transition's source from a containing state machine, causes
+ BOOST_MSM_EUML_ENTRY_STATE.
exit_pt_(submachine-name,state-name)
Used as transition's source from a containing state machine, causes
submachine-name to be left using the given exit pseudo-state. This state
must have been declared as pseudo exit using
- BOOST_MSM_EUML_EXIT_STATE.
MSM_EUML_FUNCTION
This macro creates a eUML function and a functor for use with the
+ BOOST_MSM_EUML_EXIT_STATE.
MSM_EUML_FUNCTION
This macro creates a eUML function and a functor for use with the
functor front-end, based on a free function:
first parameter: the name of the functor
second parameter: the underlying function
third parameter: the eUML function name
fourth parameter: the return type if used in a transition
behavior
fifth parameter: the return type if used in a state
behavior (entry/exit)
Note that the function itself can take up to 5
@@ -619,7 +619,7 @@ NotFound (const string& data) // copy-constructor of NotFound
MSM_EUML_FUNCTION(BinarySearch_,std::binary_search,binary_search_,bool,bool)
Can be used like:
binary_search_(begin_(fsm_(m_var)),end_(fsm_(m_var)),Int_<9>())
-
MSM_EUML_METHOD
This macro creates a eUML function and a functor for use with the
functor front-end, based on a method:
first parameter: the name of the functor
second parameter: the underlying function
third parameter: the eUML function name
fourth parameter: the return type if used in a transition
behavior
fifth parameter: the return type if used in a state
behavior (entry/exit)
Note that the method itself can take up to 4 arguments
@@ -631,40 +631,40 @@ NotFound (const string& data) // copy-constructor of NotFound
Can be used like:
Empty == Open + open_close / (close_drawer , activate_empty_(target_))
-
BOOST_MSM_EUML_ACTION(action-instance-name)
This macro declares a behavior type and a const instance for use in
+
BOOST_MSM_EUML_ACTION(action-instance-name)
This macro declares a behavior type and a const instance for use in
state or transition behaviors. The action implementation itself follows
the macro declaration, for example:
BOOST_MSM_EUML_ACTION(good_disk_format)
{
template <class Fsm,class Evt,class SourceState,class TargetState>
void/bool operator()(Evt const& evt,Fsm&,SourceState& ,TargetState& ){...}
-};BOOST_MSM_EUML_FLAG(flag-instance-name)
This macro declares a flag type and a const instance for use in
- behaviors.
BOOST_MSM_EUML_FLAG_NAME(flag-instance-name)
This macro returns the name of the flag type generated by
+};
BOOST_MSM_EUML_FLAG(flag-instance-name)
This macro declares a flag type and a const instance for use in
+ behaviors.
BOOST_MSM_EUML_FLAG_NAME(flag-instance-name)
This macro returns the name of the flag type generated by
BOOST_MSM_EUML_FLAG. You need this where the type is required (usually
- with the back-end method is_flag_active). For example:
fsm.is_flag_active<BOOST_MSM_EUML_FLAG_NAME(CDLoaded)>()
BOOST_MSM_EUML_DECLARE_ATTRIBUTE(event-type,event-name)
This macro declares an attribute called event-name of type event-type.
+ with the back-end method is_flag_active). For example:
fsm.is_flag_active<BOOST_MSM_EUML_FLAG_NAME(CDLoaded)>()
BOOST_MSM_EUML_DECLARE_ATTRIBUTE(event-type,event-name)
This macro declares an attribute called event-name of type event-type.
This attribute can then be made part of an attribute list using
- BOOST_MSM_EUML_ATTRIBUTES.
BOOST_MSM_EUML_ATTRIBUTES(attributes-expression,attributes-name)
This macro declares an attribute list called attributes-name based on
+ BOOST_MSM_EUML_ATTRIBUTES.
BOOST_MSM_EUML_ATTRIBUTES(attributes-expression,attributes-name)
This macro declares an attribute list called attributes-name based on
the expression as first argument. These attributes can then be made part
of an event using BOOST_MSM_EUML_EVENT_WITH_ATTRIBUTES, of a state as
3rd parameter of BOOST_MSM_EUML_STATE or of a state machine as 5th
parameter of BOOST_MSM_EUML_DECLARE_STATE_MACHINE.
Attributes are added using left-shift, for example:
// m_song is of type std::string
BOOST_MSM_EUML_DECLARE_ATTRIBUTE(std::string,m_song)
// contains one attribute, m_song
-BOOST_MSM_EUML_ATTRIBUTES((attributes_ << m_song ), FoundDef)
BOOST_MSM_EUML_EVENT(event-instance name)
This macro defines an event type (event-instance-name_helper) and
+BOOST_MSM_EUML_ATTRIBUTES((attributes_ << m_song ), FoundDef)
BOOST_MSM_EUML_EVENT(event-instance name)
This macro defines an event type (event-instance-name_helper) and
declares a const instance of this event type called event-instance-name
- for use in a transition table or state behaviors.
BOOST_MSM_EUML_EVENT_WITH_ATTRIBUTES(event-instance-name,attributes)
This macro defines an event type (event-instance-name_helper) and
+ for use in a transition table or state behaviors.
BOOST_MSM_EUML_EVENT_WITH_ATTRIBUTES(event-instance-name,attributes)
This macro defines an event type (event-instance-name_helper) and
declares a const instance of this event type called event-instance-name
for use in a transition table or state behaviors. The event will have as
attributes the ones passed by the second argument:
BOOST_MSM_EUML_EVENT_WITH_ATTRIBUTES(Found,FoundDef)
The created event instance supports operator()(attributes) so that
my_back_end.process_event(Found(some_string))
- is possible.
BOOST_MSM_EUML_EVENT_NAME(event-instance-name)
This macro returns the name of the event type generated by
+ is possible.
BOOST_MSM_EUML_EVENT_NAME(event-instance-name)
This macro returns the name of the event type generated by
BOOST_MSM_EUML_EVENT or BOOST_MSM_EUML_EVENT_WITH_ATTRIBUTES. You need
this where the type is required (usually inside a back-end definition).
For example:
typedef msm::back::state_machine<Playing_,
msm::back::ShallowHistory<mpl::vector<BOOST_MSM_EUML_EVENT_NAME(end_pause)
> > > Playing_type;
-
BOOST_MSM_EUML_STATE(build-expression,state-instance-name)
This macro defines a state type (state-instance-name_helper) and
+
BOOST_MSM_EUML_STATE(build-expression,state-instance-name)
This macro defines a state type (state-instance-name_helper) and
declares a const instance of this state type called state-instance-name
for use in a transition table or state behaviors.
There are several possibilitites for the expression syntax:
(): state without entry or exit action.
(Expr1): state with entry but no exit action.
(Expr1,Expr2): state with entry and exit action.
(Expr1,Expr2,Attributes): state with entry and exit
action, defining some attributes.
(Expr1,Expr2,Attributes,Configure): state with entry and
@@ -673,7 +673,7 @@ msm::back::ShallowHistory<mpl::vector<BOOST_MSM_EUML_EVENT_NAME(end_pause)
events).
(Expr1,Expr2,Attributes,Configure,Base): state with entry
and exit action, defining some attributes, flags and
deferred events (plain msm deferred events) and a
- non-default base state (as defined in standard MSM).
BOOST_MSM_EUML_INTERRUPT_STATE(build-expression,state-instance-name)
This macro defines an interrupt state type
+ non-default base state (as defined in standard MSM).
BOOST_MSM_EUML_INTERRUPT_STATE(build-expression,state-instance-name)
This macro defines an interrupt state type
(state-instance-name_helper) and declares a const instance of this state
type called state-instance-name for use in a transition table or state
behaviors.
There are several possibilitites for the expression syntax. In all of
@@ -690,7 +690,7 @@ msm::back::ShallowHistory<mpl::vector<BOOST_MSM_EUML_EVENT_NAME(end_pause)
interrupt state with entry and exit action, defining some
attributes, flags and deferred events (plain msm deferred
events) and a non-default base state (as defined in standard
- MSM).
BOOST_MSM_EUML_TERMINATE_STATE(build-expression,state-instance-name)
This macro defines a terminate pseudo-state type
+ MSM).
BOOST_MSM_EUML_TERMINATE_STATE(build-expression,state-instance-name)
This macro defines a terminate pseudo-state type
(state-instance-name_helper) and declares a const instance of this state
type called state-instance-name for use in a transition table or state
behaviors.
There are several possibilitites for the expression syntax:
(): terminate pseudo-state without entry or exit
@@ -704,7 +704,7 @@ msm::back::ShallowHistory<mpl::vector<BOOST_MSM_EUML_EVENT_NAME(end_pause)
pseudo-state with entry and exit action, defining some
attributes, flags and deferred events (plain msm deferred
events) and a non-default base state (as defined in standard
- MSM).
BOOST_MSM_EUML_EXIT_STATE(build-expression,state-instance-name)
This macro defines an exit pseudo-state type
+ MSM).
BOOST_MSM_EUML_EXIT_STATE(build-expression,state-instance-name)
This macro defines an exit pseudo-state type
(state-instance-name_helper) and declares a const instance of this state
type called state-instance-name for use in a transition table or state
behaviors.
There are several possibilitites for the expression syntax:
(forwarded_event):exit pseudo-state without entry or exit
@@ -720,7 +720,7 @@ msm::back::ShallowHistory<mpl::vector<BOOST_MSM_EUML_EVENT_NAME(end_pause)
attributes, flags and deferred events (plain msm deferred
events) and a non-default base state (as defined in standard
MSM).
Note that the forwarded_event must be constructible from the event
- sent by the submachine containing the exit point.
BOOST_MSM_EUML_ENTRY_STATE(int
region-index,build-expression,state-instance-name)
This macro defines an entry pseudo-state type
(state-instance-name_helper) and declares a const instance of this state
type called state-instance-name for use in a transition table or state
@@ -735,7 +735,7 @@ msm::back::ShallowHistory<mpl::vector<BOOST_MSM_EUML_EVENT_NAME(end_pause)
pseudo-state with entry and exit action, defining some
attributes, flags and deferred events (plain msm deferred
events) and a non-default base state (as defined in standard
- MSM).
BOOST_MSM_EUML_EXPLICIT_ENTRY_STATE(int
region-index,build-expression,state-instance-name)
This macro defines a submachine's substate type
(state-instance-name_helper), which can be explicitly entered and also
declares a const instance of this state type called state-instance-name
@@ -746,28 +746,28 @@ msm::back::ShallowHistory<mpl::vector<BOOST_MSM_EUML_EVENT_NAME(end_pause)
events).
(Expr1,Expr2,Attributes,Configure,Base): state with entry
and exit action, defining some attributes, flags and
deferred events (plain msm deferred events) and a
- non-default base state (as defined in standard MSM).
BOOST_MSM_EUML_STATE_NAME(state-instance-name)
This macro returns the name of the state type generated by
+ non-default base state (as defined in standard MSM).
BOOST_MSM_EUML_STATE_NAME(state-instance-name)
This macro returns the name of the state type generated by
BOOST_MSM_EUML_STATE or other state macros. You need this where the type
is required (usually using a backend function). For example:
fsm.get_state<BOOST_MSM_EUML_STATE_NAME(StringFind)&>().some_state_function();
-
BOOST_MSM_EUML_DECLARE_STATE(build-expression,state-instance-name)
Like BOOST_MSM_EUML_STATE but does not provide an instance, simply a
- type declaration.
BOOST_MSM_EUML_DECLARE_INTERRUPT_STATE(build-expression,state-instance-name)
Like BOOST_MSM_EUML_INTERRUPT_STATE but does not provide an instance,
- simply a type declaration.
BOOST_MSM_EUML_DECLARE_TERMINATE_STATE(build-expression,state-instance-name)
Like BOOST_MSM_EUML_TERMINATE_STATE but does not provide an instance,
- simply a type declaration.
BOOST_MSM_EUML_DECLARE_EXIT_STATE(build-expression,state-instance-name)
Like BOOST_MSM_EUML_EXIT_STATE but does not provide an instance,
- simply a type declaration.
BOOST_MSM_EUML_DECLARE_STATE(build-expression,state-instance-name)
Like BOOST_MSM_EUML_STATE but does not provide an instance, simply a
+ type declaration.
BOOST_MSM_EUML_DECLARE_INTERRUPT_STATE(build-expression,state-instance-name)
Like BOOST_MSM_EUML_INTERRUPT_STATE but does not provide an instance,
+ simply a type declaration.
BOOST_MSM_EUML_DECLARE_TERMINATE_STATE(build-expression,state-instance-name)
Like BOOST_MSM_EUML_TERMINATE_STATE but does not provide an instance,
+ simply a type declaration.
BOOST_MSM_EUML_DECLARE_EXIT_STATE(build-expression,state-instance-name)
Like BOOST_MSM_EUML_EXIT_STATE but does not provide an instance,
+ simply a type declaration.
BOOST_MSM_EUML_DECLARE_ENTRY_STATE(int
region-index,build-expression,state-instance-name)
Like BOOST_MSM_EUML_ENTRY_STATE but does not provide an instance,
- simply a type declaration.
BOOST_MSM_EUML_DECLARE_EXPLICIT_ENTRY_STATE(int
region-index,build-expression,state-instance-name)
Like BOOST_MSM_EUML_EXPLICIT_ENTRY_STATE but does not provide an
- instance, simply a type declaration.
BOOST_MSM_EUML_TRANSITION_TABLE(expression,
table-instance-name)
This macro declares a transition table type and also declares a const
instance of the table which can then be used in a state machine
declaration (see BOOST_MSM_EUML_DECLARE_STATE_MACHINE).The expression
must follow the transition
- table grammar.
BOOST_MSM_EUML_DECLARE_TRANSITION_TABLE(iexpression,table-instance-name)
Like BOOST_MSM_EUML_TRANSITION_TABLE but does not provide an instance,
- simply a type declaration.
BOOST_MSM_EUML_DECLARE_TRANSITION_TABLE(iexpression,table-instance-name)
Like BOOST_MSM_EUML_TRANSITION_TABLE but does not provide an instance,
+ simply a type declaration.
BOOST_MSM_EUML_INTERNAL_TRANSITION_TABLE(expression,
table-instance-name)
This macro declares a transition table type and also declares a const
instance of the table.The expression must follow the transition table
- grammar. For the moment, this macro is not used.
BOOST_MSM_EUML_DECLARE_INTERNAL_TRANSITION_TABLE(iexpression,table-instance-name)
Like BOOST_MSM_EUML_TRANSITION_TABLE but does not provide an instance,
+ grammar. For the moment, this macro is not used.
BOOST_MSM_EUML_DECLARE_INTERNAL_TRANSITION_TABLE(iexpression,table-instance-name)
Like BOOST_MSM_EUML_TRANSITION_TABLE but does not provide an instance,
simply a type declaration. This is currently the only way to declare an
internal transition table with eUML. For example:
BOOST_MSM_EUML_DECLARE_STATE((Open_Entry,Open_Exit),Open_def)
struct Open_impl : public Open_def
diff --git a/include/boost/msm/back/metafunctions.hpp b/include/boost/msm/back/metafunctions.hpp
index b689ab9..5d9ec0c 100644
--- a/include/boost/msm/back/metafunctions.hpp
+++ b/include/boost/msm/back/metafunctions.hpp
@@ -45,6 +45,9 @@
#include
#include
+#include
+#include
+
#include
#include