IBM Support

No forward declaration generated for class having object with multiplicity grater than 1

Question & Answer


Question

Why is no forward declaration generated for class having object with multiplicity grater than 1?

Answer

Prior to Rhapsody 7.4 it was possible to generate the forward declaration for class having object with multiplicity greater than 1. However, since IBM Rational Rhapsody 7.5, it is not generated due to the new C language standard.

According to the new standard: if there is a class under a package then generation of forward declaration for the object should contain include for class file which will result in circular dependency as the class file already includes package information.

Hence the suggested approach is:

  1. Override and check property CG:Package:GenerateExternDeclarationForObjectArray.
  2. Change the model so files will not use those objects.

[{"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"General Information","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"7.5.0.1;7.5","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21407796