Hi,
having tested Boost.MSM, I'm pretty happy with it.
:)
It's interesting, in that it seems to handle all states in a static table.
No "new" operator etc.
It's much faster without dynamic allocation.
<snip>
g_row,
Unfortunately
gcc gives this error:
d.cpp:119:5: error: ‘g_row’ was not declared in this scope
g_row,
Short answer. Try:
typename Machine_<EventT>::template g_row
Long answer: g_row is a type of state_machine_def and as your fsm is a
template, it becomes a dependent type (=> typename) and a template one even
(=> template).
C++ is sometimes really annoying :(
Longer answer. Give up this front-end, it's deprecated anyway. A better
solution will be:
#include
using namespace boost::msm::front;
struct GuardToOdd
{
template
bool operator()(EVT const& num,FSM& ,SourceState& ,TargetState& )
{
const long long x = static_cast<long long>(num.getNum());
return ((x == num.getNum()) // is Integral type
&& ((x % 2) != 0));
}
};
Row< StateFloat, EventT, StateOdd, none, GuardToOdd>
HTH,
Christophe