Boost logo

Boost Users :

Subject: Re: [Boost-users] [msm] How to cause no_transition for cases of guard returning false?
From: 谢任中 (joshchia_at_[hidden])
Date: 2012-11-13 16:19:51


Thanks. That clarified everything.

On Tue, Nov 13, 2012 at 3:36 PM, Christophe Henry <
christophe.j.henry_at_[hidden]> wrote:

> **
>
> >Hi,
>
> >I want no_transition() to be called whenever no row matches, even if
> there is a row that does not match only
>
> >because the guard returns false. How can I achieve this? I want to be
> strict about the input events. I can probably
>
> >workaround this by putting guardless rows at the top whose action is to
> call no_transition(),
>
> >but I'm hoping to find a cleaner solution.
>
> Hi Josh,
>
> no_transition is an error, which defaults to an assert. A guard rejection
> is not an error and perfectly valid.
>
> You can put an action to the transition where the guard rejects the event,
> or you can compare the return value of process_event with
>
> HANDLED_GUARD_REJECT.
>
>
>
> HTH,
>
> Christophe
>
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net