IBM Support

Using forward declarations with containers

Question & Answer


Question

Can I use forward declarations with containers?

Answer

To control whether a forward declaration is generated when using a relation with * multiplicity, you must set the appropriate "IncludeDirective" property for your container and implementation type.
 
The "IncludeDirective" property (found under the :: metaclasses) specifies how container header files are included in generated files. The property is read through a pointer to the concrete relation.
 
The possible values are as follows:
strong - The #include directives are added to the header file.
weak - The #include directives are added to the source file with forward declarations in the header file.
 
For example, if you are using BoundedOrdered implementation with STL containers, set the STLContainers::BoundedOrdered::IncludeDirective property to "weak".

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

ibm10730633