Configuring C++ Code Reverse

With the Cpp Code Reverse operation, you can create UML components from the existing C++ files.

For more information, see Code Reverse From C++ to UML.


Before you begin: Create a configuration diagram. See Creating a Configuration Diagram.
Tip: You can use the Contact Book - Cpp Reverse sample model to try out the code reverse functionality. Try deleting UML elements from the sample project and executing the CppCodeReverse configuration while changing various strategies. Also, try modifying the code files.
  1. From the Code Reverse section in the diagram palette, drop the Cpp Code Reverse configuration to the diagram viewer.
  2. Add a title to the configuration.

  3. From the Containment tree, under the Model, create a package to be used as a target package for the created UML elements.
  4. From the Containment tree, drop the target package to the title of the configuration.
  5. If required, double-click the configuration to modify its specifications. See Defining Specification Properties.
    Option Default Value Description
    Create Strategy Create element according to code The creation strategy defines if the elements newly added to the code file must be created in the model. If you do not want the new elements to be created after executing the code reverse, choose Ignore new element from code strategy.
    Delete Strategy Delete element according to code The deletion strategy defines if the elements deleted from the code file should also be deleted from the model. If you do not want the elements to be deleted after executing the code reverse, choose Ignore deleted element from code strategy.
    Update Strategy Update attribute according to code The update strategy defines if the attribute changes in the code file should be applied in the model. If you do not want the attribute changes to be applied after executing the code reverse, choose Ignore attribute changes from code strategy.
    Define Symbols Not applicable Define the symbols to be expanded by the preprocessor when parsing files.
    Dry Run false If this option is set to true, the operation does not modify the model after the execution. It only shows changes in the Software Producer Logs that would be made.
    Include Directories Not applicable Include directories used by the parser for searching "#include" files.
    Verbose false If this option is set to true, every model creation, modification, and deletion is logged in the Software Producer Logs.
    Name Cpp code reverse element name The name of the Cpp code reverse element.
    Target Package Target package name The elements, created after code reverse execution, will be stored in this package.
    Reverse Local Path <sop.local.workspace.path>/<configuration.name> Define the path where the C++ source files are stored. By default, the path points to the location where the project is stored.
    Diagrams Update Diagram to be updated Select the diagram to be updated with deleted, added or modified classes during the next execution.
    Tip: To select a diagram, you can use one of these methods:
    • Click the browser on this field.
    • Drop a diagram from the Containment tree to this field.
    • Drop a diagram from the Containment tree to the configuration diagram.

    When this property is not specified, the updated classes are displayed only in the Containment tree.

What's Next
You can then execute the operation. See Running the Operation.