statecharts
statecharts copied to clipboard
Rework interface hierarchy
In the C++- and Java generators, the interfaces are somewhat weird.
C++
In the C++ generator, a TimedStatemachineInterface
is generated additionally to the regular StatemachineInterface
. While all statemachines inherit from StatemachineInterface
, the timed ones also inherit from TimedStatemachineInterface
- instead of TimedStatemachineInterface
inheriting from StatemachineInterface
. This makes it impossible to call runCycle()
on a TimedStatemachineInterface
instance, while in practice all TSI
do have a runCycle
.
Also, the TimedStatemachineInterface
contains two different aspects - one are functions for the user of the statemachine to attach a TimerService to it, the other is the raiseTimeEvent
that will be called by said TimerService.
Java
In Java, the function setTimer(ITimer timer)
isn't mentioned in any interface at all. Even better.