Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Stereotypes with Tag values

 

Expand
titleClick here to see what's on this page

Table of Contents

...

Stereotype «C++Constructor» is used to define C++ Constructor. This stereotype extends stereotype «C++Operation»

Name

Meta class

Constraints

C++Constructor

Operation

name = owner.name

Tag definition

Type and default value

Description

explicit

boolean[1]=false

Constructor Explicit 
 explicit a(); 

initialization list

String[0..1]

Constructor initialization:

 a() : x(1) {} 

C++Destructor

Stereotype «C++Destructor» is used to define C++ destructor. This stereotype extends stereotype «C++Operation»

NameMeta ClassConstraints
C++DestructorOperation
name = “~”+owner.name

C++ class constructor and destructor are mapped to UML operation with stereotypes «C++Constructor» and «C++Destructor»:

...

Tip
titleExample

C++ source code

Code Block
languagecpp
Class FunctionClass { 
public: 
 void voidParam(void); 
};

UML model:

UML model Tag specification:

Operation with type void

 

Register Parameter

C++ register parameter is mapped to UML parameter language property Register Depending on the compiler, register can be limited on some types (int, char).

...

Tip
titleExample

C++ source code

Code Block
languagecpp
Class Op { 
Public: 
 Op operator+(Op x); 
};

UML model:

 

Exception 

C++ exception is mapped to UML operation’s raised exception properties.

...

Tip
titleExample

C++ source code

Code Block
languagecpp
class ClassVisibility { 
 int privateVar; 
protected: 
 int protectedVar; 
public: 
 int publicVar; 
};

UML model:

 

Static members

Static variables and functions are mapped to UML Is Static property.

...

Tip
titleExample

C++ source code

Code Block
languagecpp
class FriendClass {
public:
 friend class ClassA;
};
class ClassA {
};

UML model:

 

Struct

C++ struct are mapped to a UML class with stereotype «C++Struct». See C++Struct for more info.

...

Tip
titleExample

C++ source code

Code Block
languagecpp
enum Day { 
     Mon, 
     Tue=2 
}; 

UML model:

 

Typedef

C++ typedef is mapped to a class with «C++Typedef» stereotype. A «C++BaseType» dependency links to the original type. Type modifiers tag of «C++BaseType» dependency is used to define type modifiers. $ character is replaced by the type name. A typedef on a function pointer is mapped by linking a «C++BaseType» dependency to an operation and type modifiers tag of «C++BaseType» dependency is set to *$. Operation signature can be stored in a «C++FunctionSignature» class. 

...