module CORBA{
    enum TCKind{
        tk_null, tk_void, 
        tk_short, tk_long, tk_ushort, tk_ulong, 
        tk_float, tk_double, tk_boolean, tk_char, 
        tk_octet, tk_any, tk_TypeCode, tk_Principal, tk_objref, 
        tk_struct, tk_union, tk_enum, tk_string, 
        tk_sequence, tk_array, tk_alias, tk_except
    };
    interface TypeCode{
        exception Bounds{};
        exception BadKind{};
        boolean        equal( in TypeCode tc ); 
        TCKind         kind();
        RepositoryId   id()
            raises( BadKind ); 
        Identifier     name()
            raises( BadKind ); 
        unsigned long  member_count()
            raises( BadKind, Bounds ); 
        Identifier     member_name(
            in unsigned long index ) 
            raises( BadKind, Bounds ); 
        TypeCode       member_type(
            in unsigned long index ) 
            raises( BadKind, Bounds ); 
        any            member_label(
            in unsigned long index ) 
            raises( BadKind, Bounds ); 
        TypeCode       discriminator_type()
            raises( BadKind ); 
        long           default_index()
            raises( BadKind ); 
        unsigned long  length()
            raises( BadKind ); 
        TypeCode       content_type()
            raises( BadKind ); 
        long           param_count();
        any            parameter( in long index ) 
            raises( Bounds ); 
    };
};TypeCodeインタフェースの機能説明を以下に示します。
TypeCodeのメソッド  | 機能説明  | 
|---|---|
equal  | 指定されたTypeCodeが等しいかを比較します。  | 
kind  | TypeCodeの指すデータ型の数値を返します。  | 
id  | TypeCodeの指すデータ型のリポジトリIDを返します。  | 
name  | TypeCodeの指すデータ型の名前を返します。  | 
member_count  | TypeCodeの指すデータ型に含まれるメンバの数を返します。  | 
member_name  | 指定したメンバの名前を返します。  | 
member_type  | 指定したメンバのTypeCodeを返します。  | 
member_label  | 指定したメンバのラベルを返します。  | 
discriminator_type  | 弁別情報定義のTypeCodeを返します。  | 
default_index  | defaultメンバのインデックスを返します。  | 
length  | TypeCodeオブジェクトの長さ(要素数)を返します。  | 
content_type  | メンバのTypeCodeを返します。  | 
各データ型で使用できるTypeCodeインタフェースを以下に示します。
  | string  | enum  | sequence  | struct  | union  | array  | alias  | ObjectRef  | exception  | 
|---|---|---|---|---|---|---|---|---|---|
id  | 
  | ○  | 
  | ○  | ○  | 
  | ○  | ○  | ○  | 
name  | ○  | ○  | 
  | ○  | ○  | 
  | ○  | ○  | ○  | 
member_count  | 
  | ○  | 
  | ○  | ○  | 
  | 
  | 
  | ○  | 
member_name  | 
  | ○  | 
  | ○  | ○  | 
  | 
  | 
  | ○  | 
member_type  | 
  | ○  | 
  | ○  | ○  | 
  | 
  | 
  | ○  | 
member_label  | 
  | 
  | 
  | ×  | ○  | 
  | 
  | 
  | 
  | 
discriminator_type  | 
  | 
  | 
  | ×  | ○  | 
  | 
  | 
  | 
  | 
default_index  | 
  | 
  | 
  | 
  | ○  | 
  | 
  | 
  | 
  | 
length  | ○  | 
  | ○  | 
  | 
  | ○  | 
  | 
  | 
  | 
content_type  | 
  | 
  | ○  | 
  | 
  | ○  | 
  | 
  | 
  |