statecharts icon indicating copy to clipboard operation
statecharts copied to clipboard

Rework interface hierarchy

Open BeckmaR opened this issue 7 years ago • 0 comments

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.

BeckmaR avatar Jul 11 '17 11:07 BeckmaR