This is a example for the deep C++ integration of CREATE statecharts. It shows how C++ classes can be used as variables and is based on the C example:
The statechart consists of two major states "ON" and "OFF". The "ON" state is a composite state with several substates and substate machines for the different modes.Imported classes can be referenced by declaring a variable and using the class as the type of it. Within the example two classes are referenced:
The declared variables can be used and changed in the simulation view.
If you have changed the model you can generate state machine code by right-click on 'CoffeeMachine.sgen' and choose 'Generate Code Artefacts'. This will generate: