1 7 package org.omg.CORBA; 8 9 10 19 20 abstract public class UnionMemberHelper 21 { 22 private static String _id = "IDL:omg.org/CORBA/UnionMember:1.0"; 23 24 public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.UnionMember that) 25 { 26 org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); 27 a.type (type ()); 28 write (out, that); 29 a.read_value (out.create_input_stream (), type ()); 30 } 31 32 public static org.omg.CORBA.UnionMember extract (org.omg.CORBA.Any a) 33 { 34 return read (a.create_input_stream ()); 35 } 36 37 private static org.omg.CORBA.TypeCode __typeCode = null; 38 private static boolean __active = false; 39 synchronized public static org.omg.CORBA.TypeCode type () 40 { 41 if (__typeCode == null) 42 { 43 synchronized (org.omg.CORBA.TypeCode .class) 44 { 45 if (__typeCode == null) 46 { 47 if (__active) 48 { 49 return org.omg.CORBA.ORB.init().create_recursive_tc ( _id ); 50 } 51 __active = true; 52 org.omg.CORBA.StructMember [] _members0 = new org.omg.CORBA.StructMember [4]; 53 org.omg.CORBA.TypeCode _tcOf_members0 = null; 54 _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0); 55 _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.IdentifierHelper.id (), "Identifier", _tcOf_members0); 56 _members0[0] = new org.omg.CORBA.StructMember ( 57 "name", 58 _tcOf_members0, 59 null); 60 _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_any); 61 _members0[1] = new org.omg.CORBA.StructMember ( 62 "label", 63 _tcOf_members0, 64 null); 65 _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_TypeCode); 66 _members0[2] = new org.omg.CORBA.StructMember ( 67 "type", 68 _tcOf_members0, 69 null); 70 _tcOf_members0 = org.omg.CORBA.IDLTypeHelper.type (); 71 _members0[3] = new org.omg.CORBA.StructMember ( 72 "type_def", 73 _tcOf_members0, 74 null); 75 __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (org.omg.CORBA.UnionMemberHelper.id (), "UnionMember", _members0); 76 __active = false; 77 } 78 } 79 } 80 return __typeCode; 81 } 82 83 public static String id () 84 { 85 return _id; 86 } 87 88 public static org.omg.CORBA.UnionMember read (org.omg.CORBA.portable.InputStream istream) 89 { 90 org.omg.CORBA.UnionMember value = new org.omg.CORBA.UnionMember (); 91 value.name = istream.read_string (); 92 value.label = istream.read_any (); 93 value.type = istream.read_TypeCode (); 94 value.type_def = org.omg.CORBA.IDLTypeHelper.read (istream); 95 return value; 96 } 97 98 public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.UnionMember value) 99 { 100 ostream.write_string (value.name); 101 ostream.write_any (value.label); 102 ostream.write_TypeCode (value.type); 103 org.omg.CORBA.IDLTypeHelper.write (ostream, value.type_def); 104 } 105 106 } 107 | Popular Tags |