[Previous] [Contents] [Next] [IONA Technologies]


CORBA.TypeCode


Contents

CORBA.TypeCode.TypeCode()
CORBA.TypeCode.TypeCode()
CORBA.TypeCode.TypeCode()
CORBA.TypeCode._nil()
CORBA.TypeCode._tc_string()
CORBA.TypeCode.clone()
CORBA.TypeCode.compare()
CORBA.TypeCode.copy()
CORBA.TypeCode.equals()
CORBA.TypeCode.IT_create()
CORBA.TypeCode.IT_create()
CORBA.TypeCode.IT_create()
CORBA.TypeCode.kind()
CORBA.TypeCode.param_count()
CORBA.TypeCode.parameter()
CORBA.TypeCode.toString()



Synopsis:

The Java class TypeCode implements the IDL pseudo interface TypeCode. TypeCode is used to describe arbitrary complex IDL type structures at runtime. A TypeCode consists of a kind and a sequence of parameters (a parameter is of type CORBA.Any). The kind classifies the TypeCode: for example, whether it is an IDL basic type, a struct, a sequence and so on. TypeCode constant values are defined in the OrbixWeb class TCKind. The parameters give the details of the type definition. For example, the IDL type sequence<long, 20> has the kind TCKind.tk_sequence and has parameters long and 20.

The parameters of each TypeCode are:


KIND

PARAMETER LIST

     TCKind.tk_null
    
     NONE
    
     TCKind.tk_void
    
     NONE
    
     TCKind.tk_short
    
     NONE
    
     TCKind.tk_long
    
     NONE
    
     TCKind.tk_ushort
    
     NONE
    
     TCKind.tk_ulong
    
     NONE
    
     TCKind.tk_float
    
     NONE
    
     TCKind.tk_double
    
     NONE
    
     TCKind.tk_boolean
    
     NONE
    
     TCKind.tk_char
    
     NONE
    
     TCKind.tk_octet
    
     NONE
    
     TCKind.tk_any
    
     NONE
    
     TCKind.tk_TypeCode
    
     NONE
    
     TCKind.tk_Principal
    
     NONE
    
     TCKind.tk_objref
    
     { interface-id }
    
     TCKind.tk_struct
    
     { struct-name,
       member-name, TypeCode,
       ...<repeat pairs>... }
    
     TCKind.tk_union
    
     { union-name, switch-TypeCode,
       label-value, member-name,
       TypeCode,
       ...<repeat triples>... }
    
     TCKind.tk_enum
    
     { enum-name, enum-id,
       ...<repeat enum-id>... }
    
     TCKind.tk_string
    
     { maxlen-integer }
    
     TCKind.tk_sequence
    
     { TypeCode, maxlen-integer }
    
     TCKind.tk_array
    
     { TypeCode, length-integer,
       <repeat length-integer>... }
    

A TypeCode of kind TCKind.tk_objref has a single parameter giving the interface name.

A TypeCode of kind TCKind.tk_struct has one parameter giving the struct name, and has two parameters for each member of the struct: the first giving the member's name and the second giving its TypeCode. A struct with N members has 2N+1 parameters.

A TypeCode of kind TCKind.tk_union has parameters giving the union name, the TypeCode of the switch (discriminator) of the union, and then three parameters for each member of the union: the first giving the label value, the second giving the member name and the third giving the member's TypeCode. If the union has a default member then the triple for this will have a label-value of 0 and the TypeCode of the corresponding any returned by parameter() will be the TypeCode for an octet, which is not a valid switch type for a union. Thus this 0 can be distinguished from a normal 0 switch value.

A TypeCode of kind TCKind.tk_enum has one parameter giving the enum name, and then one parameter for each enumerate constant. Enumerate constants are represented as strings.

A TypeCode of kind TCKind.tk_string has one parameter–an integer giving the maximum length of the string. A 0 length indicates an unbounded string.

A TypeCode of kind TCKind.tk_sequence has two parameters: a TypeCode for the element types, and a long for the length. A 0 length indicates an unbounded sequence.

A TypeCode of kind TCKind.tk_array has N+1 parameters, where N is the number of dimensions of the array. The first parameter is a TypeCode for the element types; the remainder are of type long.

Note that a TypeCode for an IDL exception is of kind TCKind.tk_struct and has the same parameters as a TypeCode for a struct.

An IDL operation with a parameter of type TypeCode translates into a Java method with a parameter of type TypeCode.

A TypeCode object reference constant declaration can be generated by the IDL compiler from named type definitions that appear in an IDL file–that is, from the following types:

A number of TypeCode object reference constants are always available to allow the user to access TypeCodes for standard types. These are defined in the CORBA class.

