About UML and SysML to C and C++

From a SysML or UML class containing a behavior or a structure of classes, you can generate either C or C++ code.

This page discusses:

Source Elements

This operation generates code from the following elements:

  • SysML block
  • UML class containing a classifier behavior or a structure of classes
  • Package and its content

This operation generates code from multiple UML and SysML behaviors:

  • UML statemachine
  • UML activity
  • UML opaque behavior
  • SysML constraint blocks

Components Layer

This operation generates the code associated with the Components layer.

For more information about layers, see About Targeted Application.

Software Producer Model

A Software Producer model is generated with the code. This model describes the contract of the generated components and the connection between them. It contains a description of:

  • Interface elements – data, types, operations
  • Connections,
  • Executable information.

Generated Code Compliancy

The generated code is compliant with the following standards.

Generated Code Compliancy
C C11, C17, C18, C99
C++ C++11, C++14, C++17, C++20

Generated Code Modification and Reuse

Once the code is generated, you can modify the identified parts of the generated code. These sections of code are identified by comments in the code as user code sections. These sections can be used by other applications to perform a round-trip operation replicating the modified code in the input model. User code sections can also be used to avoid code modification of the code from one generation to another one.