Studio:Scl union activate: Difference between revisions

From STRIDE Wiki
Jump to navigation Jump to search
m (Text replace - 'Category: SCL' to 'Category:Studio:SCL')
 
(One intermediate revision by the same user not shown)
Line 40: Line 40:
* For additional information on the scl_union_activate pragma, including constraints, refer to the section on scl_union_activate in the [[Media:s2sSCLReferenceGuide.pdf|SCL Reference Guide]].
* For additional information on the scl_union_activate pragma, including constraints, refer to the section on scl_union_activate in the [[Media:s2sSCLReferenceGuide.pdf|SCL Reference Guide]].


[[Category: SCL]]
[[Category:Studio:SCL]]

Latest revision as of 00:13, 21 August 2009

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.