![]() |
Overview The members read and write operations provide for the access and update of the list of elements of an OMG IDL union definition in the Interface Repository. Original interface UnionDef Interface Exceptions CORBA::SystemException
Intended Usage
The members attribute contains a description of each union member. The members read and write operations allow the access and update of the members attribute.
IDL Syntax
attribute UnionMemberSeq members;
Read operations
- Input parameters
- None.
- Return values
- CORBA::UnionMemberSeq *
The returned pointer references a sequence that is representative of the union members. The memory is owned by the caller and can be released by invoking delete.
Write operations
- Input parameters
- CORBA::UnionMemberSeq & members
The members parameter provides the list of union members with which to update the UnionDef.
- Return values
- None.
Example
// C++ // assume 'this_union_def', 'pk_long_ptr', and 'pk_double_ptr' // have already been initialized CORBA::UnionDef * this_union_def; CORBA::PrimitiveDef * pk_long_ptr; CORBA::PrimitiveDef * pk_double_ptr; // establish and initialize the UnionMemberSeq . . . CORBA::UnionMemberSeq seq_update; seq_update.length (2); seq_update[0].name = CORBA::string_dup ("element_zero_long"); seq_update[0].label <<= (CORBA::Long) 1; seq_update[0].type_def = CORBA::IDLType::_duplicate (pk_long_ptr); seq_update[1].name = CORBA::string_dup ("element_one_double"); seq_update[1].label <<= (CORBA::Long) 2; seq_update[1].type_def = CORBA::IDLType::_duplicate (pk_double_ptr); // set the members attribute of the UnionDef using 'seq_update' this_union_def-> members (seq_update); // read the members attribute information from the UnionDef CORBA::UnionMemberSeq * returned_members; returned_members = this_union_def-> members ();
Related reference... | |
CORBA module in Object Request Broker | |
Parent: CORBA module: UnionDef Interface | |
UnionDef::discriminator_type | |
UnionDef::discriminator_type_def | |