recursiveTCMap.put( startPosition, id );
StructMember[] struct_members = new StructMember[member_count];
for( int i = 0; i < member_count; i++)
{
struct_members[i] = new StructMember
(
read_string(),
read_TypeCode (recursiveTCMap, repeatedTCMap),
null
);
}
result = ((ORBSingleton) orb).create_struct_tc(id, name, struct_members, false);
putCachedTypecode (id, new Pair( result, startPosition ));
}
else
{
final int skipAmount = calcSkipAmount(size, start_pos);
updateTcMap( recursiveTCMap, start_pos, skipAmount, cachedObject.position );
skip (skipAmount);
recursiveTCMap.put( startPosition, id );
result = cachedObject.typeCode;
}
closeEncapsulation();
break;
}
case TCKind._tk_union: // 16
{
size = openEncapsulation();
id = validateID (read_string());
cachedObject = getCachedTypecode( id );
if (cachedObject == null)
{
name = validateName (read_string());
recursiveTCMap.put(startPosition, id );
org.omg.CORBA.TypeCode discriminator_type = read_TypeCode(recursiveTCMap, repeatedTCMap);
// Use the dealiased discriminator type for the label types.
// This works because the JacORB IDL compiler ignores any aliasing
// of label types and only the discriminator type is passed on the
// wire.
org.omg.CORBA.TypeCode orig_disc_type =
TypeCode.originalType(discriminator_type);
int default_index = read_long();
member_count = read_long();
UnionMember[] union_members = new UnionMember[member_count];
for( int i = 0; i < member_count; i++)
{
org.omg.CORBA.Any label = orb.create_any();
if( i == default_index )
{
// Default discriminator
label.insert_octet( read_octet());
}
else
{
// use the dealiased discriminator type to construct labels
label.read_value( this, orig_disc_type );
}
union_members[i] = new UnionMember
(
read_string(),
label,
read_TypeCode(recursiveTCMap, repeatedTCMap),
null
);
}
result = ((ORBSingleton)orb).create_union_tc(id, name, discriminator_type, union_members, false);
putCachedTypecode (id, new Pair( result, startPosition ));
}
else
{
final int skipAmount = calcSkipAmount(size, start_pos);
updateTcMap(recursiveTCMap, start_pos, skipAmount, cachedObject.position );
skip (skipAmount);
recursiveTCMap.put( startPosition, id );
result = cachedObject.typeCode;
}
closeEncapsulation();
break;
}
case TCKind._tk_enum: // 17
{
size = openEncapsulation();
id = validateID (read_string());
cachedObject = getCachedTypecode( id );
if (cachedObject == null)
{
name = validateName (read_string());
member_count = read_long();
member_names = new String[member_count];
for( int i = 0; i < member_count; i++)
{
member_names[i] = read_string();
}
result = ((ORBSingleton)orb).create_enum_tc (id, name, member_names, false);
putCachedTypecode (id, new Pair( result, startPosition ));
}
else
{
final int skipAmount = calcSkipAmount(size, start_pos);
skip (skipAmount);
result = cachedObject.typeCode;
}
closeEncapsulation();
break;
}
case TCKind._tk_string: // 18
{
result = orb.create_string_tc(read_long());
break;
}
case TCKind._tk_sequence: // 19
{
size = openEncapsulation();
content_type = read_TypeCode(recursiveTCMap, repeatedTCMap);
cachedObject = getCachedTypecode(content_type);
if (cachedObject == null)
{
length = read_long();
result = orb.create_sequence_tc(length, content_type);
putCachedTypecode(result, new Pair(result, startPosition));
}
else
{
final int skipAmount = calcSkipAmount(size, start_pos);
skip (skipAmount);
result = cachedObject.typeCode;
}
closeEncapsulation();
break;
}
case TCKind._tk_array: // 20
{
size = openEncapsulation();
content_type = read_TypeCode(recursiveTCMap, repeatedTCMap);
cachedObject = getCachedTypecode(content_type);
if (cachedObject == null)
{
result = orb.create_array_tc(read_long(), content_type );
// Store in cache
putCachedTypecode (result, new Pair( result, startPosition ));
}
else
{
int skipAmount = calcSkipAmount(size, start_pos);
skip (skipAmount);
result = cachedObject.typeCode;
}
closeEncapsulation();
break;
}
case TCKind._tk_alias: // 21
{
size = openEncapsulation();
id = validateID (read_string());
cachedObject = getCachedTypecode( id );
if (cachedObject == null)
{
name = validateName (read_string());
recursiveTCMap.put(startPosition, id );
content_type = read_TypeCode( recursiveTCMap, repeatedTCMap);
result = orb.create_alias_tc (id, name, content_type );
putCachedTypecode (id, new Pair( result, startPosition ));
}
else
{
final int skipAmount = calcSkipAmount(size, start_pos);
updateTcMap(recursiveTCMap, start_pos, skipAmount, cachedObject.position );
skip (skipAmount);
recursiveTCMap.put( startPosition, id );
result = cachedObject.typeCode;
}
closeEncapsulation();
break;
}
case TCKind._tk_except: // 22
{
size = openEncapsulation();
id = validateID (read_string());
cachedObject = getCachedTypecode( id );
if (cachedObject == null)
{
name = validateName (read_string());
member_count = read_long();
recursiveTCMap.put(startPosition, id );
StructMember[] members = new StructMember[member_count];
for( int i = 0; i < member_count; i++)
{
members[i] = new StructMember
(
read_string(),
read_TypeCode(recursiveTCMap, repeatedTCMap),
null
);