Hi,
I tried to enhance the backend of boost::msm by inheriting from
boost::msm::back::state_machine.
When doing so, I cannot access members of my subclass in the states.
When compiling the attached example, I get this error message:
*error: ‘class boost::msm::back::state_machine’ has no member named ‘test’*
How can I "inject" extended_back_machine as the type being passed as "FSM"
to the state?
Bye
Manuel
####################################
template<typename FrontMachine>
struct extended_back_machine : public
boost::msm::back::state_machine<FrontMachine>
{
void test()
{
std::cout << "test" << std::endl;
}
};
struct fsm_ : public boost::msm::front::state_machine_def
{
struct State : public boost::msm::front::state<>
{
template
void on_entry(Event const&, FSM& fsm)
{
fsm.test();
}
};
typedef State initial_state;
};
int main()
{
typedef extended_back_machine fsm;
fsm m;
m.start();
return 0;
}
####################################