Overview | The discriminator_type_def read and write operations allow access and update of the discriminator_type_def attribute of an Interface Repository UnionDef object. |
Original interface | UnionDef Interface |
Exceptions | CORBA::SystemException |
Intended Usage
The discriminator_type_def attribute references an IDLType that is a type definition for the discriminator of a union. Both read and write operations are supported with parameters as defined above.
Syntax
attribute IDLType discriminator_type_def;
Read operations
The returned value is a pointer to a copy of the IDLType that represents the discriminator_type_def attribute. The memory is owned by the caller and can be released by invoking CORBA::release.
Write operations
The discriminator_type_def must be of a subset of the simple types (a PrimitiveDef of kind CORBA::pk_long, CORBA::pk_ulong, CORBA::pk_short, CORBA::pk_ushort, CORBA::pk_boolean, CORBA::pk_wchar, or CORBA::pk_char) or an enumeration definition (EnumDef). Setting the discriminator_type_def also updates the discriminator_type attribute.
Example
// C++ // assume that 'this_union' and 'pk_long_ptr' // have already been initialized CORBA::UnionDef * this_union; CORBA::PrimitiveDef * pk_long_ptr; // set the discriminator_type_def to represent a CORBA::Long data type this_union-> discriminator_type_def (pk_long_ptr); // retrieve the discriminator_type_def information from the UnionDef // object CORBA::IDLType * ret_idltype_ptr; ret_idltype_ptr = this_union-> discriminator_type_def ();