Hello, having trouble getting this to work.
Here’s a simplification of what I’m trying:
//states and events defined elsewhere
struct sub_fsm : public msm::front::state_machine_def
{
typedef entry_state_impl initial_state;
BOOST_MSM_EUML_DECLARE_TRANSITION_TABLE((
entry_state + some_event() / action1
== next_state
), transition_table)
sub_fsm() : pctx_(nullptr) {}
sub_fsm(context *p) : pctx_(p) {}
context *pctx_;
};
typedef msm::back::state_machine sub_helper;
struct sub_machine : public sub_helper, public
msm::front::euml::euml_state
{
sub_machine() {}
sub_machine(context *p) : sub_helper(p) {}
};
sub_machine const sub;
struct outer_fsm : public msm::front::state_machine_def
{
typedef outer_entry_state_impl initial_state;
BOOST_MSM_EUML_DECLARE_TRANSITION_TABLE((
outer_entry_state + another_event() / action2 == sub
), transition_table)
outer_fsm() : pctx_(nullptr) {}
outer_fsm(context *p) : pctx_(p) {}
context *pctx_;
};
typedef msm::back::state_machine outer_machine;
int main()
{
context ctx;
outer_machine fsm(msm::back::states_ << sub_machine(&ctx), &ctx);
}
This doesn’t compile under VC2010, it can’t deduce the template
arguments for operator <<().
Am I on the right track here? Should the template parameter of
euml_state<> really be sub_helper and not sub_machine (I got that chunk
of code from here:
http://svn.boost.org/svn/boost/trunk/libs/msm/doc/HTML/examples/CompositeTut...
What am I doing wrong?
Thanks for any help,
Mark
--
http://www.fastmail.fm - Choose from over 50 domains or use your own