【问题标题】:Access front end by the back end of boost meta state machine通过boost元状态机后端访问前端
【发布时间】:2012-10-21 20:18:36
【问题描述】:

由于某些原因,我无法通过构造函数设置状态机的参数 所以我想通过 后端。也就是说,我想要类似的东西

typedef msm::back::state_machine<player_> player;

player p;
p.get_front_end(); //get the address of the front end
p.get_front_end().set_param(34) //call the member function of front end

这可能吗?谢谢

另一种解决方案是通过事件将参数传递到状态机。

p.process_event(open_theme(34));

【问题讨论】:

    标签: c++ boost boost-msm


    【解决方案1】:

    后端继承了前端,所以可以直接在p上调用set_param。

    【讨论】:

    • 谢谢,比我想象的要容易。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-04
    • 1970-01-01
    • 2021-02-28
    • 2020-03-03
    • 2010-12-28
    • 1970-01-01
    相关资源
    最近更新 更多