Using standard types

449 views Asked by At

Is there a way to configure uml-designer to understand standard C and C++ library types (like uint32_t or std::string)? Right now it refuses to let me assign a type to a variable if this type doesn't exist in the model.

1

There are 1 answers

2
Mélanie Bats On

No, you need to define them. To do so you can provide your own profile in which you define all the Datatypes you need, this will be your types library model. And then you can use this types in any other model by referencing the types from your libray. To define the types you juste create a model as you do usually and then to use them in another model you can reference the profile by clicking on Project Dependencies in the Model Explorer and then on Add Model: Add Model

A dialog box opens, and then you have to select on your file system the .uml model which definies the types: Select File

In my example this file is named types.uml: Types.uml

Then you validate and you can see in the Model Explorer your profiles un the Project Dependencies.

Project Dependencies

Now you can use the types in your model. For example, I created a class with a property and I want to set the property type to Date. Then I clixk on the + utton in the properties view and this open a dialog which by default is on the Model REsource tab. I select the All Resources tab and then I am able to select the Date type. Use the Type

In the end I got a property with Date as type: enter image description here