Several UML primitive types transform into valid C++ types:
UML |
C++ |
Boolean |
bool |
Integer |
int |
String |
const char * |
UnlimitedNatural |
unsigned int |
You can add primitive types that do not appear in UML (for example, int64) by using the cpp_type stereotype. For more information, see "UML parameters."
The transformation maps visibility in the following way:
UML |
C++ |
Public |
public |
Private |
private |
Protected |
protected |
Package |
private |
Package visibility does not have an analog in C++. If transformation encounters package visibility in UML, it uses conservative private visibility.
If the following UML elements have documentation, it is converted into C++ comments:
· Classes (including nested classes, unions, typedefs, and instantiated classes)
· Enumerations (including nested enumerations)
· Attributes, enumeration attributes, and literals
· Operations (including inline operations, and standard operations)