C++ Generator

The C++ code generator is a plug-out directly written in C++ (the C++ code generator does not generate itself !).

The generated sources follows the definition made in BOUML at the artifact / class / operation / relation / attribute / extra member levels.

When the code generation is applied on a artifact associated to several classes, the code generation is made for all these classes. Nevertheless the the C++ code generator produce first the code in memory and update the appropriate files only when it is necessary, to not change the last write date of the files for nothing.

The C++ code generator plug-out may be called on :

When the C++ code generator is ask through the Tools menu, it is applied on the project, then on all the artifacts.

The name of the generated files depend on the artifact name, the extension depend on the language and is fixed for each by the generations settings (see below), the directory where the files are generated may be set in each package containing directly or indirectly the artifact (see generation directory).

artifact

The C++ definition of a artifact is set through the C++ header and C++ source tabs of the artifact dialog.

artifact header C++

The generated file name is the artifact's name with the extension specified in the first C++ tab of the generations settings :

In BOUML the generated code is obtained by the substitution of macros in a text, the macros known by the C++ code generator are :

artifact source C++

The generated file name is the artifact's name with the extension specified in the first C++ tab of the generations settings.

In BOUML the generated code is obtained by the substitution of macros in a text, the macros known by the C++ code generator are :

Class

The C++ definition of a class is set through the Uml, Parametrized, Instantiate and C++ tabs of the class dialog.

A C++ type definition may be a class, a struct, an union, an enum or a typedef, depending on the stereotype and its translation in C++ (see generation settings).

In BOUML the generated code is obtained by the substitution of macros in a text, the macros known by the C++ code generator are :

Operation

The C++ definition of an operation is set through the Uml and C++ tabs of the operation dialog.

The indentation of the first line of the declaration/definition give the indentation added to the visibility specification in the class definition for all the operation declaration/definition (except for the pre-processor forms beginning by # whose are placed at the beginning of the line).

In BOUML the generated code is obtained by the substitution of macros in a text, the macros known by the C++ code generator are :

Attribute

The C++ definition of an attribute is set through the Uml and C++ tabs of the attribute dialog.

The indentation of the first line of the definition give the indentation added to the the visibility specification in the class definition for all the attribute definition (except for the pre-processor commands beginning by # whose are placed at the beginning of the line).

An attribute may be a standard attribute or the item of an enumeration.

standard attribute

In BOUML the generated code is obtained by the substitution of macros in a text, the macros known by the C++ code generator are :

enumeration item

The macros known by the C++ code generator are :

Relation

The C++ definition of a relation is set through the Uml and C++ tabs of the relation dialog.

The indentation of the first line of the definition give the indentation added to the the visibility specification in the class definition for all the relation definition (except for the pre-processor commands beginning by # whose are placed at the beginning of the line).

Relation equivalent to an attribute

In BOUML the generated code is obtained by the substitution of macros in a text, the macros known by the C++ code generator are :

Dependency

A dependency having the stereotype friend produce a C++ friend declaration of the pointed class.

Inheritance

The class inheritance are managed at the class level.

Extra member

The C++ definition of an extra member is set through the C++ tabs of the extra member dialog.

No macros.

Previous : deployment diagram

Next : C++ reverse