Overview | Represents an OMG IDL type. |
File name | typecode.h |
Supported methods | TypeCode::_duplicate |
TypeCode::_nil | |
TypeCode::content_type | |
TypeCode::default_index | |
TypeCode::discriminator_type | |
TypeCode::equal | |
TypeCode::id | |
TypeCode::kind | |
TypeCode::length | |
TypeCode::member_count | |
TypeCode::member_label | |
TypeCode::member_name | |
TypeCode::member_type | |
TypeCode::name | |
Exceptions |
|
Intended Usage
A TypeCode represents an OMG IDL type. A TypeCode is an integral part of the any type and is used to specify the type of the value. The Interface Repository also uses TypeCodes to store information about types declared in IDL.
A TypeCode consists of a "kind" field and zero or more parameters to fully describe the underlying data type. For example, the TypeCode describing IDL type char has kind tk_char and no parameters. The TypeCode describing the IDL type array has kind tk_array and two parameters, a TypeCode describing the type of elements in the array and a long indicating the length of the array. CORBA::ORB provides methods to create complex TypeCodes (TypeCodes which have parameters). The naming convention for these methods is create_<type>_tc. For example, the method create_array_tc creates a tk_array TypeCode.
Methods are provided to access the various parts of a TypeCode. Since the structure of a TypeCode varies, most methods are only applicable to certain TypeCodes. The BadKind exception is raised if a method is not applicable to the target TypeCode. Methods that deal with indexing raise the Bounds exception if the input index is greater than or equal to the number of members constituting the type.For additional information, see the Any and ORB class descriptions.