Model RealTime 11.1 2021.40

October 12, 2021

It's time again for a new release of Model RealTime: 11.1 2021.40. Let's look at the highlights of this release.

Capsule Constructors

You can now create constructors for capsules in the same way as for passive classes using the Add UML - Special Operation - Constructor command. A capsule constructor lets you pass initialization data which can be used by a capsule instance already at the time of its creation. For example, it allows you to have attributes of reference type in a capsule.

Capsule Factories

A capsule factory defines how to create and destroy an instance of a capsule. It allows, for example, to invoke a capsule constructor that you have defined. Capsule factories can be specified for individual capsule parts or globally in a TC. It can also be provided when incarnating an optional capsule part using the Frame service of the TargetRTS. Check this article for more information on how to customize capsule creation.

Dependency Injection

A new TargetRTS service for dependency injection is now available. It's implemented in the RTInjector class and allows you to dynamically assign a create function to be used when incarnating a certain capsule part. A capsule factory can then delegate the creation of capsule instances to RTInjector to make sure the correct type of capsule instance gets created. You can even change the registered create functions dynamically at run-time if you need to.

Model References in TCs

Two new preferences were introduced in RealTime Development - Transformation Configuration Editor - Model References. By enabling them, references to model elements from a TC can become more "portable" by using file paths that are relative to the TC file rather than the workspace. Also, the unique ID that normally is used for identifying the element in a model file can be replaced with a qualified name instead. This improves the readability of a TC file.

Code Compliance

The preference RealTime Development - Build/Transformations - C++ - Code compliance - Clang-Tidy now also handles warnings for unused parameters. If the preference is set, all functions generated by the model compiler will get comments that suppress Clang-Tidy warnings about unused parameters. By not getting warnings from the generated code, it becomes more practical to use Clang-Tidy to find problems in your handwritten code snippets.

Learn more about the new features in this release by watching the videos in our Sprint Demo YouTube Playlist.


Mattias Mohlin
Architect for HCL Model RealTime