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