# C++ reverse

The C++ code reverse is a plug-out directly written in C++, as the C++ generator.

Note that the C++ code reverse cannot be used as a C++ code round trip and doesn't allows to update already defined classes having at least one member. Furthermore the preprocessing phase is not made by the C++ code reverse whose ignore all the preprocessor forms.

The C++ code reverse plug-out may be applied only on a package.

When you start the C++ code reverse, it asks you for a directory, then it reads all the sources placed under the selected directory and sub-directories. The sources read by the C++ code reverse are the ones having the extension specified in the generation settings. The tree formed by the sub-directories produce an equivalent tree of sub-packages, on whose the needed class view and artifact view are made to support the classes and artifacts. When a type is referenced but not defined in the reverse files, a class having the same name is defined under an additional package named unknown.

Obviously the C++ code reverse tries to produce the definitions made in BOUML at the artifact / class / operation / relation / attribute levels. When it is possible it creates a relation rather than an attribute.

Except for the special case of the templates class definition like vector<bool>, a artifact is created for each type definition, then a future C++ code generation may not produce a list of files similar to the reversed ones.

A C function cannot be specified in UML, the C++ code reverse loses them (generating a warning) except the ones declared friend in a class.

The C++ code reverse works in two steps, during the first step it scans all the files to establish the list of defined types, then the second step may reverse the files. The first phase try to replace the missing #include management, but it is not enough because the files whose are not under the selected directory (for instance the standard headers files !) are never taken into account and the synonym types are confusing.

When the C++ code reverse has a problem, for instance when it reads a C function definition, it produces a warning in the trace window. The trace window is automatically opened by BOUML, it may also be manually opened through the Tools menu.

Previous : C++ generator

Next : Java generator