External elements Code generation for external elements The following table lists how Rational Rhapsody generates code for external elements. Code generation for relations During code generation, Rational Rhapsody generates either an #include or a forward declaration for a relation in the source file of the dependent element. Forward declaration (class) If a dependency has a «Usage» stereotype and the CG::Dependency::UsageType property is set to Existence , it is generated as a forward declaration. For example: class ExternalClass; Rational Rhapsody 611 Element Type Description Package The code generator does not generate code for an external package.
However, you can map the package to a file or folder for a component (and then relate it to a file or directory). You can include the package in the component scope. During code generation, a relation to a package is converted an #include to a file, if the package is mapped to a file for the component. Class, object, or file The code generator does not generate code for an external class, object, or file. During code generation, a relation to a class, object, or file is converted to an #include or a forward declaration. Type The code generator does not generate code for an external type. A relation to a type is converted to an #include of its parent.
File (component) A file is external if all its elements are external. If the CG::File::Generate property for a file is set to Cleared, the file becomes external and code is not generated for it. To include a file in the build, set its CG::File::AddToMakefile property to Checked.