Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
C Conventions
Enterprise Architect supports round trip engineering of C, where the following conventions are used:
Reference
Stereotype:
Stereotype |
Applies To |
Corresponds To |
---|---|---|
enumeration |
Inner Class |
An enum type. |
struct |
Inner Class |
A struct type. |
Attribute |
A keyword struct in variable definition. |
|
typedef |
Inner Class |
A typedef statement, where the parent is the original type name. |
union |
Inner Class |
A union type. |
Attribute |
A keyword union in variable definition. |
Tagged Values:
Tag |
Applies To |
Corresponds To |
---|---|---|
anonymous |
Class also containing the Tagged Value typedef |
The name of this class being defined only by the typedef statement. |
bodyLocation |
Operation |
The location the method body is generated to; expected values are header, classDec or classBody. |
typedef |
Class with stereotype other than typedef |
This Class being defined in a typedef statement. |
C Code Generation for UML Model:
UML |
C Code |
Notes |
---|---|---|
A Class |
A pair of C files (.h + .c) |
File name is the same as Class name. |
Operation (public & protected) |
Function declaration in .h file and definition in .c file |
|
Operation (private) |
Function definition in .c file only |
|
Attribute (public & protected) |
Variable definition in .h file |
|
Attribute (private) |
Variable definition in .c file |
|
Inner Class (without stereotype) |
(N/A) |
This inner Class would be ignored |
Topics
Topic |
Detail |
See also |
||||||
---|---|---|---|---|---|---|---|---|
Capture #define value to be generated in C code |
For example, #define PI 3.14
|
Notes
• | Separate conventions apply to Object Oriented programming in C |
Learn more