The current release candidate of YAKINDU Statechart Tools PRO is still missing some C functionalities that will be approached as soon as possible by subsequent releases. Among others, the following issues are known to be not available yet:
Type range validations are currently not implemented. As a consequence, it is possible to e.g., assign an int32_t value to an int8_t variable one without any warning.
In C it is possible to define structs, unions and enums without a typedef. They can be referenced by using the corresponding qualifying keyword ( struct, union, or enum, respectively). As the statechart language does not support these qualifiers, the usage of struct, union and enumeration types is currently restricted to those defined by a typedef.
Using the C/C++ domain, it is possible to call functions that are declared in header files. The generated code will do this correctly, but the simulation will not actually evaluate the functions, for multiple reasons:
Due to this, we decided not to implement this feature, and doing so is currently not on our roadmap.
However, when using our testing framework SCTUnit, you have the option to mock these functions, and these mocks are then called during testing.
Using the C/C++ domain allows you to import classes defined in a C++ header file, and use them as types. This means that you can instantiate objects of these types just like in regular C++ code. However, YAKINDU Statechart Tools currently does not support constructors, so there are certain limitations:
var o: MyClass. The constructor of the generated statechart class will then automatically call the default constructor of
MyClassto instantiate the object.
var o: pointer<MyClass>- this way, the constructor of the statechart does nothing at all. Instead, you can then assign a proper value to it, ideally after you call the statechart’s
init-function, and before you call the
enter-function. This ensures correct initialization before the statechart is running.
Please note that the preceding list of restrictions might not be complete. If you discover any further problems, please do not hesitate to contact us! Your feedback is highly appreciated!