Model mapping for C (C code)
If the Model directly owns any Attributes, Operations or Type Definitions, ACS generates a header and implementation file for the Model. The header and implementation files declare and define the Model's Attributes, Operations and Type Definitions, and are derived from the properties and the tagged values set for Tag Definitions that are applied by the «C Package» stereotype.
Properties:
The Name property is generated as the name of the header and implementation files.
ACS may modify the model name that is added to the code to make it valid for C. You can specify the exact model name to add to the code through the CODE_GENERATION_NAME property of the Model. Tell me more...
Child items:
·If the Model directly owns Attributes, the Attributes are generated in the header and implementation files created for the Model.
Example code:
/* File model.h */
int anAttribute;
If the Model directly owns Basic Types, the Basic Types are ignored.
·If the Model directly owns Classes, header and implementation files are generated for each Class. For Class mapping information, see
If the Model directly owns Data Types, header and implementation files are generated for each Data Type. For Data Type mapping information, see
If the Model directly owns Interfaces, a header file is generated for each Interface. For Interface mapping information, see
If the Model directly owns Operations, the Operations are generated in the header and implementation files created for the Model. For Operation mapping information, see
Example code:
/* File model.h */
int anOperation();
If the Model directly owns Signals, header and implementation files are generated for each Signal. For Signal mapping information, see
If the Model directly owns Type Definitions, the Type Definitions are generated in the header and implementation files created for the Model. For Type Definition mapping information, see
Example code:
/* File model.h */
typedef char String[128];
Tag Definitions:
The following tag definitions are applied to a Model by the «C Package» stereotype:
If the tagged value of the C Header Include tag definition has been set, the value is generated at the beginning of the header file so that you can generate your own #includes to files.
If the tagged value of the C Implementation Include tag definition has been set, the value is generated at the beginning of the implementation file so that you can generate your own #includes to files.
Was this helpful?