Code Generation Settings

Code Generation Settings General Tab

Options for the Code Generation General Settings in Umbrello UML Modeller

Options for the Code Generation General Settings in Umbrello UML Modeller

Umbrello UML Modeller can generate source code for various programming languages based on your UML Model to help you get started with the implementation of your project. The code generated consists of the class declarations, with their methods and attributes so you can "fill in the blanks" by providing the functionality of your classes' operations.

Language

Choose the programming language to use for projects. The choices offered are ActionScript, Ada, C++, C#, D, IDL, Java, JavaScript, MYSQL, Pascal, Perl, PHP, PHP5, PastgreSQL, Python, Ruby, SQL, Tcl, Vala and XMLSchema

Folders

Write all generated files to folder: has an editable field for the desired path for generated files or optionally a browse button to select the path.

Include heading files from folder: if checked, lets the user specify a path in an editable field or choose it with a browse button.

Overwrite Policy

When the code is generated into the specified folder, this setting determines what happens if a file with the same name is encountered.

  • Overwrite the file without a warning or option.

  • Ask whether to overwrite the file or rename it.

  • Use a different name when a file already exists by renaming it using a suffix.

Code Generation Settings Formatting Tab

Options for the Code Generation Formatting Settings in Umbrello UML Modeller

Options for the Code Generation Formatting Settings in Umbrello UML Modeller

Comment Verbosity

Write documentation comments even if empty Generates comments for classes and functions even if they are empty.

Write comments for sections even if section is empty Writes comments for the private, protected and public sections even if they are empty.

Lines

Indentation type: offers a choice between no indentation, tab or space.

Indentation amount: lets the user specify the number of spaces for the tab or space indentation choice.

Line ending style: is a choice between the line ending styles of *NIX, Windows and Mac.

Language Options

Options for the Code Generation Language Settings in Umbrello UML Modeller

Options for the Code Generation Language Settings in Umbrello UML Modeller

This page changes for each programming language selected under the General tab. Currently the only options available are for the C++ language.

C++ Code Generation

Documentation

Style: gives a choice to use either "/** */" or "//" as the documentation style

General

Under the General tab of the Language Options tab, several code generation options are listed.

  • Class member prefix

    An option that allows a prefix determined by the user, to be added to class members when code is generated.

  • Package is a namespace

    Namespaces provide a method for preventing name conflicts in large projects. Symbols declared inside a namespace block are placed in a named scope that prevents them from being mistaken for identically-named symbols in other scopes.

  • Virtual destructors

    Even though destructors are not inherited, if a base class declares its destructor virtual, the derived destructor always overrides it. This makes it possible to delete dynamically allocated objects of polymorphic type through pointers to base.

  • Generate empty constructors

    This will generate constructors that have empty braces.

  • Generate accessor methods

    Will generate methods to access datatypes.

  • Operations are inline

    Generate the methods as inline, but compilers are free to choose not to inline the method.

  • Accessors are inline

    Methods that access the class' data will be generated inline, but compilers are free to choose not to inline the method.

  • Accessors are public

    Methods that are generated as public will be available to any instantiation of the class.

  • Create getters with 'get' prefix

    This will put the prefix "get" on the methods that get/return the class data.

  • Remove prefix '[a-zA-Z]_' from accessor method names

    If a prefix was entered in Class member prefix, this will remove it.

  • Accessor methods start with capital letters

    This capitalizes the first letter of the method name.

  • Use '\' as documentation tag instead of @

    A tag choice to use when documenting parameters of a method.

Method Body Generation

Options for the Code Generation Language Method Body Settings in Umbrello UML Modeller

Options for the Code Generation Language Method Body Settings in Umbrello UML Modeller

List

Has options of QPtrList, vector, and std::vector for the list type. An editable or selectable field follows to specify the include file along with a browse button to find a select the include file. There is also an option to make the list global.

String

Options of string or QString for the string type. An editable or selectable field follows to specify the include file along with a browse button to find a select the include file. There is also an option to make the string global.