开发者

How to get the current most derived state in a boost::statechart state_machine object?

I am using boost::state_chart library. For debug purposes, I would like to know at any given time 开发者_如何学Cthe state of my state machine. How to get the current (most derived) state in the state_machine object ?


You can get at the current state object(s) with state_machine::state_begin and state_machine::state_end, see "Custom State Queries" here:

http://www.boost.org/libs/statechart/doc/tutorial.html#StateQueries

These give you base class pointers, if you want to get at the most-derived type you'd have to employ a visitor of some sort.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