The UnionDef interface is used to represent a Union that is stored in the Interface Repository. This interface provides methods for setting and retrieving the union's list of members and discriminator type.
module CORBA {
struct UnionMember {
Identifier <name>;
any <label>;
TypeCode <type>;
IDLType type_def;
};
typedef sequence <UnionMember> UnionmemberSeq;
interface UnionDef : TypedefDef {
readonly attribute TypeCode <discriminator_type>;
attribute IDLType <discriminator_type_def>;
attribute UnionMemberSeq <members>;
};
};
This operation is inherited from contained and returns a structure of type Contained::Description:
struct Description {
DefinitionKind kind;
any value;
};
Description describe( );
The DefinitionKind for the kind member is dk_Union. The value member is an any whose TypeCode is _tc_TypeDescription and whose value is a structure of type TypeDescription:
struct TypeDescription {
Identifier <name>;
RepositoryId <id>;
RepositoryId defined_in;
VersionSpec <version>;
TypeCode <type>;
};
This attribute describes the discriminator type for this union. The attribute discriminator_type_def contains the same information.
readonly attribute TypeCode discriminator_type;
This attribute describes the discriminator type for this union. The attribute discriminator_type contains the same information.
attribute IDLType discriminator_type_def;
This attribute contains a description of each union member including its name, label, and type.
attribute UnionMemberSeq <members>;
The members attribute can be modified to change the union's members. Only the name, label, and type_def field of each UnionMember should be set.