Boost logo

Boost Users :

Subject: Re: [Boost-users] [msm] How to cause no_transition for cases of guard returning false?
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2012-11-13 15:36:16


>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 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