Package mapping for C (C code)
ACS generates a Package as a subfolder of the root directory, unless the Package is the root object. In the following example, the Package1 and Package2 Packages are generated as subfolders of the root directory.
If a Package owns any Attributes, Operations or Type Definitions, ACS generates a header and implementation file for the Package. The header and implementation files declare and define the Package'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.
Child items:
Example code:
/* File foo.h */
int anAttribute;
• If the Package owns Basic Types, the Basic Types are ignored.
Example code:
/* File foo.h */
#include "bar.h"
Example code:
/* File foo.h */
int anOperation();
Example code:
/* File foo.h */
typedef char String[128];
Properties:
• The Mapping property of a Package is ignored, but if ACS generates a Package that has Namespace mapping, a warning is added to the error log.
• The Name property is generated as the name of the header and implementation files.
| ACS may modify the package name that is added to the code to make it valid for C. You can specify the exact package name to add to the code through the CODE_GENERATION_NAME property of a Package.
Tell me more.... |
• The Visibility property of a Package is ignored.
Tag Definitions:
The following tag definitions are applied to a Package by the «C Package» stereotype:
• If the tagged value of the C Header Includetag 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 that are not modeled in the Model. Note that you can use Dependencies to generate #includes to other Classes, Data Types, Interfaces and Signals that are modeled in the Model.
• If the tagged value of the C Implementation Includetag 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 that are not modeled in the Model. Note that you can use Dependencies to generate #includes to other Classes, Data Types, Interfaces and Signals that are modeled in the Model.