Overview | The type_def operation returns a pointer to an IDLType that is representative of the type within a ConstantDef. |
Original interface | CORBA module: ConstantDef Interface |
Exceptions | CORBA::SystemException |
Intended Usage
The type_def attribute within a ConstantDef references an IDLType that identifies the definition of the type of the constant. Both read and write type_def operations are supported, the parameters of which are identified below.
Syntax
attribute IDLType type_def;
Read operations
The returned CORBA::IDLType * is a pointer to a copy of the information referenced by the type_def attribute. The object and the associated memory are owned by the caller and can be released by invoking CORBA::release.
Write operations
The CORBA::IDLType_ptr must reference a simple type (a PrimitiveDef of kind CORBA::pk_long, CORBA::pk_short, CORBA::pk_ulong, CORBA::pk_ushort, CORBA::pk_float, CORBA::pk_double, CORBA::pk_char, CORBA::pk_wchar, CORBA::pk_octet, CORBA::pk_boolean, CORBA::pk_wstring, or CORBA::pk_string).
Example
// C++ // assume that 'this_constant' and 'pk_long_def' // have already been initialized CORBA::ConstantDef * this_constant; CORBA::PrimitiveDef * pk_long_def; // set the type_def attribute of the constant // to represent a CORBA::Long this_constant-> type_def (pk_long_def); // retrieve the type_def attribute from the constant CORBA::IDLType * constants_type_def; constants_type_def = this_constant-> type_def();