statecharts
statecharts copied to clipboard
FR: Add option to generate state chart interface methods as virtual methods.
based on a customer request (2017092037000015):
Is it currently possible to modify the C++ generation so that the inner classes for the state machine interfaces defined in the generated .h file have virtual methods? If not, could this be added in a future release? This allows mocking frameworks, such as GMock, to easily mock the state machine interfaces, which in turn allows users to easily test how their code interfaces with a state machine.
+1 for this. It would be useful in multi state machines, when mocking a sub state machine. For example, my sub state machines are setting a boolean value if a failure happens and I want to mock if it failed or not. As a workaround, I'm removing the readonly keyword and will set the error.