在运行时迭代转换表boost:msm,以便将关联的事件读取到特定转换

问题描述

我是MPL和Finite MSM的新手。我想对转换表进行迭代,以便在给定2个转换状态(当前,下一个)的情况下获取关联的转换事件。

我定义并得到了这样的转换表(vector50):

struct<my_state_machine_>{
    (...)

    struct transition_table : boost::mpl::vector50<
      a_row < StateA,eventAB,StateB,&my_machine_state_::action>,(...)
      > {};
};

typedef boost::msm::back::state_machine<my_state_machine_> my_fsm;
typedef boost::msm::back::state_machine<my_machine_state_>::stt stt;

然后,我要迭代将2个条件传递给lambda的MPL向量(stt),如下所示:

template <typename T>
struct Finder {
  bool operator()() const { 
    /*todo: it will not compile,but it is the next issue*/
    return T::Current == <A predefined state> && T::Next == <Another state>; 
  }
};
boost::mpl::for_each<stt,boost::type<boost::mpl::_>>(Finder<my_fsm::a_row<StateType,boost::any,StateType,&my_fsm::action(*boost::any) > )>>());

它不能编译。我不知道如何通过一般的行动或只是摆脱它。我想迭代过渡表并检查这两种状态。我不在乎这个动作。

有可能吗?怎么样?

谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)