Studio:Scl union activate

From STRIDE Wiki
Revision as of 20:41, 8 October 2008 by Stevel (talk | contribs) (→‎See Also)
Jump to navigation Jump to search

The scl_union_activate pragma

The scl_union_activate pragma provides a means to map discriminant values to specific union members. It can only apply to discriminated unions that have been identified by the scl_union pragma.

A single scl_union_activate pragma prescribes the set of values for the discriminant and the member that is active for those values.

Syntax

#pragma scl_union_activate(container-specifier, union-member-specifier, constant-value-list)
Parameters Type Description
container-specifier Type Name of the structure encapsulating the union
union-member-specifier Member The active member of the union
constant-value-list Integer constant expression list List of the constant expressions that the discriminant takes on to activate the union member identified in this pragma

Notes

  • The discriminant field use in scl_union_activate must have already been identified with scl_union.

Examples

Use the following links to the scl_union page to see examples of the scl_union_activate pragma:

See Also

  • The scl_union pragma page.
  • For additional information on the scl_union_activate pragma, including constraints, refer to the section on scl_union_activate in the SCL Reference Guide.