13.1.8.4 Member Functions
In addition to the accessor and modifiers, the following member
functions are generated for an OMG IDL union of type
TYPE
with switch (long) discriminator:
-
TYPE
();
- This is the default constructor for a union. No default discriminator is set by this function, so you cannot access the union until you set the value of the union.
-
TYPE( const TYPE&From);
- This copy constructor deep copies the specified union. Any data
in the union parameter is copied. The
From
argument specifies the union to be copied. -
~TYPE();
- This destructor frees the data associated with the union.
-
TYPE &operator=(const TYPE &From);
- This assignment operator copies the specified union. Any
existing value in the current union is freed. The
From
argument specifies the union to be copied. -
void _d (CORBA::Long Discrim);
- This modifier function sets the value of the union
discriminant. The
Discrim
argument specifies the new discriminant. The data type of the argument is determined by the OMG IDL data type specified in the switch statement of the union. For each OMG IDL data type, see the following table for the C++ data type. -
CORBA::Long _d () const;
- This function returns the current discriminant value. The data type of the return value is determined by the OMG IDL data type specified in the switch statement of the union. For each OMG IDL data type, see the following table for the C++ data type.
Parent topic: Unions