Difference between revisions of "Studio:Scl union activate"

From STRIDE Wiki
Jump to: navigation, search
(See Also)
(See Also)
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 [http://www.s2technologies.com/pdf/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 [http://www.s2technologies.com/pdf/s2sSCLReferenceGuide.pdf SCL Reference Guide].
  
[[Category: SCL_Reference]]
+
[[Category: SCL]]

Revision as of 11:49, 2 October 2008

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.