CORBA._tc_null

CORBA._tc_void

CORBA._tc_short

CORBA._tc_long

CORBA._tc_ushort

CORBA._tc_ulong

CORBA._tc_float

CORBA._tc_double

CORBA._tc_boolean

CORBA._tc_char

CORBA._tc_octet

CORBA._tc_any

CORBA._tc_TypeCode

CORBA._tc_Principal

CORBA._tc_Object

CORBA._tc_string

CORBA._tc_NamedValue

CORBA:

OrbixWeb:

See Also:



CORBA.TypeCode.TypeCode()


Synopsis:

Description:

Default constructor. The TypeCode is created with the default kind, tk_null.

Notes:

OrbixWeb specific.

See Also:

Other TypeCode constructors.



CORBA.TypeCode.TypeCode()


Synopsis:

Description:

Copy constructor.

Notes:

OrbixWeb specific.

See Also:

Other TypeCode constructor.



CORBA.TypeCode.TypeCode()


Synopsis:

Description:

Create a TypeCode for the specified TypeCode string.

Notes:

OrbixWeb specific.

See Also:

Other TypeCode constructors.



CORBA.TypeCode._nil()


Synopsis:

Description:

Returns a nil object reference for a TypeCode.

Notes:

CORBA defined.

See Also:



CORBA.TypeCode._tc_string()


Synopsis:

Description:

The TypeCode string. OrbixWeb programmers need not be aware of the format of TypeCode strings.

Notes:

OrbixWeb specific.

See Also:



CORBA.TypeCode.clone()


Synopsis:

Description:

Copies the current TypeCode to a new TypeCode object and returns the new object.

Notes:

OrbixWeb specific.



CORBA.TypeCode.compare()


Synopsis:

Description:

Returns true if the TypeCode specified in parameter tc holds the same value as the current TypeCode object.

Notes:

OrbixWeb specific.



CORBA.TypeCode.copy()


Synopsis:

Description:

Copies the TypeCode specified in parameter tc to the current object.

Notes:

OrbixWeb specific.



CORBA.TypeCode.equals()


Synopsis:

Description:

Compares the current TypeCode object with _obj. Two TypeCodes are equal when the IDL definitions from which they are compiled denote equal types.

Return Value:

Returns true if the TypeCodes are equal; returns false if they are unequal, or if _obj is not a TypeCode object.

Notes:

OrbixWeb specific.



CORBA.TypeCode.IT_create()


Synopsis:

Description:

In the absence of a CORBA specified way to create a TypeCode pseudo object, OrbixWeb provides the IT_create() method to initialise an object reference for a TypeCode.

The TypeCode is created with the default kind, tk_null.

Notes:

OrbixWeb specific



CORBA.TypeCode.IT_create()


Synopsis:

Description:

In the absence of a CORBA specified way to create a TypeCode pseudo object, OrbixWeb provides the IT_create() method to initialise an object reference for a TypeCode.

The TypeCode created is a copy of the TypeCode specified in parameter tc.

Notes:

OrbixWeb specific



CORBA.TypeCode.IT_create()


Synopsis:

Description:

In the absence of a CORBA specified way to create a TypeCode pseudo object, OrbixWeb provides the IT_create() method to initialise an object reference for a TypeCode.

The TypeCode is constructed from the TypeCode string tc_info.

Notes:

OrbixWeb specific



CORBA.TypeCode.kind()


Synopsis:

Description:

Finds the kind of the TypeCode.

Return Value:

Returns an integer constant from those defined in the class CORBA.TCKind.

Notes:

CORBA defined.

See Also:

CORBA.TCKind()



CORBA.TypeCode.param_count()


Synopsis:

Description:

Finds the number of parameters belonging to the TypeCode. For example, the IDL type sequence<long, 20> has two parameters: long and 20.

Return Value:

Returns the number of parameters.

Notes:

CORBA defined.



CORBA.TypeCode.parameter()


Synopsis:

Description:

Finds the parameter specified by index. For example, the IDL type sequence<long, 20> has two parameters: long and 20. Parameters are indexed from 0 to (param_count()-1).

Exceptions:

A Bounds exception is raised if an attempt is made to access a non-existent parameter.

Notes:

CORBA defined.



CORBA.TypeCode.toString()


Synopsis:

Description:

Returns the TypeCode string. OrbixWeb programmers need not be aware of the format of TypeCode strings.

Notes:

OrbixWeb specific.

See Also:



[Roadmap] [Utilities] [Compiling] [Configuration]
[Class Reference] [IR Reference] [Daemon Reference] [IDL Grammar] [System Exceptions]
[Index]