Interface mapping for C (C code)
For each Interface that is not nested, ACS generates a header file (.h). Data members are ignored. On Instance functions are typed as void*. #includes to Interfaces are generated only as a result of uses Dependencies.
Classes,Data Typesand Signals that Implement Interfaces
For Classes, Data Types and Signals that implement interfaces:
The first member of the generated struct is named 'base' and is typed by the implementing interface.
ACS generates a 'constructor' function, assigns appropriate functions to the function pointer members of the 'base' member, and assigns values to behavior ports.
The Class, Data Type or Signal provides proxies for functions being forwarded to behavior ports that cast the instance parameter to the correct concrete type before making a call.
For Classes, Data Types and Signals containing composite interface-typed non-behavior ports, ACS generates constructor functions that assign functions to the port's function pointer members.
The header file is derived from the items it owns, properties of the Interface, the application of the «C Module» stereotype, and the tagged values set for Tag Definitions applied by the «C Class» stereotype.
Child items:
If the Interface owns Dependencies, ACS typically generates #includes in the code. For Dependency mapping information, see .
If the Interface owns Operations, the Operations are generated in the file created for the owning Interface. On Instance functions are typed as void*. For Operation mapping information, see .
Other child items are ignored.
Properties:
If the Descriptionproperty has a value, ACS generates the description as a comment on the line before the struct declaration.
The Formal Template Parameters property is ignored.
The Name property is generated as the name of the header and implementation files, and the name of the struct in the code.
* 
ACS may modify the struct name that is added to the code to make it valid for C. You can specify the exact struct name to add to the code through the CODE_GENERATION_NAME property of an Interface.
The Template property is ignored.
The Template Specialization Parameters property is ignored.
The Template Specialization property is ignored.
The Template Specialization property is ignored.
If the Visibility property is set to Public or Protected, the struct is declared in the header file. If the Visibility property is set to Private, the struct is declared in the implementation file. For nested Interfaces, this property is ignored.
Tag Definitions:
If the «C Module» stereotype does not apply to Interfaces.
The following tag definition is applied to an Interface by the «C Class» stereotype:
The C Anonymous Item tag definition does not apply to Interfaces.
If the tagged value of the C Forward Declarations tag definition references any Classes, Data Types, Interfaces and Type Definitions, ACS generates forward declarations to the structs, unions and enums that are generated from those items.
If the tagged value of the C Forward Declaration Text tag definition has been set, the value is generated as forward declarations.
If the tagged value of the C Header Filetag definition has been set, the value is used to generate #include statements. This value is set by ACS and is used when opening an associated header file from Modeler.
If the tagged value of the C Header File Commenttag definition has been set, the value is generated as a header file comment.
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 and Interfaces that are modeled in the Model.
The C Implementation File Comment tag definition does not apply to Interfaces.
The C Implementation Include tag definition does not apply to Interfaces.
If the tagged value of the C Non Member tag definition is set to TRUE (applies only to Class owned Interfaces), ACS generates the struct in the code file created for the root item, but not as part of the struct created for the root item.
If the tagged value of the C Source Filetag definition has been set, the value is used when opening an associated implementation file from Modeler. This value is set by ACS.
If the tagged value of the C Generate State Machinetag definition has been set to FALSE, ACS does not generate state machine code for the Interface's State Diagram.
The following tag definition is applied to an Interface by the «C Library» stereotype:
If a value has been set for the tagged value of the C LIB_INCLUDE tag definition, the value is generated as the #include for any structs that use the library, rather than ACS generating a #include based on the library's location in the model.
Was this helpful?