// File CORBA_TypeCode.idl
// CORBA 3.0 Chapter 4

#ifdef _PRE_3_0_COMPILER_ 
#pragma prefix "omg.org"
#else
typeprefix CORBA "omg.org";
#endif

   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,
        tk_longlong,tk_ulonglong,   tk_longdouble,
        tk_wchar,   tk_wstring,     tk_fixed,
        tk_value,   tk_value_box,
        tk_native,
        tk_abstract_interface,
        tk_local_interface,
	tk_component, tk_home,
	tk_event
    };
    typedef short ValueModifier;
    const ValueModifier VM_NONE         = 0;
    const ValueModifier VM_CUSTOM       = 1;
    const ValueModifier VM_ABSTRACT     = 2;
    const ValueModifier VM_TRUNCATABLE  = 3;

    interface TypeCode {
        exception   Bounds {};
        exception   BadKind {};
        // for all TypeCode kinds
        boolean     equal       (in TypeCode tc);
        boolean     equivalent  (in TypeCode tc); 
        TypeCode    get_compact_typecode(); 
        TCKind      kind ();
        // for tk_objref, tk_struct,    tk_union,  tk_enum, tk_alias, 
        //     tk_value,  tk_value_box, tk_native, tk_abstract_interface
        // and tk_except
        RepositoryId    id () raises (BadKind);
        // for tk_objref, tk_struct,    tk_union,  tk_enum, tk_alias, 
        //     tk_value,  tk_value_box, tk_native, tk_abstract_interface
        // and tk_except
        Identifier name () raises (BadKind);
        // for tk_struct, tk_union, tk_enum, tk_value, 
        // and tk_except
        unsigned long   member_count () raises (BadKind);
        Identifier      member_name (in unsigned long index) 
                                                raises (BadKind, Bounds);
        // for tk_struct, tk_union, tk_value, and tk_except
        TypeCode        member_type (in unsigned long index) 
                                                raises (BadKind, Bounds);
        // for tk_union
        any             member_label (in unsigned long index) 
                                                raises (BadKind, Bounds);
        TypeCode        discriminator_type ()   raises (BadKind);
        long            default_index ()        raises (BadKind); 
        // for tk_string, tk_sequence, and tk_array
        unsigned long   length ()               raises (BadKind);
        // for tk_sequence, tk_array, tk_value_box, and tk_alias
        TypeCode        content_type ()         raises (BadKind);
        // for tk_fixed
        unsigned short  fixed_digits()          raises (BadKind);
        short           fixed_scale()           raises (BadKind);
        // for tk_value
        Visibility      member_visibility(in unsigned long index)
                                                raises(BadKind, Bounds);
        ValueModifier   type_modifier()         raises(BadKind);
        TypeCode        concrete_base_type()    raises(BadKind);
    };
