public TypeCodeImpl(ORB orb, int creationKind, String id, String name, StructMember[] members) // for structs and exceptions { this(orb); if ((creationKind == TCKind._tk_struct) || (creationKind == TCKind._tk_except)) { _kind = creationKind; setId(id); _name = name; _memberCount = members.length; _memberNames = new String[_memberCount]; _memberTypes = new TypeCodeImpl[_memberCount]; for (int i = 0 ; i < _memberCount ; i++) { _memberNames[i] = members[i].name; _memberTypes[i] = convertToNative(_orb, members[i].type); _memberTypes[i].setParent(this); } } // else initializes to null }
/** * Create the typecode. */ public static synchronized TypeCode type() { StructMember[] members = new StructMember[3]; TypeCode member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long); members[0] = new StructMember("n", member, null); member = OrbRestricted.Singleton.create_string_tc(0); members[1] = new StructMember("c", member, null); member = OrbRestricted.Singleton.get_primitive_tc(TCKind.tk_long); member = OrbRestricted.Singleton.create_array_tc(3, member); members[2] = new StructMember("arra", member, null); return OrbRestricted.Singleton.create_struct_tc( StructureToReturnHelper.id(), "StructureToReturn", members); }
/** * Create the TaggedComponent typecode (structure, named "TaggedComponent"). * The typecode states that the structure contains the following fields: tag, * component_data. */ public static TypeCode type() { ORB orb = OrbRestricted.Singleton; StructMember[] members = new StructMember[2]; TypeCode field; field = orb.create_alias_tc("IDL:omg.org/IOP/ComponentId:1.0", "ComponentId", orb.get_primitive_tc(TCKind.tk_ulong)); members[0] = new StructMember("tag", field, null); field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet)); members[1] = new StructMember("component_data", field, null); return orb.create_struct_tc(id(), "TaggedComponent", members); }
/** * Create the ServiceContext typecode (structure, named "ServiceContext"). The * typecode states that the structure contains the following fields: * context_id, context_data. */ public static TypeCode type() { ORB orb = OrbRestricted.Singleton; StructMember[] members = new StructMember[2]; TypeCode field; field = orb.create_alias_tc("IDL:omg.org/IOP/ServiceId:1.0", "ServiceId", orb.get_primitive_tc(TCKind.tk_ulong)); members[0] = new StructMember("context_id", field, null); field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet)); members[1] = new StructMember("context_data", field, null); return orb.create_struct_tc(id(), "ServiceContext", members); }
/** * Create the TaggedProfile typecode (structure, named "TaggedProfile"). The * typecode states that the structure contains the following fields: tag, * profile_data. */ public static TypeCode type() { ORB orb = OrbRestricted.Singleton; StructMember[] members = new StructMember[2]; TypeCode field; field = orb.create_alias_tc("IDL:omg.org/IOP/ProfileId:1.0", "ProfileId", orb.get_primitive_tc(TCKind.tk_ulong)); members[0] = new StructMember("tag", field, null); field = orb.create_sequence_tc(0, orb.get_primitive_tc(TCKind.tk_octet)); members[1] = new StructMember("profile_data", field, null); return orb.create_struct_tc(id(), "TaggedProfile", members); }
/** * Create the NameValuePair typecode (structure, * named "NameValuePair"). * The typecode states that the structure contains the * following fields: id, value. */ public static TypeCode type() { ORB orb = OrbRestricted.Singleton; StructMember[] members = new StructMember[ 2 ]; TypeCode field; field = orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0", "FieldName", orb.get_primitive_tc(TCKind.tk_string) ); members [ 0 ] = new StructMember("id", field, null); field = orb.get_primitive_tc(TCKind.tk_any); members [ 1 ] = new StructMember("value", field, null); return orb.create_struct_tc(id(), "NameValuePair", members); }
/** * Create the NameDynAnyPair typecode (structure, * named "NameDynAnyPair"). * The typecode states that the structure contains the * following fields: id, value. */ public static TypeCode type() { ORB orb = OrbRestricted.Singleton; StructMember[] members = new StructMember[ 2 ]; TypeCode field; field = orb.create_alias_tc("IDL:omg.org/DynamicAny/FieldName:1.0", "FieldName", orb.get_primitive_tc(TCKind.tk_string) ); members [ 0 ] = new StructMember("id", field, null); field = DynAnyHelper.type(); members [ 1 ] = new StructMember("value", field, null); return orb.create_struct_tc(id(), "NameDynAnyPair", members); }
/** * Create the InvalidPolicy typecode (emtpy structure, * named "InvalidPolicy"). * The typecode states that the structure contains the * single field, named "index". */ public static TypeCode type() { if (typeCode == null) { ORB orb = OrbRestricted.Singleton; StructMember[] members = new StructMember[ 1 ]; TypeCode field; field = orb.get_primitive_tc(TCKind.tk_ushort); members [ 0 ] = new StructMember("index", field, null); typeCode = orb.create_exception_tc(id(), "InvalidPolicy", members); } return typeCode; }
/** * Get the type code of the named component. */ public static TypeCode type() { ORB orb = OrbRestricted.Singleton; StructMember[] members = new StructMember[ 2 ]; TypeCode member; member = orb.create_string_tc(0); members [ 0 ] = new StructMember("id", member, null); member = orb.create_string_tc(0); members [ 1 ] = new StructMember("kind", member, null); return orb.create_struct_tc(NameComponentHelper.id(), "NameComponent", members ); }
/** {@inheritDoc} */ public TypeCode create_exception_tc(String id, String name, StructMember[] members ) { RecordTypeCode r = new RecordTypeCode(TCKind.tk_except); r.setId(id); r.setName(name); for (int i = 0; i < members.length; i++) { r.add(members [ i ]); } return r; }
/** {@inheritDoc} */ public TypeCode create_struct_tc(String id, String name, StructMember[] members ) { RecordTypeCode r = new RecordTypeCode(TCKind.tk_struct); r.setId(id); r.setName(name); for (int i = 0; i < members.length; i++) { r.add(members [ i ]); } return r; }