A variant is a customization unit for the C++ module that must be declared in a C++ project before being used.
Variants can be divided into the following categories:
You can create your own type variants by writing custom type definitions and ACTs, or use the standard one, already included in C++ Designer.
The core of Modelio C++ Designer is an Active Code Template (ACT) processor. An ACT is a python or java file to be used at generation, which groups together:
ACTs are linked to model elements and output files by generation products. A generation product is a python script which links a UML metaclass, a condition defining when elements of this metaclass are translated, an ACT defining how these elements are translated, and the name of the output files containing the generated code.
You can define your own generation product by associating:
This means that you can define custom output, in addition to generated C++ code (IDL definitions or Java Native Interface wrappers, documentation in custom format, and so on).
Modelio C++ Designer can simultaneously support a number of generation product definitions.
A type library groups together definitions of types. A type definition associates a UML type with a C++ declaration, where the name of a UML structural feature or operation parameter will be substituted, and a list of include directives required to use the C++ type.
A UML type can be a primitive type, a data type or a collection type. Collection types are used to represent attributes and association ends with multiple cardinalities. The definition of a collection type also provides a high-level description of collection semantics – such as “OrderedCollection” – which is mapped to decorations automatically deduced from high-level UML model properties. This allows Modelio C++ Designer to automatically express high- level UML model semantics through particular C++ collection types.
When Modelio C++ Designer translates a structural feature or an operation parameter, it constructs the C++ declaration in accordance with its type and the current type library, and executes ACTs defined in the library, if they override the core ACTs defined for the element.