Code generation for relations

During code generation, IBM® 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;

#includes for a class, object, or file

External dependencies (dependencies with a «Usage» stereotype and the CG::Dependency::UsageType property set to Specification/Implementation) and implicit dependencies (such as associations and generalizations) are generated as forward declarations and #include statements.

To generate a local #include statement (for example, #include <C.h>), set the CG::File::IncludeScheme property to LocalOnly.

To generate a relative #include statement (for example, #include <MySubsystem\C.h>), set the CG::File::IncludeScheme property to RelativeToConfiguration.

You can also use the <lang>_CG::Package::GenerateDirectory and CG::Class/Package::FileName properties to set relative paths. See the definition of these properties in the Features window.


Feedback