OSF DCE Application Development Guide--Core Components

OSF DCE Application Development Guide—Core Components
pointer or any structure that contains a ref or unique pointer.
The following is an example of an encapsulated union.
/* IDL construct /*
typedef
union fred switch (long a) ralph {
case 1: float b;
case 2: long c;
} bill;
/* becomes in the generated header file /*
typedef
struct fred {
long a;
union {
float b;
long c;
} ralph;
} bill;
17.14.2.2 Nonencapsulated Unions
To define a nonencapsulated union, use the following syntax:
[switch_type(datatype)] union [tag]
{
case
...
[default_case]
}
If a tag is supplied, it can be used in a type_specifier of the form shown in Section
17.14.2.
A parameter or a structure field that is a nonencapsulated union must have an attribute
attached to it. This attribute has the following form:
switch_is(attr_var)
where attr_var is the name of the parameter or structure field that is the discriminator for
the union.
If a nonencapsulated union is used as a structure field, the discriminator of the union
must be a field of the same structure. If a nonencapsulated union is used as a parameter
of an operation, the discriminator must be another parameter of the same operation.
17 28 Tandem Computers Incorporated 124245