Modify

Ticket #3220 (closed Bugs: invalid)

Opened 5 years ago

Last modified 5 years ago

Event responded to multiple times in one update

Reported by: anonymous Owned by: andreas_huber69
Milestone: Boost 1.40.0 Component: statechart
Version: Boost 1.39.0 Severity: Problem
Keywords: statechart orthogonal event dispatch Cc:

Description

I have created a state that has three orthogonal regions. This states to an event, evSay, by printing a message. One of the child states posts evSay in its ctor. Instead of the expected message, I get teh message repeated three times.

see attached code

Attachments

bug.cpp Download (1.2 KB) - added by anonymous 5 years ago.
code example

Change History

Changed 5 years ago by anonymous

code example

comment:1 Changed 5 years ago by anonymous

  • Status changed from new to closed
  • Resolution set to invalid

The observed behavior is in line with the one specified in the reference:

<http://www.boost.org/libs/statechart/doc/reference.html#forward_event>

Line number 38 of bug.cpp currently reads ...

return forward_event();

Replace this with ...

return discard_event();

... and the program should then work as expected.

Note that forward_event() should only be used in cases where a react member function determines that the passed event should be handled either in an outer state or a different orthogonal region.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.