1 package org.omg.DynamicAny; 2 3 4 10 11 12 22 abstract public class DynUnionHelper 23 { 24 private static String _id = "IDL:omg.org/DynamicAny/DynUnion:1.0"; 25 26 public static void insert (org.omg.CORBA.Any a, org.omg.DynamicAny.DynUnion that) 27 { 28 org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); 29 a.type (type ()); 30 write (out, that); 31 a.read_value (out.create_input_stream (), type ()); 32 } 33 34 public static org.omg.DynamicAny.DynUnion extract (org.omg.CORBA.Any a) 35 { 36 return read (a.create_input_stream ()); 37 } 38 39 private static org.omg.CORBA.TypeCode __typeCode = null; 40 synchronized public static org.omg.CORBA.TypeCode type () 41 { 42 if (__typeCode == null) 43 { 44 __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.DynamicAny.DynUnionHelper.id (), "DynUnion"); 45 } 46 return __typeCode; 47 } 48 49 public static String id () 50 { 51 return _id; 52 } 53 54 public static org.omg.DynamicAny.DynUnion read (org.omg.CORBA.portable.InputStream istream) 55 { 56 throw new org.omg.CORBA.MARSHAL (); 57 } 58 59 public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.DynamicAny.DynUnion value) 60 { 61 throw new org.omg.CORBA.MARSHAL (); 62 } 63 64 public static org.omg.DynamicAny.DynUnion narrow (org.omg.CORBA.Object obj) 65 { 66 if (obj == null) 67 return null; 68 else if (obj instanceof org.omg.DynamicAny.DynUnion ) 69 return (org.omg.DynamicAny.DynUnion )obj; 70 else if (!obj._is_a (id ())) 71 throw new org.omg.CORBA.BAD_PARAM (); 72 else 73 { 74 org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl )obj)._get_delegate (); 75 org.omg.DynamicAny._DynUnionStub stub = new org.omg.DynamicAny._DynUnionStub (); 76 stub._set_delegate(delegate); 77 return stub; 78 } 79 } 80 81 public static org.omg.DynamicAny.DynUnion unchecked_narrow (org.omg.CORBA.Object obj) 82 { 83 if (obj == null) 84 return null; 85 else if (obj instanceof org.omg.DynamicAny.DynUnion ) 86 return (org.omg.DynamicAny.DynUnion )obj; 87 else 88 { 89 org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl )obj)._get_delegate (); 90 org.omg.DynamicAny._DynUnionStub stub = new org.omg.DynamicAny._DynUnionStub (); 91 stub._set_delegate(delegate); 92 return stub; 93 } 94 } 95 96 } 97 | Popular Tags |