[Enterprise Extensions only]

ConstantDef::type_def

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.

IDL Syntax

  attribute IDLType type_def;

Read operations

Input parameters
none
Return values
CORBA::IDLType_ptr

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

Input parameters
CORBA::IDLType_ptr

The CORBA::IDLType_ptr must reference a simple type1.

Return values
none

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();